This manual, as well as the software described in it, is furnished under license and may be
used or copied only in accordance with the terms of such license. The content of this manual is
furnished for informational use only, is subject to change without notice and should not be
construed as a commitment by Moog Inc., Animatics. Moog Inc., Animatics assumes no
responsibility or liability for any errors or inaccuracies that may appear herein.
Except as permitted by such license, no part of this publication may be reproduced, stored in a
retrieval system or transmitted, in any form or by any means, electronic, mechanical,
recording, or otherwise, 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
the user's responsibility to decide if a particular code sample or program applies to the
application being developed and to adjust the values to fit that application.
Moog Animatics and the Moog Animatics logo, SmartMotor and the SmartMotor logo,
Combitronic and the Combitronic logo, and SMI are all trademarks of Moog Inc., Animatics.
Other trademarks are the property of their respective owners.
Please let us know if you find any errors or omissions in this manual so that we can improve it
for future readers. Such notifications should contain the words "Developer's Guide" in the
subject line and be sent by e-mail to: animatics_marcom@moog.com. Thank you in advance
for your contribution.
Contact Us:
Americas - West
Moog Animatics
2581 Leghorn Street
Mountain View, CA 94043
USA
Tel: 1 650-960-4215Tel: 1 610-328-4000 x3999
Support: 1 888-356-0357
Website: www.animatics.com
Email: animatics_sales@moog.com
Americas - East
Moog Animatics
750 West Sproul Road
Springfield, PA 19064
USA
Fax: 1 610-605-6216
Table Of Contents
Introduction27
Overview28
Combitronic Support28
Communication Lockup Wizard30
Safety Information30
Safety Symbols30
Other Safety Considerations31
Motor Sizing31
Environmental Considerations31
Machine Safety31
Documentation and Training32
Additional Equipment and Considerations33
Safety Information Resources33
Additional Documents34
Related Guides34
Other Documents34
Additional Resources35
Part 1: Programming the SmartMotor36
Beginning Programming47
Setting the Motor Firmware Version48
Setting the Default Firmware Version48
Checking the Default Firmware Version49
Opening the SMIWindow (Program Editor)49
Understanding the Program Requirements50
Creating a "Hello World" Program51
Entering the Program in the SMI Editor51
Adding Comments to the Code52
Checking the Program Syntax52
Saving the Program52
Downloading a Program to the SmartMotor52
Syntax Checking, Compiling and Downloading the Program53
Additional Notes on Downloaded Programs53
Running a Downloaded Program54
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 3 of 909
Using the Program Download Window55
Using the Terminal Window and Run Program Button55
Using the RUN Command in the Terminal Window55
Creating a Simple Motion Program56
SMISoftware Features57
Introduction58
Menu Bar58
Toolbar59
Configuration Window61
Terminal Window63
Initiating Motion from the Terminal Window65
Information Window65
Program Editor66
Motor View68
SMI Trace Functions70
Monitor Window73
Serial Data Analyzer75
Chart View76
Chart View Example77
Macros80
Tuner82
SMIOptions86
SMIHelp87
Context-Sensitive Help Using F187
Context-Sensitive Help Using the Mouse87
Help Buttons87
Hover Help87
Table of Contents87
Projects88
SmartMotor Playground89
Opening the SmartMotor Playground90
Moving the Motor91
Communication Details93
Introduction95
Connecting to a Host96
Daisy Chaining Multiple D-Style SmartMotors over RS-23297
ADDR=formula98
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Should I choose Source Counts or Intermediate Counts?157
Should I choose Variable or Fixed cam?157
Electronic Camming Notes and Best Practices159
Examples161
Electronic Gearing and Camming over CANopen161
Electronic Camming Commands162
CTE(table)162
CTA(points,seglen[,location])162
CTW(pos[,seglen][,user])162
MCE(arg)163
MCW(table,point)163
RCP164
RCTT164
MC164
MCMUL=formula164
MCDIV=formula164
O(arg)=formula164
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 8 of 909
OSH(arg)=formula164
Cam Example Program165
Mode Switch Example168
Position Counters170
Modulo Position171
Modulo Position Commands171
Dual Trajectories172
Commands That Read Trajectory Information174
Dual Trajectory Example Program175
Synchronized Motion175
Synchronized-Target Commands175
PTS(), PRTS()175
VTS=formula176
ADTS=formula, ATS=formula, DTS=formula177
PTSS(), PRTSS()177
A Note About PTS and PTSS177
Other Synchronized-Motion Commands178
GS178
TSWAIT179
Program Flow Details181
Introduction182
Flow Commands182
RUN183
RUN?183
GOTO#, GOTO(label), C#183
GOSUB#, GOSUB(label), RETURN184
IF, ENDIF184
ELSE, ELSEIF185
WHILE, LOOP186
SWITCH, CASE, DEFAULT, BREAK, ENDS186
TWAIT187
WAIT=formula187
STACK187
END188
Program Flow Examples189
IF, ELSEIF, ELSE, ENDIF Examples189
WHILE, LOOPExamples189
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 9 of 909
GOTO(), GOSUB() Examples190
SWITCH, CASE, BREAK, ENDS Examples191
Interrupt Programming192
ITR(), ITRE, ITRD, EITR(), DITR(), RETURNI192
TMR(timer,time)194
Variables and Math195
Introduction196
Variable Commands196
EPTR=formula196
VST(variable,number)196
VLD(variable,number)197
Math Expressions197
Math Operations197
Logical Operations197
Integer Operations197
Floating Point Functions197
Math OperationDetails and Examples198
Array Variables198
Array Variable Examples199
Error and Fault Handling Details200
Motion and Motor Faults201
Overview201
Drive Stage Indications and Faults201
Fault Bits201
Error Handling202
Example Fault-Handler Code202
PAUSE203
RESUME203
Limits and Fault Handling204
Position Error Limits204
dE/dt Limits204
Velocity Limits204
Hardware Limits204
Software Limits205
Fault Handling205
Monitoring the SmartMotor Status206
System Status208
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 10 of 909
Introduction209
Retrieving and Manipulating Status Words/Bits209
System and Motor Status Bits209
Reset Error Flags211
System Status Examples211
Timer Status Bits212
Interrupt Status Bits212
I/O Status213
User Status Bits213
Multiple Trajectory Support Status Bits214
Cam Status Bits215
Interpolation Status Bits216
Motion Mode Status216
RMODE, RMODE(arg)216
I/OControl Details217
I/O Port Hardware218
I/O Connections Example (D-Style Motors)219
I/O Voltage Spikes219
Discrete Input and Output Commands220
Discrete Input Commands220
Discrete Output Commands220
Output Condition and Fault Status Commands221
Output Condition Commands221
Output Fault Status Reports221
General-Use Input Configuration221
Multiple I/OFunctions Example222
Analog Functions of I/O Ports223
5 Volt Push-Pull I/O Analog Functions (D-Style Motors)223
24 Volt I/O Analog Functions (D-Style AD1 Option Motors, M-Style Motors)223
Special Functions of I/OPorts224
Class 5 D-Style Motors: Special Functions of I/O Ports225
I/O Ports 0 and 1 – External Encoder Function Commands225
I/O Ports 2 and 3 – Travel Limit Inputs225
I/O Ports 4 and 5 – Communications225
I/O Port 6 – Go Command, Encoder Index Capture Input226
Class 5 M-Style Motors: Special Functions of I/O Ports227
COM Port Pins 4, 5, 6, and 8 – A-quad-B or Step-and-Direction Modes227
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 11 of 909
I/O Ports 2 and 3 – Travel Limit Inputs227
I/O Port 5 – Encoder Index Capture Input227
I/O Port 6 – Go Command228
Class 6 M-Style Motors: Special Functions of I/O Ports229
COM Port Pins 4, 5, 6, and 8 – A-quad-B or Step-and-Direction Modes229
I/O Ports 2 and 3 – Travel Limit Inputs229
I/O Port 4 and 5 – Encoder Index Capture Input229
I/O Port 6 – Go Command230
I/O Brake Output Commands230
I²C Expansion (D-Style Motors)230
Tuning and PIDControl231
Introduction232
Understanding the PID Control232
Tuning the PID Control233
Using F233
Setting KP234
Setting KD234
Setting KI and KL234
Setting EL=formula235
Other PID Tuning Parameters235
KG=formula235
KV=formula235
KA=formula236
Current Limit Control237
AMPS=formula237
Part 2: SmartMotor Command Reference238
(Single Space Character)240
a...z241
aa...zz241
aaa...zzz241
Ra...Rz241
Raa...Rzz241
Raaa...Rzzz241
ab[index]=formula245
Rab[index]245
ABS(value)248
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 12 of 909
RABS(value)248
AC250
RAC250
ACOS(value)253
RACOS(value)253
ADDR=formula255
RADDR255
ADT=formula257
ADTS=formula259
af[index]=formula261
Raf[index]261
Ai(arg)264
Aij(arg)266
Aj(arg)268
Aji(arg)270
al[index]=formula272
Ral[index]272
AMPS=formula275
RAMPS275
ASIN(value)278
RASIN(value)278
AT=formula280
RAT280
ATAN(value)282
RATAN(value)282
ATOF(index)284
RATOF(index)284
ATS=formula286
aw[index]=formula288
Raw[index]288
B(word,bit)291
RB(word,bit)291
Ba295
RBa295
BAUD(channel)=formula297
RBAUD(channel)297
Be299
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 13 of 909
RBe299
Bh301
RBh301
Bi(enc)304
RBi(enc)304
Bj(enc)307
RBj(enc)307
Bk310
RBk310
Bl311
RBl311
Bls313
RBls313
Bm315
RBm315
Bms317
RBms317
Bo319
RBo319
Bp320
RBp320
Bps322
RBps322
Br324
RBr324
BREAK326
BRKENG328
BRKRLS330
BRKSRV332
BRKTRJ334
Brs336
RBrs336
Bs338
RBs338
Bt340
RBt340
Bv342
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 14 of 909
RBv342
Bw344
RBw344
Bx(enc)346
RBx(enc)346
C{number}348
CADDR=formula350
RCADDR350
CAN, CAN(arg)352
RCAN, RCAN(arg)352
CANCTL(function,value)354
CASE formula355
CBAUD=formula358
RCBAUD358
CCHN(type,channel)360
CHN(channel)361
RCHN(channel)361
CLK=formula363
RCLK363
COMCTL(function,value)364
COS(value)366
RCOS(value)366
CP368
RCP368
CTA(points,seglen[,location])370
CTE(table)372
CTR(enc)374
RCTR(enc)374
CTT376
RCTT376
CTW(pos[,seglen][,user])377
DEA380
RDEA380
DEFAULT382
DEL=formula384
RDEL384
DELM(arg)386
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 15 of 909
DFS(value)387
RDFS(value)387
DITR(int)388
DT=formula390
RDT390
DTS=formula392
EA394
REA394
ECHO396
ECHO0398
ECHO1399
ECHO_OFF400
ECHO_OFF0401
ECHO_OFF1402
ECS(counts)403
EIGN(...)405
EILN408
EILP410
EIRE412
EIRI414
EISM(6)416
EITR(int)417
EL=formula419
REL419
ELSE421
ELSEIF formula423
ENC0425
ENC1426
ENCCTL(function,value)428
ENCD(in_out)430
END431
ENDIF433
ENDS435
EOBK(IO)437
EOIDX(number)439
EPTR=formula440
REPTR440
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 16 of 909
ERRC441
RERRC441
ERRW443
RERRW443
ETH(arg)444
RETH(arg)444
ETHCTL(function,value)445
F446
FABS(value)448
RFABS(value)448
FSA(cause,action)450
FSQRT(value)452
RFSQRT(value)452
FW454
RFW454
G456
GETCHR459
RGETCHR459
GETCHR1461
RGETCHR1461
GOSUB(label)463
GOTO(label)465
GS467
HEX(index)469
RHEX(index)469
I(enc)471
RI(enc)471
IDENT=formula473
RIDENT473
IF formula475
IN(...)478
RIN(...)478
INA(...)481
RINA(...)481
IPCTL(function,"string")484
ITR(Int#,StatusWord,Bit#,BitState,Label#)486
ITRD489
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 17 of 909
ITRE491
J(enc)493
RJ(enc)493
KA=formula495
RKA495
KD=formula497
RKD497
KG=formula499
RKG499
KI=formula501
RKI501
KII=formula503
RKII503
KL=formula504
RKL504
KP=formula506
RKP506
KPI=formula508
RKPI508
KS=formula509
RKS509
KV=formula511
RKV511
LEN513
RLEN513
LEN1514
RLEN1514
LFS(value)516
RLFS(value)516
LOAD518
LOCKP521
LOOP522
MC524
MCDIV=formula527
RMCDIV527
MCE(arg)528
MCMUL=formula530
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 18 of 909
RMCMUL530
MCW(table,point)532
MDB534
MDC536
MDE538
MDH540
MDHV542
MDS544
MDT546
MF0548
MFA(distance[,m/s])550
MFCTP(arg1,arg2)553
MFD(distance[,m/s])555
MFDIV=formula558
MFH(distance[,m/s])560
MFHTP=formula562
MFL(distance[,m/s])564
MFLTP=formula566
MFMUL=formula568
MFR570
MFSDC(distance,mode)573
MFSLEW(distance[,m/s])575
MINV(arg)577
MODE579
RMODE579
MP582
MS0585
MSR587
MT589
MTB591
MV593
NMT595
N/A595
O=formula, O(trj#)=formula597
OC(...)599
ROC(...)599
OCHN(...)601
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 19 of 909
OF(...)603
ROF(...)603
OFF605
OR(value)607
OS(...)609
OSH=formula, OSH(trj#)=formula611
OUT(...)=formula613
PA615
RPA615
PAUSE617
PC, PC(axis)619
RPC, RPC(axis)619
PI622
RPI622
PID#623
PMA626
RPMA626
PML=formula628
RPML628
PMT=formula630
RPMT630
PRA632
RPRA632
PRC635
RPRC635
PRINT(...)638
PRINT0(...)642
PRINT1(...)646
PRINT8(...)649
PRT=formula652
RPRT652
PRTS(...)654
PRTSS(...)656
PT=formula658
RPT658
PTS(...)660
PTSD663
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 20 of 909
RPTSD663
PTSS(...)664
PTST666
RPTST666
RANDOM=formula667
RRANDOM667
RCKS669
RES670
RRES670
RESUME672
RETURN674
RETURNI676
RSP678
RSP1680
RSP5681
RUN682
RUN?684
S (as command)686
SADDR#688
SAMP690
RSAMP690
SDORD(...)692
RSDORD692
SDOWR(...)694
SILENT696
SILENT1698
SIN(value)700
RSIN(value)700
SLD702
SLE704
SLEEP706
SLEEP1708
SLM(mode)710
RSLM710
SLN=formula712
RSLN712
SLP=formula714
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 21 of 909
RSLP714
SNAME("string")716
SP2717
RSP2717
SQRT(value)718
RSQRT(value)718
SRC(enc_src)720
STACK722
STDOUT=formula725
SWITCH formula727
T=formula730
Read/write730
TALK732
TALK1734
TAN(value)736
RTAN(value)736
TEMP, TEMP(arg)738
RTEMP, RTEMP(arg)738
TH=formula740
RTH740
TMR(timer,time)743
RTMR(timer)743
TRQ745
RTRQ745
TS=formula747
RTS747
TSWAIT749
TWAIT(gen#)750
UIA752
RUIA752
UJA754
RUJA754
UO(...)=formula756
UP758
UPLOAD760
UR(...)762
US(...)764
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 22 of 909
USB(arg)766
RUSB766
VA768
RVA768
VAC(arg)771
VC776
RVC776
VL=formula778
RVL778
VLD(variable,number)780
VST(variable,number)784
VT=formula788
RVT788
VTS=formula791
W(word)793
RW(word)793
WAIT=formula795
WAKE797
WAKE1799
WHILE formula801
X804
Z806
Z(word,bit)808
Za810
Ze811
Zh812
Zl813
Zls814
Zr815
Zrs816
Zs817
ZS818
Zv821
Zw822
Part 3: Example SmartMotor Programs823
Move Back and Forth824
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 23 of 909
Move Back and Forth with Watch824
Home Against a Hard Stop (Basic)825
Home Against a Hard Stop (Advanced)825
Home Against a Hard Stop (Two Motors)826
Home to Index Using Different Modes828
Maintain Velocity During Analog Drift829
Long-Term Storage of Variables830
Find Errors and Print Them830
Change Speed on Digital Input831
Pulse Output on a Given Position831
Stop Motion if Voltage Drops832
Camming - Variable Cam Example833
Camming - Fixed Cam with Input Variables834
Camming - Demo XYCircle836
Chevron Traverse & Takeup838
CAN Bus - Timed SDOPoll840
CAN Bus - I/OBlock with PDOPoll841
CAN Bus - Time Sync Follow Encoder844
Text Replacement in an SMI Program852
Appendix854
Motion Command Quick Reference856
Array Variable Memory Map858
ASCIICharacter Set860
Binary Data861
Command Error Codes864
Decoding the Error864
Finding the Error Source865
Glossary866
Math Operators873
Moment of Inertia874
Matching Motor to Load874
Improving the Moment of Inertia Ratio874
RCAN, RCHN and RMODEStatus875
RCAN Status Decoder875
RCHN Status Decoder875
Clearing Serial Port Errors876
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 24 of 909
RMODE Status Decoder876
Mode Status Example876
Scale Factor Calculation877
Sample Rates877
PID Sample Rate Command877
Encoder Resolution and the RES Parameter877
Native Velocity and Acceleration Units878
Velocity Calculations878
Acceleration Calculations878
Status Words879
Status Word: 0Primary Fault/Status Indicator879
Status Word: 1Index Registration and Software Travel Limits880
Status Word: 2Communications, Program and Memory880
Status Word: 3PID State, Brake, Move Generation Indicators881
Status Word: 4 Interrupt Timers881
Status Word: 5 Interrupt Status Indicators882
Status Word: 6 Drive Modes882
Status Word 7: Multiple Trajectory Support883
Status Word 8: Cam Support884
Status Word 10: RxPDO Arrival Notification884
Status Word 12: User Bits Word 0885
Status Word 13: User Bits Word 1885
Status Word: 16 On Board Local I/O Status: D-Style Motor886
Status Word: 16 On Board Local I/O Status: M-Style Motor886
Status Word: 17 Expanded I/O Status: D-Style AD1 Motor887
Torque Curves888
Understanding Torque Curves888
Peak Torque888
Continuous Torque888
Ambient Temperature Effects on Torque Curves and Motor Response:889
Supply Voltage Effects on Torque Curves and Motor Response:889
Example 1: Rotary Application890
Example 2: Linear Application890
Dyno Test Data vs. the Derated Torque Curve890
Proper Sizing and Loading of the SmartMotor891
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 25 of 909
Commands Listed Alphabetically893
Commands Listed by Function900
Communications Control901
Data Conversion902
EEPROM (Nonvolatile Memory)902
I/OControl902
Math Function903
Motion Control903
Program Access906
Program Execution and Flow Control906
Reset Commands907
System907
Variables908
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 26 of 909
Introduction
Introduction
Introduction
This chapter provides introductory reference material.
Overview28
Combitronic Support28
Communication Lockup Wizard30
Safety Information30
Additional Documents34
Additional Resources35
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 27 of 909
Introduction
Introduction: Overview
Overview
The SmartMotor™ Developer's Guide is designed to be used by system developers and
programmers when developing applications for the SmartMotor. Before using the
SmartMotor™ Developer's Guide, it is strongly recommended that you first read the
SmartMotor™ Installation & Startup Guide for your SmartMotor, which describes how to
install and start up the SmartMotor, and test initial communications with the motor. After that,
use this guide to learn about advanced SmartMotor features, 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
related information on key SMIsoftware features, communications, motion control, program
flow control, error and fault handling, and more.
Part Two of this guide lists all the SmartMotor commands in alphabetical order. Each
command is described in detail. Code snippets and examples are provided where applicable.
These are shown in a Courier font. Comments are included and separated with a single
quotation mark as they would be in your own programs.
NOTE: The programs and code samples in this manual are provided for example
purposes only. It is the user's responsibility to decide if a particular code sample or
program applies to the application 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 the command page. It is designed to guide you to other commands that offer similar
functionality, and ensure you are aware of every programming option the SmartMotor
provides to address your specific application requirements.
Part Three of this guide provides a library of useful example SmartMotor programs. These can
be used as "how to" examples for using a particular SmartMotor feature or solving a particular
application problem, or as starting points for your application.
NOTE: The programs and code samples in this manual are provided for example
purposes only. It is the user's responsibility to decide if a particular code sample or
program applies to the application 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
application development.
A quick-reference command list is also included at the end of this guide.
Combitronic Support
A large number of the commands provide Combitronic™ support. Combitronic is a protocol
that operates over a standard "CAN" (Controller Area Network) interface. It may coexist with
either CANopen 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 the same network communicates on an equal footing, sharing all information,
and therefore, sharing all processing resources. For more details on Combitronic features,
see Combitronic Communications on page 111, and also see the overview on the Moog
Animatics website at:
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 28 of 909
Introduction
Introduction: Combitronic Support
For applicable commands, a table row titled "COMBITRONIC:" provides the Combitronic
command syntax for addressing a specific SmartMotor in the network. Those commands also
display the Combitronic logo () at the top of their reference pages.
Combitronic Logo Location
COMBITRONIC: Table Row
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 29 of 909
Introduction
Introduction: Communication Lockup Wizard
Communication Lockup Wizard
Improper use of some commands, like Z and OCHN, can lock you out of the motor and
prevent further communication. If you are unable to communicate with the SmartMotor, you
may be able to recover communications using the Communication Lockup Wizard, which is on
the SMI software Communications menu (see the following figure). This tool sends an "E"
character to the motor at startup, which prevents the motor from running its program. For
more details on the Communication Lockup Wizard, see the SMI software online help, which is
accessed by pressing the F1 key or selecting Help from the SMI software main menu.
Communication Menu - Communication Lockup Wizard
Safety Information
This section describes the safety symbols and other safety information.
Safety Symbols
The 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 the
operator or major damage to the equipment.
CAUTION: This symbol indicates a potentially minor hazard, where failure to
follow the instructions could result in slight injury to the operator or minor
damage to the equipment.
NOTE: Notes are used to emphasize non-safety concepts or related information.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 30 of 909
Introduction
Introduction: Other Safety Considerations
Other Safety Considerations
The Moog Animatics SmartMotors are supplied as components that are intended for use in an
automated machine or system. As such, it is beyond the scope of this manual to attempt to
cover all the safety standards and considerations that are part of the overall machine/system
design and manufacturing safety. Therefore, the following information is intended to be used
only as a general guideline for the machine/system designer.
It is the responsibility of the machine/system designer to perform a thorough "Risk
Assessment" and to ensure that the machine/system and its safeguards comply with the
safety standards specified by the governing authority (for example, ISO, OSHA, UL, etc.) for
the locale where the machine is being installed and operated. For more details, see Machine
Safety on page 31.
Motor Sizing
It is the responsibility of the machine/system designer to select SmartMotors that are
properly sized for the specific application. Undersized motors may: perform poorly, cause
excessive downtime or cause unsafe operating conditions by not being able to handle the
loads placed on them. The System Best Practices document, which is available on the Moog
Animatics website, contains information and equations 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
approved and validated system. Specification changes or firmware upgrades require the
approval of the system designer and may require another Risk Assessment.
Environmental Considerations
It is the responsibility of the machine/system designer to evaluate the intended operating
environment for dust, high-humidity or presence of water (for example, a food-processing
environment that requires water or steam wash down of equipment), corrosives or chemicals
that may come in contact with the machine, etc. Moog Animatics manufactures specialized
IP-rated motors for operating in extreme conditions. For details, see the Moog AnimaticsProduct Catalog.
Machine Safety
In order to protect personnel from any safety hazards in the machine or system, the
machine/system builder must perform a "Risk Assessment", which is often based on the ISO
13849 standard. The design/implementation of barriers, emergency stop (E-stop)
mechanisms and other safeguards will be driven by the Risk Assessment and the safety
standards specified by the governing authority (for example, ISO, OSHA, UL, etc.) for the
locale where the machine is being installed and operated. The methodology and details of
such an assessment are beyond the scope of this manual. However, there are 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 Risk Assessment. Additional items may be required. The safeguards
must ensure the safety of all personnel 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
barrier must be designed so that personnel cannot reach into any identified danger
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 31 of 909
Introduction
Introduction: Documentation and Training
zones.
l
Position the control panel so that it is outside the barrier area but located for an
unrestricted view of the moving mechanism. The control panel must include an E-stop
mechanism. Buttons that start the machine must be protected from accidental
activation.
l
Provide E-stop mechanisms located at the control panel and at other points around the
perimeter 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
protected zone that will stop all machine movement when tripped.
l
Ensure that if a portable control/programming device is supplied (for example, a handheld operator/programmer pendant), the device is equipped with an E-stop mechanism.
NOTE: A portable operation/programming device requires many additional
system design considerations and safeguards beyond those listed in this
section. For details, see the safety standards specified by the governing
authority (for example, ISO, OSHA, UL, etc.) for the locale where the
machine is being installed and operated.
l
Prevent contact with moving mechanisms (for example, arms, gears, belts, pulleys,
tooling, etc.).
l
Prevent contact with a part that is thrown from the machine tooling or other parthandling equipment.
l
Prevent contact with any electrical, hydraulic, pneumatic, thermal, chemical or other
hazards that 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 all personnel and equipment (for example, to prevent a run-away condition). The
control system must be designed so that it does not automatically restart the
machine/system after a power failure.
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 must include 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
and qualified before acquiring access to the machine or system.
l
The above personnel perform their assigned functions in a responsible and safe manner
to comply 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
the machine/system designer.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 32 of 909
Introduction
Introduction: Additional Equipment and Considerations
Additional Equipment and Considerations
The Risk Assessment and the operating company's standard safety policies will dictate the
need for additional 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 job
functions, which may include: safety glasses, hearing protection, safety footwear,
smocks or aprons, gloves, hard hats and other protective gear.
l
The work area is equipped with proper safety equipment such as first aid equipment,
fire suppression equipment, emergency eye wash and full-body wash stations, etc.
l
There are no modifications made to the machine or system without proper engineering
evaluation for design, safety, reliability, etc., and a Risk Assessment.
Safety Information Resources
Additional SmartMotor safety information can be found on the Moog Animatics website; open
the file "109_Controls, Warnings and Cautions.pdf" located at:
(interactive tools to assist developer: Scale Factor Calculator, Status Words, CAN Port
Status, Serial Port Status, RMODE Decoder and Syntax Error Codes)
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 34 of 909
Additional Resources
Additional Resources
The 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
Sales and distributor information:
http://www.animatics.com/sales-offices.html
l
Application ideas (including videos and sample programs):
http://www.animatics.com/applications.html
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 35 of 909
Part 1: Programming the SmartMotor
Part 1: Programming the SmartMotor
Part 1 of this guide provides information on programming, SMIsoftware features,
communications, variables, error and fault handling, I/Ocontrol, and other details required
for system and application development.
Beginning Programming47
Setting the Motor Firmware Version48
Setting the Default Firmware Version48
Checking the Default Firmware Version49
Opening the SMIWindow (Program Editor)49
Understanding the Program Requirements50
Creating a "Hello World" Program51
Entering the Program in the SMI Editor51
Adding Comments to the Code52
Checking the Program Syntax52
Saving the Program52
Downloading a Program to the SmartMotor52
Syntax Checking, Compiling and Downloading the Program53
Additional Notes on Downloaded Programs53
Running a Downloaded Program54
Using the Program Download Window55
Using the Terminal Window and Run Program Button55
Using the RUN Command in the Terminal Window55
Creating a Simple Motion Program56
SMISoftware Features57
Introduction58
Menu Bar58
Toolbar59
Configuration Window61
Terminal Window63
Initiating Motion from the Terminal Window65
Information Window65
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 36 of 909
Part 1: Programming the SmartMotor
Program Editor66
Motor View68
SMI Trace Functions70
Monitor Window73
Serial Data Analyzer75
Chart View76
Chart View Example77
Macros80
Tuner82
SMIOptions86
SMIHelp87
Context-Sensitive Help Using F187
Context-Sensitive Help Using the Mouse87
Help Buttons87
Hover Help87
Table of Contents87
Projects88
SmartMotor Playground89
Opening the SmartMotor Playground90
Moving the Motor91
Communication Details93
Introduction95
Connecting to a Host96
Daisy Chaining Multiple D-Style SmartMotors over RS-23297
Should I choose Source Counts or Intermediate Counts?157
Should I choose Variable or Fixed cam?157
Electronic Camming Notes and Best Practices159
Examples161
Electronic Gearing and Camming over CANopen161
Electronic Camming Commands162
CTE(table)162
CTA(points,seglen[,location])162
CTW(pos[,seglen][,user])162
MCE(arg)163
MCW(table,point)163
RCP164
RCTT164
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 41 of 909
Part 1: Programming the SmartMotor
MC164
MCMUL=formula164
MCDIV=formula164
O(arg)=formula164
OSH(arg)=formula164
Cam Example Program165
Mode Switch Example168
Position Counters170
Modulo Position171
Modulo Position Commands171
Dual Trajectories172
Commands That Read Trajectory Information174
Dual Trajectory Example Program175
Synchronized Motion175
Synchronized-Target Commands175
PTS(), PRTS()175
VTS=formula176
ADTS=formula, ATS=formula, DTS=formula177
PTSS(), PRTSS()177
A Note About PTS and PTSS177
Other Synchronized-Motion Commands178
GS178
TSWAIT179
Program Flow Details181
Introduction182
Flow Commands182
RUN183
RUN?183
GOTO#, GOTO(label), C#183
GOSUB#, GOSUB(label), RETURN184
IF, ENDIF184
ELSE, ELSEIF185
WHILE, LOOP186
SWITCH, CASE, DEFAULT, BREAK, ENDS186
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 42 of 909
Part 1: Programming the SmartMotor
TWAIT187
WAIT=formula187
STACK187
END188
Program Flow Examples189
IF, ELSEIF, ELSE, ENDIF Examples189
WHILE, LOOPExamples189
GOTO(), GOSUB() Examples190
SWITCH, CASE, BREAK, ENDS Examples191
Interrupt Programming192
ITR(), ITRE, ITRD, EITR(), DITR(), RETURNI192
TMR(timer,time)194
Variables and Math195
Introduction196
Variable Commands196
EPTR=formula196
VST(variable,number)196
VLD(variable,number)197
Math Expressions197
Math Operations197
Logical Operations197
Integer Operations197
Floating Point Functions197
Math OperationDetails and Examples198
Array Variables198
Array Variable Examples199
Error and Fault Handling Details200
Motion and Motor Faults201
Overview201
Drive Stage Indications and Faults201
Fault Bits201
Error Handling202
Example Fault-Handler Code202
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 43 of 909
Part 1: Programming the SmartMotor
PAUSE203
RESUME203
Limits and Fault Handling204
Position Error Limits204
dE/dt Limits204
Velocity Limits204
Hardware Limits204
Software Limits205
Fault Handling205
Monitoring the SmartMotor Status206
System Status208
Introduction209
Retrieving and Manipulating Status Words/Bits209
System and Motor Status Bits209
Reset Error Flags211
System Status Examples211
Timer Status Bits212
Interrupt Status Bits212
I/O Status213
User Status Bits213
Multiple Trajectory Support Status Bits214
Cam Status Bits215
Interpolation Status Bits216
Motion Mode Status216
RMODE, RMODE(arg)216
I/OControl Details217
I/O Port Hardware218
I/O Connections Example (D-Style Motors)219
I/O Voltage Spikes219
Discrete Input and Output Commands220
Discrete Input Commands220
Discrete Output Commands220
Output Condition and Fault Status Commands221
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 44 of 909
Part 1: Programming the SmartMotor
Output Condition Commands221
Output Fault Status Reports221
General-Use Input Configuration221
Multiple I/OFunctions Example222
Analog Functions of I/O Ports223
5 Volt Push-Pull I/O Analog Functions (D-Style Motors)223
24 Volt I/O Analog Functions (D-Style AD1 Option Motors, M-Style Motors)223
Special Functions of I/OPorts224
Class 5 D-Style Motors: Special Functions of I/O Ports225
I/O Ports 0 and 1 – External Encoder Function Commands225
I/O Ports 2 and 3 – Travel Limit Inputs225
I/O Ports 4 and 5 – Communications225
I/O Port 6 – Go Command, Encoder Index Capture Input226
Class 5 M-Style Motors: Special Functions of I/O Ports227
COM Port Pins 4, 5, 6, and 8 – A-quad-B or Step-and-Direction Modes227
I/O Ports 2 and 3 – Travel Limit Inputs227
I/O Port 5 – Encoder Index Capture Input227
I/O Port 6 – Go Command228
Class 6 M-Style Motors: Special Functions of I/O Ports229
COM Port Pins 4, 5, 6, and 8 – A-quad-B or Step-and-Direction Modes229
I/O Ports 2 and 3 – Travel Limit Inputs229
I/O Port 4 and 5 – Encoder Index Capture Input229
I/O Port 6 – Go Command230
I/O Brake Output Commands230
I²C Expansion (D-Style Motors)230
Tuning and PIDControl231
Introduction232
Understanding the PID Control232
Tuning the PID Control233
Using F233
Setting KP234
Setting KD234
Setting KI and KL234
Setting EL=formula235
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 45 of 909
Part 1: Programming the SmartMotor
Other PID Tuning Parameters235
KG=formula235
KV=formula235
KA=formula236
Current Limit Control237
AMPS=formula237
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 46 of 909
Part 1: Programming: Beginning Programming
Beginning Programming
This chapter provides information on beginning programming with the SmartMotor. It
introduces you to using the SMI™ Program Editor, understanding program requirements,
creating a program, downloading the program and then running it in the SmartMotor. It
concludes with a sample for creating your first motion program.
Setting the Motor Firmware Version48
Setting the Default Firmware Version48
Checking the Default Firmware Version49
Opening the SMIWindow (Program Editor)49
Understanding the Program Requirements50
Creating a "Hello World" Program51
Entering the Program in the SMI Editor51
Adding Comments to the Code52
Checking the Program Syntax52
Saving the Program52
Downloading a Program to the SmartMotor52
Syntax Checking, Compiling and Downloading the Program53
Additional Notes on Downloaded Programs53
Running a Downloaded Program54
Using the Program Download Window55
Using the Terminal Window and Run Program Button55
Using the RUN Command in the Terminal Window55
Creating a Simple Motion Program56
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 47 of 909
Part 1: Programming: Setting the Motor Firmware Version
Setting the Motor Firmware Version
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
When programming the SmartMotor, it is important that the SMI software compiler's
firmware version setting matches the firmware version of the connected SmartMotor.
CAUTION: The compiler's firmware version must match the firmware version
of the connected motor. If it does not match, the SMI software may not catch
syntax errors 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 the SmartMotor Installation & Startup Guide for your motor.
l
The SmartMotor is connected to a power source. (Certain models of SmartMotors
require separate control and drive power.) For details, see Understanding the Power
Requirements in the SmartMotor Installation & Startup Guide for your motor.
l
The SMI software has been installed and is running on the computer. For details, see
Installing the SMISoftware 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
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 48 of 909
Part 1: Programming: Checking the Default Firmware Version
From the list, select the firmware version that most closely matches the firmware version of
the connected SmartMotor, as shown in the previous figure. After the default firmware
version has been selected, 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
the currently-selected default firmware version.
Opening the SMIWindow (Program Editor)
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
In addition to taking commands over the serial interface, the SmartMotor can run programs.
The SMI window is used to write and edit user programs for the SmartMotor(s). After the
program has been written, 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
the window, click the New button () on the toolbar, or select:
File > New
SMIWindow
After the SMI window opens, you can type your program directly into the editor, or you can
copy and paste existing code from any text-based software such as Windows Notepad.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 49 of 909
Part 1: Programming: Understanding the Program Requirements
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 recognized by the SMI editor. Therefore, any
"smart quotes" option must be disabled before copying and pasting the program
code.
Understanding the Program Requirements
SmartMotors use a simple form of code called "AniBasic", which is similar to the BASIC
programming language. Various commands include means to create continuous loops, jump
to different locations on given 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 UPPERCASE 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
the comment text.
NOTE: When copying and pasting code from another text editor, make sure
that your text editor is not inserting "smart quotes" (angled single or double
quotation marks). These are not the same as ASCIIcharacters 39 (') and 34
("), and the SMI program editor doesn't recognize 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 SMIeditor are: commands (blue), program flow
controls (pink), and comments(green). All other program text is shown in black. You
can change the syntax colors through the Editor tab in the Options window. For details
on the Options window, see SMIOptions on page 86.
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
"Hello World" example. For details, see Creating a "Hello World" Program on page 51.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 50 of 909
Part 1: Programming: Creating a "Hello World" Program
l
When the SmartMotor power is turned on, there is a 500 ms "pause" before any
program or command is processed:
l
For all industrial networks, every node (or motor) must immediately send out a
"Who am I?"info data packet when power is turned on, which tells the network
host who it's talking to. This is a requirement for all industrial communications
protocols (like CANopen, DeviceNet and PROFIBUS).
l
The stored program does not execute until the 500 ms pause expires. Any serial
commands sent during that time are buffered and then accepted after that pause
expires. Because incoming commands take priority over the internal program,
any buffered commands are executed before the internal program begins.
l
Commands coming in over the network have priority over the program running within
the SmartMotor. For example, while a program is running, you could issue a GOSUB
command from the terminal and send the program off to run the specified subroutine.
When the subroutine is done, 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
automatically running when the SmartMotor power is turned on, as shown in the "Hello
World" example. For details, see Creating a "Hello World" Program on page 51.
l
The SmartMotor will not execute any code past the RUN? line until it receives a
RUN command through the serial port.
l
Using the serial port, the motor can be commanded to run subroutines even if the
stored program is not running.
Creating a "Hello World" Program
This 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 is not inserting "smart quotes" (angled single or double quotation
marks). These are not the same as ASCIIcharacters 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
RUNcommand in the Terminal window. For more details on downloading the program, see
Downloading a Program to the SmartMotor on page 52. For more details on running the
downloaded program, see Running a Downloaded Program on page 54.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 51 of 909
Part 1: Programming: Adding Comments to the Code
Adding Comments to the Code
You can add comments to the code by inserting a single quotation mark (') between the
commands and your comment text.
NOTE: Comments do not get sent to the SmartMotor.
RUN?'The program stops here until it receives a RUNcommand
PRINT("Hello World",#13)'#13 is a carriage return
END'The required ENDcommand
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, see
Downloading a Program to the SmartMotor on page 52.
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. The Save 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
software automatically opens the Save As window, which requires you to save the program
before continuing.
Downloading a Program to the SmartMotor
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
After you've created a program, it must be downloaded to the SmartMotor. This section
explains how to syntax check and download the program.
NOTE: Comments do not get sent to the SmartMotor.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 52 of 909
Part 1: Programming: Syntax Checking, Compiling and Downloading the Program
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.
The Select 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 this step and also checks for errors. If errors are found, make the necessary
corrections and try again.
3.
Click OK to close the window and transmit the program. A progress bar shows the status
of the transmission.
Because the SmartMotor's EEPROM (long-term memory) is slow to write, the terminal
software uses two-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. Any commands sent during that time are buffered and then accepted once
the 500 ms timeout 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 a RUN? command as the first line/command of the program. For an example,
see Creating a "Hello World" Program on page 51.
l
To get a program to operate continuously, write a loop. For details, see Program
Flow Details on page 181.
l
A program cannot be erased; it can only be replaced. To effectively replace a program
with nothing, download a program with only one command: END.
Remember that all programs, even "empty" ones, must contain at least one
ENDcommand. For more details on program requirements, see Understanding the
Program Requirements on page 50.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 53 of 909
Part 1: Programming: Running a Downloaded Program
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 be considered in the workcell design (see Other Safety
Considerations on page 31).
NOTE: In addition to the software information in this section, there is contextsensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
After the program has downloaded to the SmartMotor, the Program Download window opens,
which contains options relating to running the program.
Program Download Window
Runwill run the program immediately. Reset will clear all user variables and run the program
as if it were 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 is
downloaded to the SmartMotor. Select that option if you always want to run the program using
the Terminal window and the Run Program in Selected Motor button ( ), which is on the SMI
software toolbar.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 54 of 909
Part 1: Programming: Using the Program Download Window
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—it must 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 RUNdirectly on the terminal screen (blue) area and click Send or press Enter.
RUNCommand in the Terminal Window
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 55 of 909
Part 1: Programming: Creating a Simple Motion Program
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 be considered in the workcell design (see Other Safety
Considerations on page 31).
Enter the following motion program in the SMIediting window. Pay close attention to spaces
and capitalization.
As described previously, it’s only necessary to enter text on the left side of the single quote,
as the text 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 wellcommented code. Nothing is more frustrating than trying to debug or decipher code that is
sparsely commented.
NOTE: Comments do not get sent to the SmartMotor.
EIGN(2)'Disable left limit
EIGN(3)'Disable right limit
ZS'Reset errors
ADT=100'Set target accel/decel
VT=1000000'Set target velocity
PT=100000'Set target position
G'Go, starts the move
TWAIT'Wait for move to complete
PT=0'Set buffered move back to home
G'Start motion
END'End program
After entering the program code, you can download it to the motor and then run it. For details
on downloading the program, see Downloading a Program to the SmartMotor on page 52. For
details on running the downloaded program, see Running a Downloaded Program on page 54.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 56 of 909
Part 1: Programming: SMISoftware Features
SMISoftware Features
This chapter provides information on SMI software features.
Introduction58
Menu Bar58
Toolbar59
Configuration Window61
Terminal Window63
Initiating Motion from the Terminal Window65
Information Window65
Program Editor66
Motor View68
SMI Trace Functions70
Monitor Window73
Serial Data Analyzer75
Chart View76
Chart View Example77
Macros80
Tuner82
SMIOptions86
SMIHelp87
Context-Sensitive Help Using F187
Context-Sensitive Help Using the Mouse87
Help Buttons87
Hover Help87
Table of Contents87
Projects88
SmartMotor Playground89
Opening the SmartMotor Playground90
Moving the Motor91
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 57 of 909
Menu bar
Toolbar
Conguration
window
Terminal
window
Information
window
Program
editor
Part 1: Programming: Introduction
Introduction
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help 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 interface can be accessed from the Windows Desktop icon or from the Windows Start
menu. For details, see Accessing the SMI Software Interface in the SmartMotor Installation &
Startup Guide for your motor.
Main Features of the SMISoftware
NOTE: Depending on your version of SMI software, your screens may look slightly
different than those shown.
The primary software features are briefly described in the following sections. In addition to
this information, 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 Bar
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 58 of 909
Part 1: Programming: Toolbar
The SMI software menu bar provides access to all SMI software features, which are grouped
by functional area.
The Menu Bar
NOTE: Frequently-used features are also available from the SMI software's
Toolbar. For details, see Toolbar on page 59.
Each functional area is described in the following table.
MenuDescription
FileAccess standard file commands (New, Open, Close, etc.).
Edit
View
Communication
Compile
Tools
Window
Help
Edit an SMI program (Cut, Copy, Paste, etc.). Note that an SMI Program
Editor window must be open to use these features.
Show or hide windows or items in the SMI software interface (Toolbar,
Status bar, Terminal window, etc.).
Control communications with motors (Settings, Detect Motors, Upload
Program, Communication Setup Wizard, etc.).
Scan a program for errors and compile SMX or project files (Scan for
errors, Compile Downloadable SMX file, Compile and Transmit SMXfile,
Compile Project, etc.).
Access SmartMotor tools, monitoring features and options (Macro,
Tuner, Motor View, Monitor View, Options, etc.)
Control the appearance of the SMI software windows (Cascade, Tile Horizontally/Vertically, Arrange Icons, etc.).
Access online help features of the SMI software (Contents, Index,
SmartMotor Programmer's Guide, etc.).
Each menu item is described in detail in the SMI software's online help file, which can be
accessed from the Help menu or by pressing the F1 key.
Toolbar
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
The SMI software toolbar provides quick access to the SMI software's frequently-used
features. Each item 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, see Menu Bar on page 58.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 59 of 909
Part 1: Programming: Toolbar
Each icon is described in the following table.
Icon
Menu
Command
NewCreate a new document.
OpenOpen an existing document.
SaveSave the active document.
Save AllSave the Project and all open documents.
CutCut the selection and put it on the Clipboard.
CopyCopy the selection and put it on the Clipboard.
PasteInsert Clipboard contents.
ConfigurationShow or hide the Configuration window.
TerminalShow or hide the Terminal window.
InformationShow or hide the Information window.
Serial Data
Analyzer
Find Motors
Detect Motors
Compile and
Download Project
Compile and
Transmit SMX
File
Description
Show or hide the Serial Data Analyzer ("sniffer").
Detect all available motors connected to the defined serial ports
of the computer.
Detect motors connected to the currently-selected port in the Terminal window.
Compile and download all user programs defined in the project to
their associated motors.
Compile and download the program in the active view to its associated motor.
Scan for errorsScan the program in the active view.
Upload Program
Run Program
Stop Running
Program
Stop MotorsSend an END and then an S command to all motors.
Decelerate
Motors to Stop
SmartMotor
Playground
Context HelpOpens the context help for the selected item.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Upload the program in a motor to an SMI file.
Send a RUN command to the selected motor in the Terminal window.
Send an END command to the selected motor in the Terminal window.
Send an END and then an X command to all motors.
Opens the SmartMotor Playground, where you can monitor and
jog a single motor in Position, Velocity and Torque modes.
Page 60 of 909
Part 1: Programming: Configuration Window
Each item is described in detail in the SMI software's online help file, which can be accessed
from the Help menu or by pressing the F1 key.
Configuration Window
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
The Configuration window shows the current configuration and allows access to specific ports
and motors. 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
been closed, 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.
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
"address motors" to find motors attached to that port.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 61 of 909
Part 1: Programming: Configuration Window
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 in the following figure.
Motor View Window
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 62 of 909
Part 1: Programming: Terminal Window
l
By right-clicking the motor, you can access its properties along with other tools, as
shown in the following figure.
Motor Tools Menu
Terminal Window
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
The Terminal window acts as a real-time portal between you and the SmartMotor. By typing
commands in the Terminal window, you can set up and execute trajectories, execute
subroutines of downloaded programs and report data and status information to the window.
The Terminal window is typically shown (default setting) when the SMI software is opened.
However, if the Terminal window is closed, select:
View > Terminal
NOTE: When the window is visible, the menu item will have a check mark next to
it.
To use the Terminal window:
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Terminal Window
Page 63 of 909
Part 1: Programming: Terminal Window
l
Specific communication ports can be selected using the tabs.
l
Commands can be entered in the white text box or directly on the blue screen. If data is
flooding back from the motor, then the white text box will be more convenient, as the
incoming data may cause the text to scroll out of view.
l
When motor power is activated, there is a 500 ms timeout before the motor will accept
commands on the serial port. Any commands sent during that time are buffered and
then accepted once the 500 ms timeout expires. Because incoming commands take
priority over the internal program, buffered commands run before the internal program
begins.
l
Because multiple SmartMotors are on a single communication port are individually
addressed, commands can be routed to any or all of them by making the appropriate
selection from the drop-down list, which is located just below the tabs. The SMI
program automatically sends the appropriate codes to the network to route the data to
the specified motor(s).
l
You can double-click a previous command to resend the command (see the following
figure). However,
l
If that command has a motor address in it (for example, 1RPA, where "1" = serial
bus Motor 1), the command will resend to that motor.
l
If that command does not have an address, the command will be sent to the lastaddressed motor. For example, if you previously sent the command 2RPA, which
addresses serial bus Motor 2, an un-addressed command that you double-click (or
issue) will go to serial bus Motor 2, even if it's on the list before the point where
you started addressing Motor 2.
An example of commands sent to
the last-addressed motor. Notice
that double-clicking the first RPA
command reports the position of
motor 3 because it was the lastaddressed motor.
l
PRINT commands containing data can be sprinkled in programs to send data to the
Terminal window as an aid in debugging.
l
What is typed on the screen is not what goes to the motor. For example, 1RPAdoes not
send a "1" to the motor — it is sending an Extended ASCII code for "1"(Hex 0x81). Then
it sends ASCII "R", 'P" and "A", and a SPACE (Hex 20) as the delimiter (not a carriage
return). Note that the terminal window uses a space as the delimiter; the motor uses a
carriage return (Hex 0x0D) as the delimiter.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 64 of 909
Part 1: Programming: Initiating Motion from the Terminal Window
l
Data that has associated report commands, such as Position, which is retrieved using
the RPA command, can be easily reported by simply including the report command
directly in the program code.
NOTE: Be careful when using report commands within tight loops because they can
bombard the Terminal window with too much data.
l
If a program is sending too much data to the Terminal window, try adding a WAIT=50
command to the program, which will slow down the flow.
l
Use the right-hand scroll bar to review the Terminal window history.
Initiating Motion from the Terminal Window
WARNING: The larger SmartMotors can shake, move quickly and exert great
force. Therefore, proper motor restraints must be used, and safety
precautions must be considered in the workcell design (see Other Safety
Considerations on page 31).
To initiate motion from the terminal window, enter the following commands (do not enter the
comments, which are the right-hand portion of each line).
MP'Initialize Position mode
ADT=100'Set target accel/decel
VT=1000000'Set target velocity
PT=300000'Set target position
G'Go, starts the move
NOTE: Acceleration, velocity and position fully describe a trapezoidal-motion
profile.
After the final G command has been entered, the SmartMotor accelerates to speed, slows and
then decelerates to a stop at the absolute target position. The progress can be seen in the
Motor View window. For details on the Motor View window, see Monitoring the SmartMotor
Status on page 206.
Information Window
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
The Information window shows the program status. When a program is scanned and errors
are found, they are listed in the Information window preceded by a red "E" along with the
program path and line number where the error was found, as shown in the following figure.
Example Error Message
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 65 of 909
Part 1: Programming: Program Editor
The Information window is typically visible when the SMI software opens. If the window has
been closed, you can open it from the SMI software main menu by selecting:
View > Information
NOTE: When the window is visible, the menu item will have a check mark next to
it.
To use the Information window:
l
Double-click on the error in the Information window—the specific error will be located in
the Program Editor.
In the following example, the scanner does not recognize the command TWAITS. The
correct command is TWAIT.
TWAITS Error
Correct the error and scan the program again. After all errors are corrected, the
program can be downloaded to the SmartMotor.
l
Warnings may appear in the Information window to alert you to potential problems.
However, warnings will not prevent the program from being downloaded to the
SmartMotor. It is the programmer’s responsibility to determine the importance of
addressing the warnings.
Program Editor
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
SmartMotor programs are written in the SMI software Program Editor before being scanned
for errors and downloaded to the motor.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 66 of 909
Part 1: Programming: Program Editor
To open the Program Editor, from the SMI software main menu, select:
File > New
Or click the New button ( ) on the toolbar. The Program Editor opens, as shown in the
following figure.
To use the Program Editor:
l
Type the program code directly into the Program Editor. As you write the program, the
editor applies syntax highlighting to the code, which makes it easier to read and debug.
l
Every program requires an END command, even if the program is designed to run
indefinitely and the END is never reached. For more details on program requirements,
see Understanding the Program Requirements on page 50.
l
The first time you write a program, you must save it before you can download it to the
motor.
l
Every time a program is downloaded, it is automatically saved to that file name. This
point is important to note, as most Windows applications require a "save" action. If you
want to set aside a certain revision of the program, it should be copied and renamed, or
you should simply save the continued work under a new name.
l
Once a program is complete, you can scan it for errors by pressing the Scan File button
() on the toolbar, or scan and download it in one operation by pressing the Compile
and Download Program button (), which is also located on the toolbar.
If errors are found, the download will be aborted and the problems will be identified in
the Information window located at the bottom of the screen.
Program Editor
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 67 of 909
Part 1: Programming: Motor View
l
Programs are scanned using a language file that is related to different motor firmware
versions. If Compile and Download Program is selected, the language file will be chosen
based on the version read from the motor. If Scan File is selected, the default language
file will be used. To change the default language file, from the SMI software main menu,
select
Compile > Compiler default firmware version > [select the desired version]
For more details, see Setting the Motor Firmware Version on page 48.
Motor View
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
The SMI Motor View window allows you to view multiple parameters related to the motor.
To open the Motor View window, from the SMI software main menu, select:
Tools > Motor View
and select the motor you want to view. Or, in the Configuration window, double-click the
motor you want to view.
Motor View Window
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 68 of 909
NOTE: The Motor View window provides a real-time view into the inner workings of
a SmartMotor.
To use the Motor View window:
l
Click Poll to initiate real-time scanning of motor parameters.
l
A program can be running in the motor while the Motor View window is polling. The
program must not print text to the serial channel being used for polling.
l
In addition to the standard items displayed, two fields allow you to select from a list of
additional parameters to display.
For example, in the previous figure, Voltage and Current are being polled. This
information can be useful when setting up a system for the first time, or debugging a
system in the field. Temperature is also useful to monitor in applications with
demanding loads.
l
All seven of the user-configurable onboard I/O points are shown. Any onboard I/O that
is configured as an output can be toggled by clicking on the dot below the designating
number.
l
The SmartMotor has built-in provisions allowing it to be identified by the SMI software.
When a motor is identified, a picture of it appears in the lower left corner of the Motor
View window.
Part 1: Programming: Motor View
l
Tabs across the top of the window provide access to additional information.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 69 of 909
Part 1: Programming: SMI Trace Functions
SMI Trace Functions
The Trace tab provides a set of functions that are useful for debugging a SmartMotor program.
To access Trace functions, open the Motor View window and click the Trace tab.
Motor View Trace Functions
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 70 of 909
To use Trace functions:
1.
Open the Trace window. When first opened with no program loaded, the following
message appears:
2.
Right-click the SmartMotor in the Configuration window and select Upload Program. The
program is uploaded to the SMIEditor.
3.
Double-click anywhere in the program to load it into the Trace window.
4.
Select the desired Mode.
5.
Double-click on desired line in the Editor window, if needed.
6.
Press the desired button in the Trace/Step box. The program must run before anything
will happen.
Part 1: Programming: SMI Trace Functions
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 71 of 909
Part 1: Programming: SMI Trace Functions
The following table describes the items in the Trace window:
ItemDescription
Status boxShows the current state of the Trace program and Motor Program.
This becomes active after a command is executed on the Trace
tab and remains active until the Motor View is closed. Possible
Status messages are:
Not Connected – Not connected to motor
Program Running or Program Stopped – If at a breakpoint or the
program is stopped.
Trace Active or Trace Inactive – If a trace is currently in progress
or waiting to hit a breakpoint in progress. If a trace is active it
must be canceled before selecting a new Mode.
At Break Point – Program execution halted because a breakpoint
was reached or a step was completed.
Motor Program boxShows the name of the program contained in the motor.
Trace Program boxShows the name of the program that was doubled-clicked.
Clear Display buttonClears the highlighted text in the editor window and removes any
information in the Trace List window.
Program groupEnd Program – Stops program execution by writing the END
command
Run from Beginning – Issues a RUN command.
Run Continue – Release firmware from the current breakpoint.
(Only available when at a breakpoint.)
Mode group: For any trace information to be retrieved from the motor, a mode must be
selected and the program must run.
CurrentCaptures the first 20 points encountered.
About, Before, AfterRequires the user to select a line from the program in the Editor
window by double-clicking on it. The program trace responds
based on the option selected in the Trace/Step group (see below).
About – Captures 9 points before and 10 points after desired line.
Before – captures 20 points before the desired line.
After – Captures 20 points following the desired line.
ContinuousPolls the motor for commands that are executing. Because of
bandwidth, not all executed lines are shown in the Trace view or
highlighted in the program.
StepEnables step mode. The program trace responds based on the
option selected in the Trace/Step group (see below).
Break at CommandRequires the user to select a line in the program by double-
clicking on it in the Editor window. The program trace responds
based on the option selected in the Trace/Step group (see
descriptions following this table).
Trace/Step groupVarious options are available based on other selections (see
descriptions following this table).
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 72 of 909
Part 1: Programming: Monitor Window
Trace/Step group – Options for trace selections (when Step mode is not selected):
l
Start Trace and Run from Beginning button – Sets trace information in the motor and
issues a RUN command.
l
Start Trace button – Sets trace information in the motor.
l
Start Trace and Run from Current button – Available when at a break point. The trace
information is set in the motor and the program continues from the current break point.
l
Cancel Trace button – Available when a trace is active to cancel the current trace.
Trace/Step group – Options for Step (when Step mode is selected):
l
Step from Beginning button – Sets a breakpoint in the motor and issues a RUN
command. The program executes the first line of code and then stops.
l
Step from Current button – Sets a breakpoint in the motor. If the program is running,
the motor stops at the next command. If the program is at a breakpoint, the motor
executes the next command and then stops.
Trace/Step group – Options for Break (when Break at command mode is selected):
l
Set Breakpoint and Run from Beginning button – Sets the breakpoint and runs the
program from the beginning.
l
Set Breakpoint button – Sets a breakpoint in the motor.
l
Set Breakpoint and Run from Current button – If at a breakpoint, this sets the new
breakpoint and runs the program from the current location.
l
Remove Breakpoint button – Removes a breakpoint that was set and not reached.
Monitor Window
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
The Monitor window allows you to create your own fully-customized monitor. Because it is
polling a limited set of items, it provides a more efficient monitoring method. To open the
Monitor window, from the SMI software main menu, select:
Tools > Monitor View
Monitor Window
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 73 of 909
To use the Monitor window:
l
Polling items can be added or removed by pressing the + and – buttons. When adding a
new item, the Add New Monitor Item window opens and provides tools for setting up the
monitoring function, as shown in the following figure.
Part 1: Programming: Monitor Window
Add New Monitor Item Window
l
Custom items, which do not have explicit report commands, can be added by entering
the specific commands appropriate to getting the data reported (for example, make a
variable equal to the desired parameter and then report that variable).
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 74 of 909
Part 1: Programming: Serial Data Analyzer
Serial Data Analyzer
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
The SMI Terminal window formats text and performs other housekeeping functions that are
invisible to the user. For an exact picture of the data being traded between the PC and the
SmartMotor™, use the Serial Data Analyzer (also known as the "sniffer"). To open the Serial
Data Analyzer, from the SMI software main menu, select:
View > Serial Data Analyzer
Or press the Serial Data Analyzer button () on the toolbar. The Serial Data Analyzer window
opens, as shown in the following figure.
Serial Data Analyzer
The Serial Data Analyzer window can display serial data in a variety of formats, and it can be
a useful tool for debugging communications. For example, you can:
l
View data transfer between computer and SmartMotor(s).
l
View data in hexadecimal, decimal, or ASCII format in up to three columns.
l
Send commands and binary data to SmartMotor(s).
l
View sent and received data in different definable colors.
l
Capture data transfer in different ports at the same time, and view each port using its
dedicated page.
NOTE: SMI can display the precise data being sent between the host and the
SmartMotor in multiple formats.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 75 of 909
Part 1: Programming: Chart View
Chart View
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
In some cases, the best way to understand a data trend is by seeing it graphically. The SMI
Chart View provides graphical access to any readable SmartMotor parameter.
To open the Chart View window, from the SMI software main menu, select:
Tools > ChartView
The Chart View window opens, as shown in the following figure.
To use the Chart View tool:
l
Polling items are added or removed by pressing the + and – buttons.
l
The fields and options are identical to those in the Monitor tool. For details on the
Monitor tool, see Monitor Window on page 73.
l
Adjustable upper and lower limits for each polled parameter allow them to be scaled to
fit the space.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Chart View Window
Page 76 of 909
Part 1: Programming: Chart View Example
l
The toolbar across the top provides additional functions such as chart editing, start/stop
sampling, manual update and more.
l
The Start Sampling button ( ) starts the charting action.
l
While the Chart View does not include a print function, Window’s standard Print Screen
key can capture the chart to the clipboard, and from there, it can be pasted into other
applications (like Microsoft Excel, Microsoft Word, etc.). This graphical data can be a
useful addition to written system reports.
Additionally, a context menu is available by right-clicking on the Chart View window,
which has selections for:
l Copying the chart data as a tab-delimited table in text format, which can then be
imported into a spreadsheet, such as Microsoft® Excel, or any text editor.
l
Copying the current image of the chart to the clipboard in bitmap format, which
can then be pasted in any graphic application.
Chart View Example
The SMI Chart View provides graphical access to any readable SmartMotor parameter. The
following example shows how to use the Chart View tool to graphically track torque changes
on the SmartMotor.
This procedure assumes that:
l
The SmartMotor is connected to the computer. For details, see Connecting the System
in the SmartMotor Installation & Startup Guide for your motor.
l
The SmartMotor is connected to a power source. (Certain models of SmartMotors
require separate control and drive power.) For details, see Understanding the Power
Requirements in the SmartMotor Installation & Startup Guide for your motor.
l
The SMI software has been installed and is running on the computer. For details, see
Installing the SMISoftware in the SmartMotor Installation & Startup Guide for your
motor.
l
You've completed the first-time motion example. For details, see Moving the
SmartMotor in the SmartMotor Installation & Startup Guide for your motor.
To open the Chart View window, from the SMI software main menu, select:
Tools > ChartView
The Chart View window opens. For details, see Chart View on page 76.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 77 of 909
To create the example:
1.
Click the Add icon (+). The Add New Chart Item window opens.
2.
Click Custom Parameter to enter a nonstandard parameter for charting.
3.
Fill in the text boxes as shown in the following figure.
Part 1: Programming: Chart View Example
Custom Parameter Button and Related Entries
NOTE: Be sure the Maximum and Minimum values are set to 10000 and -10000,
respectively, as shown in the previous figure. They default to ten times more than
those values.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 78 of 909
Part 1: Programming: Chart View Example
4.
After you've completed the entries, click Add and the custom parameter will be added to
the Chart View window.
5.
Click the green Play icon ( ); the chart recorder plots the RTRQ value.
6.
In the SMI software Terminal window, enter the following commands:
MT
T=0
G
T=8000
G
T=0
G
T=-8000
G
T=0
G
The Chart View tool plots a line similar to the one shown in the following figure.
Plotted RTRQ Values
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 79 of 909
Part 1: Programming: Macros
7.
In the SMI software Terminal window, enter TS=65536. This causes a one-second ramp
time when T is commanded from or to zero.
8.
Repeat the previous command sequence. Note the addition of "ramps" to the plot, which
are caused by the TS command.
Plotted RTRQ Values With Ramps
Macros
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
The SMI software contains a macro tool, which is useful for creating keyboard shortcuts for
one command or a series of commands. The Macros window allows you to associate a
command or series of commands with the Ctrl+[number] keys (e.g., Ctrl+1). With this utility,
you can create multiple macros for a more efficient development process. You can create up
to ten macros to aid in quick code execution.
To open the Macros window, from the SMI software main menu, select:
Tools >Macro
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 80 of 909
Part 1: Programming: Macros
The Macros window opens, as shown in the following figure.
Macros Window
To use the Macros window:
l
Add or remove macros with the Add and Delete buttons.
l
Use the Properties button to view and edit the properties of an existing macro.
l
The Run button allows you to test the selected macro.
l
When you have finished, use the Close button to close the Macros window.
To create a macro:
In this example, you will create a macro for clearing the status bits. For details on clearing
the status bits, see Checking and Clearing Status Bits in the SmartMotor Installation & StartupGuide for your motor.
1.
Open the Macros window.
2.
Click Add to open the Add New Macro window (see the next figure).
3.
Fill in the information so it looks like the following figure, and then click OK to save the
new macro.
Add New Macro
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 81 of 909
Part 1: Programming: Tuner
The Ctrl+1 shortcut key combination has now been assigned to the macro Disable Limits.
When you press Ctrl+1, the SMI software issues EIGN(W,0) and ZS to the terminal screen.
Tuner
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
Tuning a SmartMotor is simpler than tuning traditional servos. However, it can be even easier
when using the SMI Tuner tool to see the results of different tuning parameters.
For most applications, the default SmartMotor tuning parameters are sufficient. Viewing the
position error on the Motor View tool and feeling the stiffness of the motor shaft will
determine if the motor requires additional tuning.
Position Error
There is a related section on tuning the PID filter later in this manual. If further tuning is
required, see Tuning the PID Control on page 233.
The Tools menu has a GUI-based Tuner tool that can also be used to adjust the tuning
parameters. To open the Tuner tool, from the SMI software main menu, select:
Tools >Tuner
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 82 of 909
Part 1: Programming: Tuner
The Tuning window opens, as shown in the following figure.
Tuning Window
The Tuner graphically shows the step response of the SmartMotor. The step response is the
SmartMotor’s actual reaction to a request for a small but instantaneous change in position.
(Rotor inertia prevents the SmartMotor from changing its position in zero time.) The
magnitude of the step response shows how well tuned the motor is.
The Tuner downloads a program that uses variables a, b, p, t, w and z. The program that was
in the motor before tuning and the user variables will be restored after tuning.
Before running the Tuner:
l
Be sure the motor and anything it is connected to are free to move about 1000 encoder
counts or more, which is about one-quarter turn of the motor shaft.
l
Be sure the device is able to safely withstand an abrupt jolt.
Click the Run Tuning button at the bottom of the Tuner window (see the previous figure).
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 83 of 909
Part 1: Programming: Tuner
If the SmartMotor is connected, is on and is still, you should see results similar to those in the
following figure.
Sample Step Response
The upper curve with the legend on the left is the SmartMotor’s actual position over time.
Notice that it overshot its target position before settling in. Adjusting the PID Tuning will
stiffen the motor up and create less overshoot. For details, see Tuning and PIDControl on
page 231. In a real-world application, there will be an acceleration profile, not a demand for
instantaneous displacement, so significant overshoot will not exist. Nevertheless, it is useful
to look at the worst-case scenario of a step response.
To try a different set of tuning parameters, select the Tuning Values tab to the left of the
graph area. As shown in the following figure, you will see a list of tuning parameters with two
columns: the left column lists what is currently in the SmartMotor; the right column provides
an area to make changes.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 84 of 909
Part 1: Programming: Tuner
Apply New Values Button
To make adjustments to the tuning:
1.
Change the values to those shown in the New column of the previous figure.
2.
Click the "Apply New Values" button, which stores the new values in the SmartMotor.
3.
Click the Run Tuning button at the bottom of the Tuning window.
The motor will jolt again and the results of the step response will overwrite the previous
graph. Normally, this process involves repeated trials, following the procedure outlined in the
section on the PID Filter. For details, see Tuning the PID Control on page 233.
When you are satisfied with the results, the parameters producing the best results can be
added to the top of your program in the SmartMotor, or in applications where there are no
programs in the motors, sent by a host after each power-up. For example, the previous
example's tuning parameters would be set using the following tuning commands:
KP=3000
KI=30
KD=10000
KL=32767
F
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 85 of 909
Part 1: Programming: SMIOptions
SMIOptions
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
The SMI software has a variety of options that can be customized through the Options window.
It contains tabs and selections for customizing the Scanner, Editor, Terminal and more.
To open the Options window, select:
Tools > Options
The Options window opens, as shown in the following figure.
Options Window
To use the Options window:
l Click a tab to select the options you wish to edit.
l
Consider the default firmware version. Because different SmartMotor firmware versions
have subtle differences, the program scanner needs to know which firmware is being
used to distinguish between supported and unsupported commands.
l
Other options, such as Editor syntax colors, deal with user preferences.
l After you have finished editing options, click OK to close the window and save your
changes.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 86 of 909
Part 1: Programming: SMIHelp
SMIHelp
The most complete and current information available for the SMI software is available within
the program’s extensive Help tool. For details, see the SMI software help.
Context-Sensitive Help Using F1
l
Dialog and Message box: Just press the F1 key while the box is displayed.
l
Information View: Select the line and press the F1 key. The software shows a
description of the selected error. For more details, see Information Window on page 65.
l
Menu command: Select the menu item and press the F1 key.
l
Keyword Information: In the Program Editor, select the keyword and press F1. The
software shows a full description of the selected keyword.
Context-Sensitive Help Using the Mouse
There is a "context help" button on the tool bar. When you click the button (or press Shift+F1
on keyboard) the program enters the Help Mode and the cursor shape changes to context-
sensitive help cursor (). In Help Mode you can use the mouse or keyboard to select a menu
command, a toolbar button, an error message in the Information View, or other items within
SMI, and help on the item is displayed.
Help Buttons
You can click the Help button, available on many dialog boxes, to get help about that dialog
box.
Hover Help
You can place (hover) the mouse pointer over an SMI software button or a Program Editor
keyword to see a short description of that button or keyword.
Table of Contents
To see the list of topics within SMI software Help, use the Contents command in the Help
menu.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 87 of 909
Part 1: Programming: Projects
Sample Help Page
Projects
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
In applications with more than one SmartMotor, and possibly more than one program or
communications port, it is helpful to organize all of the elements as a Project rather than deal
with individual files.
NOTE: When working with multiple motors, programs or ports, a Project provides
a convenient way of organizing and using all of the individual elements.
To create a project, from the SMI software main menu, select:
File > New Project
The New Project window opens.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 88 of 909
Part 1: Programming: SmartMotor Playground
To use the New Project window:
l
Enter a name and location in the Project Name and Location fields to title the project
and specify the location where it will be saved.
l
Click OKto save the information. At this point, you have the option of letting the SMI
software explore the network of motors and set up the project automatically, or of
doing it manually by double-clicking on the specific communication ports or motors
listed in the Information window. Unless you are you are a system expert and know
exactly what the port and motor settings are, you should let the software detect the
motors for you.
l
From here, you can open one or more programs for editing in the SMIEditor.
l
After the project is set up, select File > Save Project to save it. Projects are saved as
.SPJ files.
l
To open a project, select File > Open Project, and then select the desired project
(.SPJ) file. When a project file is opened, all motor communication information,
program editor windows and other elements are restored.
l
Use the File > Recent Projects menu to view and select from the projects you've
most recently edited.
New Project Window
SmartMotor Playground
NOTE: In addition to the software information in this section, there is context-
sensitive help available within the SMI software interface, which is accessed by
pressing the F1 key or selecting Help from the SMI software main menu.
If you are a first-time user, the SmartMotor Playground contains some simple controls to help
you get started with moving the motor. The SmartMotor Playground allows you to
immediately move the motor without any programming.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 89 of 909
Part 1: Programming: Opening the SmartMotor Playground
Opening the SmartMotor Playground
There are two ways to access the SmartMotor Playground:
l
From within the SMI software interface
l
From the Windows Start menu as a stand-alone application.
To access the SmartMotor Playground from the SMI software, in the Configuration window,
right-click the motor you want to move and select SmartMotor Playground from the menu.
SmartMotor Playground (Not Connected)
Click Connect (upper-left area of the window) to connect to the SmartMotor.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 90 of 909
Part 1: Programming: Moving the Motor
SmartMotor Playground (Connected)
Moving the Motor
This procedure assumes that:
l
The SmartMotor is connected to the computer. For details, see Connecting the System
in the SmartMotor Installation & Startup Guide for your motor.
l
The SmartMotor is connected to a power source. (Certain models of SmartMotors
require separate control and drive power.) For details, see Understanding the Power
Requirements in the SmartMotor Installation & Startup Guide for your motor.
l
The SMI software has been installed and is running on the computer. For details, see
Installing the SMISoftware in the SmartMotor Installation & Startup Guide for your
motor.
l
The SmartMotor has been detected and addressed. For details, see Detecting and
Addressing the SmartMotors in the SmartMotor Installation & Startup Guide for your
motor.
In addition to the above items:
l
Verify that all status bits are off, except for the Drive ready bit, as shown in the
previous figure. If needed, use the Clear Flags button to clear any bits that are on.
l The Drive Enable input on the M-series motor must be connected and activated.
l
Verify that Disable Software Limits and Disable Hardware Limits options are set as
shown in the previous figure.
NOTE: The SmartMotor's hardware limits must be grounded or disabled for motion
to occur. Therefore, if your SmartMotor doesn't move when moving the slider or
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 91 of 909
Part 1: Programming: Moving the Motor
issuing a motion command, verify that you've either grounded the limits or
selected both Disable Hardware Limits check boxes (located at the lower-right
corner of the screen), as shown in the previous figure.
Within the SmartMotor Playground, you can experiment with the many different modes of
operation. Try the following (see the previous figure for the locations of these items):
l
Click the left and right Jog controls and watch the motor follow.
l
Move the position bar to the left or right and watch the motor follow.
l
Enter a value (negative = counterclockwise; positive = clockwise) in the Destination
box and click Go. Watch the motor shaft move until the position counter (yellow box)
reaches that destination.
While the SmartMotor Playground is useful for moving the motor and learning about its
capabilities, to develop a useful application, you will need to create a program. To learn about
programming the SmartMotor, see Beginning Programming on page 47.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 92 of 909
Part 1: Programming: Communication Details
Communication Details
This chapter provides information on the communications functionality that has been designed
into the SmartMotor.
Introduction95
Connecting to a Host96
Daisy Chaining Multiple D-Style SmartMotors over RS-23297
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 93 of 909
Part 1: Programming: Communication Details
Combitronic Communications111
Combitronic Features112
Other Combitronic Benefits112
Program Loops with Combitronic112
Global Combitronic Transmissions113
Simplify Machine Support113
Combitronic with RS-232 Interface113
Other CANProtocols115
CANopen - CAN Bus Protocol115
DeviceNet - CAN Bus Protocol115
I²C Communications (D-Style Motors)115
OCHN(IIC,1,N,baud,1,8,D)117
CCHN(IIC,1)117
PRINT1(arg1,arg2, … ,arg_n)117
RGETCHR1, Var=GETCHR1117
RLEN1, Var=LEN1117
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 94 of 909
Part 1: Programming: Introduction
Introduction
There are various ways to communicate with a SmartMotor:
l
Direct-command serial over RS-232 or RS-485 (depending on the motor)
l
Data mode
l
Combitronic, CANopen, DeviceNet, etc.
l
I²C communications
NOTE: When using I²C, the SmartMotor is always the bus master. You cannot
communicate between SmartMotors through I²C.
These communications methods are described in the following sections.
In applications using more than one SmartMotor, the best choice for communications is to link
the SmartMotors together over their optional CAN ports, and then communicate with the
group through any of the RS-232 or RS-485 ports of any of the motors on the chain. The
SmartMotor's CAN-based Combitronic communications unifies all SmartMotor data and
functions in a group, which makes any single motor look like a multi-axis controller from the
perspective of the RS-232 or RS-485 ports. Additionally, this allows all the motors to share
resources as though they were a large multi-axis controller.
Moog Animatics offers adapters for
converting RS-232 to RS-485, and for
converting either to USB.
NOTE: If you are unable to communicate with the SmartMotor, you may be able to
recover communications using the Communication Lockup Wizard, which is on the
SMI software Communications menu. For details, see the SMI software online help,
which is accessed by pressing the F1 key or selecting Help from the SMI software
main menu.
Communication Menu - Communication Lockup Wizard
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 95 of 909
Part 1: Programming: Connecting to a Host
Connecting to a Host
The default mode for communicating with a Class 5 D-style SmartMotor is serial RS-232;
Class 5 M-style SmartMotors use serial RS-485.
NOTE: The Class 5 M-style motors have one RS-485 and one CAN port; they do not
have an RS-232 port.
The most common and cost-effective solution is through RS-232 serial communications.
Under this structure, each motor is placed in an electrical serial connection such that the
transmit line of one motor is connected to the receive line of the next. Each motor is set to
echo incoming data to the next motor down with approximately 1 millisecond propagation
delay. There is no signal integrity loss from one motor to the next, which results in highlyreliable communications.
NOTE: To maximize the flexibility of the SmartMotor, all serial ports are fully
programmable with regard to bit rate and protocol.
There is a 31-byte input buffer for the RS-232 port and another for the RS-485 port. These
buffers ensure that no arriving information is ever lost. However, when either port is in data
mode, it is the responsibility of the user program within the SmartMotor to keep up with the
incoming data.
Connection Between a SmartMotor and Host PC
The CBLSM1-3M cable
makes quick work of connecting to your first
RS-232-based SmartMotor. It combines the connections for
communications and
power into one cable
assembly.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 96 of 909
Part 1: Programming: Daisy Chaining Multiple D-Style SmartMotors over RS-232
By default, the primary channel, which shares a connector with the incoming power in some
versions, is set up as a command port with the following characteristics:
Also, note the following:
l
If the cable used is not provided by Moog Animatics, make sure the SmartMotor's power
and RS-232 connections are correct.
CAUTION: Be sure to use shielded cable to connect RS-232 ports, with the
shield ground connected to pin 5 (ground) of the PC end only.
l
Buffers on both sides mean there is no need for any handshaking protocol when
commanding the SmartMotor.
l
Most commands execute in less time than it takes to receive the next one. Therefore, be
careful to allow processes time to complete, particularly for slower processes like
printing to an LCD display or executing a full subroutine.
Default
Other
Options
Type:RS-232RS-485
Parity:NoneOdd or Even
Bit Rate:96002400 to 115200
Stop Bits:10 or 2
Data Bits:87
Mode: CommandData
Echo:OffOn
Daisy Chaining Multiple D-Style SmartMotors over RS-232
This section describes how to daisy chain multiple D-style SmartMotors to a single RS-232
port as shown in the following figure. Other SmartMotors can be connected together in a
daisy-chain or multi-drop fashion. For details, see Connecting the System in the SmartMotorInstallation & Startup Guide for your motor.
For low-power motors (size SM23165D and smaller), as many as 100 motors could be
cascaded using the daisy-chaining technique for RS-232. To operate independently, each
motor must be programmed with a unique address. In a multiple-motor system, the
programmer has the choice of putting a host computer in control or having the first motor in
the chain be in control of the rest.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 97 of 909
1111
2
3
4
5
A1
A2
2
3
4
5
2
3
4
5
2
3
4
5
A1
A2
I/O-6
+5VDC Out
RS-232 Tx
RS-232 Rx
RS-232 GND
Servo Power (+)
Power GND
I/O-6
+5VDC Out
RS-232 Tx
RS-232 Rx
RS-232 GND
Servo Power (+)
Power GND
DE9 FemalePOWER
Attach shield at PC end
Motor: 1 2 3 4
A1A1
A2A2
51
96
Part 1: Programming: ADDR=formula
The following are related commands. For more details on these commands, see Part 2:
SmartMotor Command Reference on page 238.
ADDR=formula
Set Motor to New Address
The ADDR= command causes a SmartMotor to respond exclusively to serial commands
addressed to it. It is separate and independent of the motor's CAN address. The address
Daisy-Chain Connection between SmartMotor and Host PC
NOTE: You can build your own RS-232 daisy-chain cable or purchase Add-A-Motor
cables from Moog Animatics.
Fully-molded Add-A-Motor
cables make quick work of
daisy-chaining multiple motors
over an RS-232 network.
CAUTION: Large (size 23 or size 34) SmartMotors draw
so much power that reliable communications often
require isolated communications. For such applications,
consider using the Moog Animatics DIN Rail RS-232
fanout.
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 98 of 909
Part 1: Programming: SLEEP, SLEEP1
number range is from 1 to 120.
When each motor in a chain has a unique address, an individual motor communicates
normally after its address is sent over the chain one time. To send an address, add 128 to its
value and output the binary result over the communication link. This puts the value above the
ASCII character set, which differentiates it from all other commands or data. The address
needs to be sent only once until the host computer, or motor, wants to change it to something
else.
Sending out an address zero (128) causes all motors to listen and is an efficient way to send
global data such as a G for starting simultaneous motion in a chain. Once set, the address
features work the same for RS-232 and RS-485 communications.
RS-232 Daisy-Chained SmartMotors
Unlike the RS-485 star topology, the consecutive nature of the RS-232 daisy chain creates the
opportunity for the chain to be independently addressed entirely from the host, rather than by
having a uniquely-addressed program in each motor. Setting up a system this way adds
simplicity because the program in each motor can be exactly the same. If the RUN? command
is the first in each of the motor’s programs, the programs will not start when the SmartMotor
power is turned on. Addressing can then be worked out by the host before the programs are
later initiated through a global RUN command.
SLEEP, SLEEP1
Assert sleep mode
WAKE, WAKE1
De-assert SLEEP
The SLEEPcommand causes the motor to ignore all commands except the WAKE command.
This feature can often be useful, particularly when establishing unique addresses in a chain of
motors. The 1 at the end of commands specifies the AniLink RS-485 port.
NOTE: The SmartMotor can be made to automatically ECHO received characters to
the next SmartMotor in a daisy chain
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 99 of 909
Part 1: Programming: ECHO, ECHO1
ECHO, ECHO1
ECHO input
ECHO_OFF, ECHO_OFF1
De-assert ECHO
The ECHO and ECHO_OFF commands toggle (turn on/off) the echoing of data input. Because
the motors do not echo character input by default, consecutive commands can be presented,
configuring them with unique addresses, one at a time. If the host computer or controller sent
out the following command sequence, each motor would have a unique and consecutive
address.
If a daisy chain of SmartMotors has been powered off and back on, the following commands
can be entered into the SmartMotor Interface to address the motors (0 equals 128, 1 equals
129, etc.). Some delay should be inserted between commands when sending them from a host
computer.
0SADDR1
1ECHO
1SLEEP
0SADDR2
2ECHO
2SLEEP
0SADDR3
3ECHO
0WAKE
Commanded by a user program in the first motor instead of a host, the same daisy chain
could be addressed with the following sequence:
SADDR1'Address the first motor
ECHO'Echo for host data
PRINT(#128,"SADDR2",#13) '0SADDR2
WAIT=10'Allow time
PRINT(#130,"ECHO",#13)'2ECHO
WAIT=10
PRINT(#130,"SLEEP",#13)'2SLEEP
WAIT=10
PRINT(#128,"SADDR3",#13) '0SADDR3
WAIT=10
PRINT(#131,"ECHO",#13)'3ECHO
WAIT=10
PRINT(#128,"WAKE",#13)'0WAKE
WAIT=10
Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 100 of 909
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.