Single-axis system / multi-axis system / compact (58 pages)
Summary of Contents for Moog SmartMotor
Page 1
Developer’s Guide Class 5 & Later SmartMotor Technology with...
Page 2
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.
Entering the Program in the SMI Editor Adding Comments to the Code Checking the Program Syntax Saving the Program Downloading a Program to the SmartMotor Syntax Checking, Compiling and Downloading the Program Additional Notes on Downloaded Programs Running a Downloaded Program Moog Animatics SmartMotor™...
Page 4
Hover Help Table of Contents Projects SmartMotor Playground Opening the SmartMotor Playground Moving the Motor Communication Details Introduction Connecting to a Host Daisy Chaining Multiple D-Style SmartMotors over RS-232 ADDR=formula Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 4 of 909...
Page 5
Program Loops with Combitronic Global Combitronic Transmissions Simplify Machine Support Combitronic with RS-232 Interface Other CAN Protocols CANopen - CAN Bus Protocol DeviceNet - CAN Bus Protocol I²C Communications (D-Style Motors) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 5 of 909...
Page 7
Follow Mode with Ratio (Electronic Gearing) Electronic Gearing and Camming over CANopen Electronic Gearing Commands SRC(enc_src) MFMUL=formula, MFDIV=formula MFA(distance[,m/s]) MFD(distance[,m/s]) MFSLEW(distance[,m/s]) Follow Internal Clock Source Example Follow Incoming Encoder Signal With Ramps Example Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 7 of 909...
Page 8
Should I choose Variable or Fixed cam? Electronic Camming Notes and Best Practices Examples Electronic Gearing and Camming over CANopen Electronic Camming Commands CTE(table) CTA(points,seglen[,location]) CTW(pos[,seglen][,user]) MCE(arg) MCW(table,point) RCTT MCMUL=formula MCDIV=formula O(arg)=formula Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 8 of 909...
Page 10
Error Handling Example Fault-Handler Code PAUSE RESUME Limits and Fault Handling Position Error Limits dE/dt Limits Velocity Limits Hardware Limits Software Limits Fault Handling Monitoring the SmartMotor Status System Status Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 10 of 909...
Page 11
I/O Port 6 – Go Command, Encoder Index Capture Input Class 5 M-Style Motors: Special Functions of I/O Ports COM Port Pins 4, 5, 6, and 8 – A-quad-B or Step-and-Direction Modes Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 11 of 909...
Page 12
Setting EL=formula Other PID Tuning Parameters KG=formula KV=formula KA=formula Current Limit Control AMPS=formula Part 2: SmartMotor Command Reference (Single Space Character) a...z aa...zz aaa...zzz Ra...Rz Raa...Rzz Raaa...Rzzz ab[index]=formula Rab[index] ABS(value) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 12 of 909...
Page 23
USB(arg) RUSB VAC(arg) VL=formula VLD(variable,number) VST(variable,number) VT=formula VTS=formula W(word) RW(word) WAIT=formula WAKE WAKE1 WHILE formula Z(word,bit) Part 3: Example SmartMotor Programs Move Back and Forth Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 23 of 909...
Page 24
Glossary Math Operators Moment of Inertia Matching Motor to Load Improving the Moment of Inertia Ratio RCAN, RCHN and RMODE Status RCAN Status Decoder RCHN Status Decoder Clearing Serial Port Errors Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 24 of 909...
Page 25
Supply Voltage Effects on Torque Curves and Motor Response: Example 1: Rotary Application Example 2: Linear Application Dyno Test Data vs. the Derated Torque Curve Proper Sizing and Loading of the SmartMotor Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 25 of 909...
Page 26
Commands Listed Alphabetically Commands Listed by Function Communications Control Data Conversion EEPROM (Nonvolatile Memory) I/O Control Math Function Motion Control Program Access Program Execution and Flow Control Reset Commands System Variables Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 26 of 909...
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.
Page 29
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.
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).
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.
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...
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: http://www.animatics.com/support/moog-animatics-catalog.html OSHA standards information can be found at: https://www.osha.gov/law-regs.html...
Introduction: Additional Documents Additional Documents The Moog Animatics website contains additional documents that are related to the information in this manual. Please refer to the following list. Related Guides SmartMotor™ Installation & Startup Guide (select the guide for your SmartMotor) http://www.animatics.com/install-guides...
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: General company information: http://www.animatics.com Product information: http://www.animatics.com/products.html Product support (Downloads, How To videos, Forums, Knowledge Base, and FAQs): http://www.animatics.com/support.html...
Entering the Program in the SMI Editor Adding Comments to the Code Checking the Program Syntax Saving the Program Downloading a Program to the SmartMotor Syntax Checking, Compiling and Downloading the Program Additional Notes on Downloaded Programs Running a Downloaded Program...
Page 37
Connecting to a Host Daisy Chaining Multiple D-Style SmartMotors over RS-232 ADDR=formula SLEEP, SLEEP1 WAKE, WAKE1 ECHO, ECHO1 ECHO_OFF, ECHO_OFF1 Serial Commands OCHN(type,channel,parity,bit rate,stop bits,data bits,mode,timeout) CCHN(type,channel) BAUDrate, BAUD(channel)=formula PRINT(), PRINT1() Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 37 of 909...
Page 38
Simplify Machine Support Combitronic with RS-232 Interface Other CAN Protocols CANopen - CAN Bus Protocol DeviceNet - CAN Bus Protocol I²C Communications (D-Style Motors) OCHN(IIC,1,N,baud,1,8,D) CCHN(IIC,1) PRINT1(arg1,arg2, … ,arg_n) RGETCHR1, Var=GETCHR1 RLEN1, Var=LEN1 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 38 of 909...
Page 40
Relative Position Mode Relative Mode Example Follow Mode with Ratio (Electronic Gearing) Electronic Gearing and Camming over CANopen Electronic Gearing Commands SRC(enc_src) MFMUL=formula, MFDIV=formula MFA(distance[,m/s]) MFD(distance[,m/s]) MFSLEW(distance[,m/s]) Follow Internal Clock Source Example Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 40 of 909...
Page 41
Should I choose Source Counts or Intermediate Counts? Should I choose Variable or Fixed cam? Electronic Camming Notes and Best Practices Examples Electronic Gearing and Camming over CANopen Electronic Camming Commands CTE(table) CTA(points,seglen[,location]) CTW(pos[,seglen][,user]) MCE(arg) MCW(table,point) RCTT Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 41 of 909...
Page 42
A Note About PTS and PTSS Other Synchronized-Motion Commands TSWAIT Program Flow Details Introduction Flow Commands RUN? GOTO#, GOTO(label), C# GOSUB#, GOSUB(label), RETURN IF, ENDIF ELSE, ELSEIF WHILE, LOOP SWITCH, CASE, DEFAULT, BREAK, ENDS Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 42 of 909...
Page 43
Math Operation Details and Examples Array Variables Array Variable Examples Error and Fault Handling Details Motion and Motor Faults Overview Drive Stage Indications and Faults Fault Bits Error Handling Example Fault-Handler Code Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 43 of 909...
Page 44
I/O Control Details I/O Port Hardware I/O Connections Example (D-Style Motors) I/O Voltage Spikes Discrete Input and Output Commands Discrete Input Commands Discrete Output Commands Output Condition and Fault Status Commands Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 44 of 909...
Page 45
I/O Brake Output Commands I²C Expansion (D-Style Motors) Tuning and PID Control Introduction Understanding the PID Control Tuning the PID Control Using F Setting KP Setting KD Setting KI and KL Setting EL=formula Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 45 of 909...
Page 46
Part 1: Programming the SmartMotor Other PID Tuning Parameters KG=formula KV=formula KA=formula Current Limit Control AMPS=formula Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 46 of 909...
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.
SmartMotor. This procedure assumes that: The SmartMotor is connected to the computer. For details, see Connecting the System in the SmartMotor Installation & Startup Guide for your motor. The SmartMotor is connected to a power source. (Certain models of SmartMotors require separate control and drive power.) For details, see Understanding the Power...
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).
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 When the SmartMotor power is turned on, there is a 500 ms "pause" before any program or command is processed: 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...
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.
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.
"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.
Type RUN in the text box and click Send or press Enter Type RUN directly on the terminal screen (blue) area and click Send or press Enter. RUN Command in the Terminal Window Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 55 of 909...
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.
Macros Tuner SMI Options SMI Help Context-Sensitive Help Using F1 Context-Sensitive Help Using the Mouse Help Buttons Hover Help Table of Contents Projects SmartMotor Playground Opening the SmartMotor Playground Moving the Motor Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 57 of 909...
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.
Compile errors, Compile Downloadable SMX file, Compile and Transmit SMX file, Compile Project, etc.). Access SmartMotor tools, monitoring features and options (Macro, Tools Tuner, Motor View, Monitor View, Options, etc.) Control the appearance of the SMI software windows (Cascade, Tile Hori- Window zontally/Vertically, Arrange Icons, etc.).
Page 60
Decelerate Send an END and then an X command to all motors. Motors to Stop SmartMotor Opens the SmartMotor Playground, where you can monitor and Playground jog a single motor in Position, Velocity and Torque modes. Context Help Opens the context help for the selected item.
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.
Page 62
You can double-click on any port to view its properties, as shown in the following figure. Port Properties Window 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...
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.
Page 64
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...
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.
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.
Page 67
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. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 67 of 909...
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...
Page 69
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: 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™...
Page 71
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 SMI Editor. 3. Double-click anywhere in the program to load it into the Trace window.
Page 72
Editor window. The program trace responds based on the option selected in the Trace/Step group (see descriptions following this table). Trace/Step group Various options are available based on other selections (see descriptions following this table). Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 72 of 909...
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...
Page 74
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...
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 >...
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 >...
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.
Page 78
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...
Page 79
6. In the SMI software Terminal window, enter the following commands: T=8000 T=-8000 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...
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...
Page 81
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 & Startup Guide for your motor.
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.
Page 83
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.
Page 84
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.
Page 85
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...
To use the Options window: Click a tab to select the options you wish to edit. 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.
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...
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.
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.
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.
Moving the Motor This procedure assumes that: The SmartMotor is connected to the computer. For details, see Connecting the System in the SmartMotor Installation & Startup Guide for your motor. The SmartMotor is connected to a power source. (Certain models of SmartMotors require separate control and drive power.) For details, see Understanding the Power...
Page 92
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.
Communicating over RS-485 Using Data Mode CAN Communications CADDR=formula CBAUD=formula =CAN, =CAN(arg) CANCTL(function,value) SDORD(...) SDOWR(...) RB(2,4), x=B(2,4) Exceptions to NMT, SDORD and SDOWR Commands I/O Device CAN Bus Master Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 93 of 909...
Page 94
Simplify Machine Support Combitronic with RS-232 Interface Other CAN Protocols CANopen - CAN Bus Protocol DeviceNet - CAN Bus Protocol I²C Communications (D-Style Motors) OCHN(IIC,1,N,baud,1,8,D) CCHN(IIC,1) PRINT1(arg1,arg2, … ,arg_n) RGETCHR1, Var=GETCHR1 RLEN1, Var=LEN1 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 94 of 909...
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.
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.
Data Echo: Also, note the following: 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.
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 Moog Animatics SmartMotor™ Developer's Guide, Rev. L...
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.
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.
For a D-style motor, if the primary communication channel (0) is opened as an RS-485 port, then it assumes the Moog Animatics RS485-ISO adapter is connected to it. If so, then I/O 6 is Moog Animatics SmartMotor™ Developer's Guide, Rev. L...
Close a communications channel Use the CCHN command to close a communications port when desired. 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 Communication menu.
The RS-485 signals of the SmartMotor share I/O functions and are not properly biased for more than just a few SmartMotors. Additionally, proper cabling would include a shielded twisted pair for transmission.
Page 105
The following is an example program that repeatedly transmits a message to an external device (in this case another SmartMotor) and then takes a number back from the device as a series of ASCII letter digits, each ranging from 0 to 9. A carriage return character marks the end of the received data.
Page 106
G command is issued. The SmartMotor has a wealth of data that can be retrieved over the Combitronic, RS-232 and RS-485 ports simply by asking. Data and status reporting commands can be tested by issuing these report commands from any hosting application.
CAN Communications NOTE: DeviceNet is currently not available on the Class 6 SmartMotor. The SmartMotor supports different protocols over the CAN port if equipped. CANopen and DeviceNet are popular industrial networks that use CAN. If a master is communicating to a group of SmartMotors as slaves through either of these standard protocols, the Combitronic protocol can still function without being seen by the CANopen or DeviceNet master.
3; disable master: x is the value -1. For more details, see CANCTL(function,value) on page 354. Specific features are based on the fieldbus network being used. See the corresponding SmartMotor fieldbus guide for more details. SDORD(...) Read value from SDO The SDORD command gets (reads) the value from the specified SDO on a specified device.
No monitoring the heartbeat of other network nodes. No special commands for sending or receiving PDOs. PDOs must be mapped to existing objects to send or receive data as a slave device. Even the SmartMotor designated as a master must configure its own PDO mappings.
This means through CAN and Combitronic communications, you now have full machine control with just a SmartMotor as the bus master—no other external bus master is required. This capability is enabled by the CAN communications commands (NMT, SDORD and SDOWR) described previously in this section, and new/modified objects.
For example, imagine you have three SmartMotors linked together and set with addresses 1, 2 and 3. These examples show how Combitronic communications works: This typical line of code, written in SmartMotor number 2, sets a target position in that same SmartMotor:...
SmartMotor, combined with the speed of the Combitronic communications and the power of the SmartMotor's programming language. Sensors and valves can be connected to the closest SmartMotor in the machine and be available to the program of any SmartMotor on the network.
Combitronic with RS-232 Interface Any SmartMotor may be used as a master access through RS-232 to all SmartMotors on its network. The following figure demonstrates 12 motors in a network where four SmartMotors are in a serial daisy chain over RS-232. Each of those four banks may have up to 119 motors on its Combitronic network.
Page 114
Motor 4, only, gets its own target position set to 345 4PT=345 Motor 1, 2, 3 and 4 receive Go command All motors on RS-232 and all network Combitronic motors receive Go 0G:0 command Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 114 of 909...
CANopen is an industrial CAN bus protocol supported on SmartMotors ordered with the CANopen option. The protocol supports the CiA 402 profile for drives and motion devices. The hosting controller can use an EDS file supplied by Moog Animatics that provides control of the SmartMotor over the CANopen network.
Page 116
PRINT("Read bytes: ",ab[3],", ",ab[2],", ",ab[1],", ",ab[0],#13) PRINT("Read ",a," at pos ",p,#13) PRINT(#13) RETURN The following are related commands. For more details on these commands, see Part 2: SmartMotor Command Reference on page 238. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 116 of 909...
For example, the value is 0-255 for normal data, which represents all possible values for the byte. If the value from the GETCHR1 command is -1, it means the buffer is empty. RLEN1, Var=LEN1 Gets the number of bytes in the receive buffer. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 117 of 909...
Part 1: Programming: Motion Details Motion Details This chapter provides details on making motion with the SmartMotor. Introduction Motion Command Quick Reference Basic Motion Commands Target Commands Motion Mode Commands Torque Commands Brake Commands Index Capture Commands Other Motion Commands...
Page 119
Part 1: Programming: Motion Details Synchronized Motion Synchronized-Target Commands Other Synchronized-Motion Commands Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 119 of 909...
For example, the comma is used with the optional "m/s" argument in the command MFSLEW (distance[,m/s]). Enter the following commands in the Terminal window to move the SmartMotor: EIGN(2) 'Disable left limit...
RES command. The RRES command will report encoder resolution. You can also use the RES command directly in math formulas. EXAMPLE: If you want it the axis to move to location 1234, then you would issue: PT=1234 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 121 of 909...
2147483647. The end position can be set or changed at any time during or at the end of previous moves. SmartMotor™ sizes 17 and 23 resolve 4000 increments per revolution, while SmartMotor size 34 resolves 8000 increments per revolution.
The value must be in the range -2147483647 to 2147483647. Note that in position moves, this value is the unsigned speed of the move and does not imply Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 123 of 909...
Issuing the Mode Position (MP) command puts the SmartMotor in Position mode. Position mode is the default mode of operation for the SmartMotor on power-up. In Position mode, the PT, PRT, VT, ADT, AT and DT commands can be used to govern motion. At a minimum, ADT, VT and (PT or PRT) must be issued.
PID loop is inactive. Torque Commands The following commands set the torque slope and value. For more details on these commands, see Part 2: SmartMotor Command Reference on page 238. TS=formula Set Torque Slope The TS= command causes new torque settings to be reached gradually, rather than instantly.
Where a SmartMotor is not equipped with a physical brake, it simulates braking with its Mode Torque Brake (MTB) feature, which causes a faulted motor to still experience strong resistance to shaft motion.
I/O. Only one pin can be used as the brake pin at any one time. Therefore, each command supersedes the other. For the M-style SmartMotor, only output 8 works for that motor. Therefore, the values are: EOBK(8) to enable...
Part 1: Programming: Index Capture Commands WARNING: The MTB feature only works when power is applied to the SmartMotor. Therefore, DO NOT use it as a substitute for a physical brake when operator or equipment safety is an issue. The MTB command immediately activates dynamic braking independently of the Brake mode.
Other Motion Commands The following commands are used to start, stop or decelerate motion, reset or shift the origin, and turn the motor servo off. For more details on these commands, see Part 2: SmartMotor Command Reference on page 238.
±31-bit rollover Position mode problems. If the SmartMotor runs in one direction for a very long time, it will reach position -2147483648 or +2147483647, which causes the position counter to change sign.
Part 1: Programming: Commutation Modes Commutation Modes Because the SmartMotor uses a brushless motor, it does not have the mechanical commutator that a brushed motor has to switch the current to the next optimal coil as the rotor swings around. To cause shaft rotation in a brushless motor, the control electronics have to see where the shaft is, and then decide which coils to deliver the current to next.
Status Word 6, Bit 9 indicates if this mode is active. MINV(0), MINV(1) Invert Motion Direction The MINV(1) command inverts the direction convention of the SmartMotor. The MINV(0) command restores the default. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 132 of 909...
Torque Mode NOTE: Torque mode is an immediate response mode. In Torque mode, also referred to as Mode Torque (MT), the SmartMotor shaft applies a torque independent of position. The internal encoder tracking still takes place, and can be read by a host or in a program.
' turn the motor off Velocity Mode Velocity mode allows the SmartMotor to run at a constant commanded speed. SmartMotors close the speed loop on position, not encoder counts per unit time. As a result, moving to and from Position mode to Velocity mode is simple.
Part 1: Programming: Absolute (Position) Mode Absolute (Position) Mode Absolute (Position) mode is the default power-up mode of operation for the SmartMotor. In Position mode, the SmartMotor operates on absolute position commands, which use encoder counts. The following list details the minimum requirements for a move to occur in Position mode: • ...
Relative Position Mode In Relative Position mode the SmartMotor moves relative to its current position by the use of the PRT (Position Relative Target) command. The following list details the minimum requirements for a move to occur in Relative mode: • ...
(for example, traverse and take-up spooling). The CANopen objects related to this are: 1005h, 1006h, 2207h, 2208h, 2209h, 220Ah-220Dh. For details on these objects refer to the SmartMotor CANopen Guide. For a sample user program, see CAN Bus - Time Sync Follow Encoder on page 844.
SmartMotor Command Reference on page 238. SRC(enc_src) Select the input source used in Follow and Cam modes The SRC() command can allow the SmartMotor to use the many advanced following and camming functions even without an external encoder input. Values for enc_src: Null (pauses master)
SRC(-2) Results in inverting master signal direction and changing motor direction. Changing the sign of either MFMUL or MFDIV also inverts direction. SRC(-1) Inverts the external encoder signal; provides the easiest way to correct Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 139 of 909...
This example shows a profile driven by an incoming encoder signal. In addition to following the incoming encoder, the SmartMotor performs an acceleration (ascend or ramp up) into the following relationship (slew), and after a prescribed distance, performs a deceleration (descend or ramp down) back to rest.
Page 141
'Move 400 master counts over descend (area "D") MFSLEW(200,0) 'Maintain sync ratio for 200 master counts (area "S") 'Calculate ratio, set mode Each time a G (Go) is received, the motor follows the Trapezoidal Move Profile (TMP). Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 141 of 909...
Encoder Bus connecters, such as M-style SmartMotors. The ENCD() command allows the M-style SmartMotor to use the Encoder Bus port as either an input or an output. This allows the motor to operate as a master (output) or slave (input) when daisy chained to other M-series motors through the Encoder Bus ports.
The following sections provide commands and example programs designed to help you handle the challenges of spooling/winding applications. Relative Position, Auto-Traverse Spool Winding The following figure provides a simple representation of an auto-traversing spool winding application. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 143 of 909...
NOTE: The MFMUL and MFDIV commands do not have an effect on dwell time or distance. Dwell is strictly based on raw master encoder counts selected by the SRC () command specifying internal virtual or external master count source. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 144 of 909...
Page 145
The motion repeats until another MFSDC command is issued with Exp1 equal to -1 and is followed by a G command, or an X or S command is issued. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 145 of 909...
The sign of MFMUL/MFDIV is ignored in this mode of operation — only the absolute value is used. The initial direction of motion is not affected by the sign of MFMUL/MFDIV. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 146 of 909...
NOTE: The value of MFHTP must be greater than or equal to the value of MFLTP. The following are related commands. For more details on these commands, see Part 2: SmartMotor Command Reference on page 238. They are not intended to be combined with Cam mode.
CAUTION: Large values may cause jerks in motion or following errors. The ECS command is dynamic and immediate (not buffered), and it does not require a G command. Further, it works on top of any gearing or camming mode. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 148 of 909...
Page 149
4. The SmartMotor adjusts its gearing. The ECS command is for tiny continuous corrections, where changing MFMUL or MFDIV is not desired because the basic ratio needs to remain fixed, but changes in demand for correction may need to be adjusted over time.
(low-frequency traverse), to create a custom "chevron" wrap. For electronic camming details, see Cam Mode (Electronic Camming) on page 153. The frequency plot for this winding method is shown in the following figure. "Chevron" Winding Frequency Plot Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 150 of 909...
Page 151
The complete code example is available in Chevron Traverse & Takeup on page 838. For more information on electronic camming, see Cam Mode (Electronic Camming) on page 153. Also, see the Fixed Segment Cam Simulator (on the Moog Animatics website, in the folder http://www.animatics.com/tools), which is a gearing/camming training aid.
CAUTION: Do not repeat the G command while in traverse mode. Doing so will produce unpredictable behavior that is undefined at this time. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 152 of 909...
Example Cam Profile The SmartMotor supports motion profiles based on data stored in a Cam table. The Cam table can reside in EEPROM memory or in the user array.
Page 154
Cam mode has the ability to apply sophisticated shaping and selection of the encoder input source using Follow mode. Cam mode uses MFMUL and MFDIV to set the follow ratio for Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 154 of 909...
Page 155
(high-frequency oscillation) occurs on top of gearing (low-frequency traverse). This is used to spool material in a way that prevents it from getting pinched or trapped in the underlying layers. For more details, see Chevron Wrap Example on page 150. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 155 of 909...
Motion is created by "massaging" TMP intermediate counts into the cam table. It is NOT gearing summed with camming. If the cam length is 0, there is no motion! Use the Fixed Segment Cam Simulator (on the Moog Animatics website, in the folder http://www.animatics.com/tools) to learn how to properly select the appropriate settings that perform the number of cam cycles desired.
(intermediate counts); it IS NOT the motor/shaft total output! For example: If you know that you need to follow a conveyor (not driven by the SmartMotor) and accelerate over 1000 counts distance on that conveyor as the input value, then choose MFA(x,0) for source counts.
Page 158
1000 1000 MFA(1000,1) MFMUL=3 MFSLEW(5000,1) MFDIV=7 Input MFD(1200,1) counts Source Counts into Cam versus Intermediate Counts into Cam Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 158 of 909...
MFSDC and the other commands come into play, espe- cially for label feeding, traverse cutting, and similar applications. For an example, refer to the sample program Camming - Demo XY Circle on page 836. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 159 of 909...
Page 160
'do something here that you want to do only once 'such as write a cam table to nonvolatile memory EPTR=100 'set EEPROM pointer a=123 VST(a,1) 'write value to EEPROM ELSE 'something was already done ENDIF RETURN Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 160 of 909...
MFD(d,1) 'a+s+d = 32000 Electronic Gearing and Camming over CANopen Beginning with firmware 5.x.4.30 or later, the SmartMotor provides precise time synchronization over CANopen between motors for electronic gearing and camming Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 161 of 909...
(for example, traverse and take-up spooling). The CANopen objects related to this are: 1005h, 1006h, 2207h, 2208h, 2209h, 220Ah-220Dh. For details on these objects refer to the SmartMotor CANopen Guide. For a sample user program, see CAN Bus - Time Sync Follow Encoder on page 844.
Spline mode with periodic data wrapped at ends of table MCW(table,point) Cam table starting point The MCW() command determines where to start the Cam function. table Defines the Cam table number point Defines the starting point in the table Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 163 of 909...
Shift the origin of the global move generator (sets value of PA) Shift the origin of move generator 1 (sets value of PC(1)) Shift the origin of move generator 2 (sets value of PC(2)) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 164 of 909...
The following chart shows a plot of from the example code that follows. It shows the effects of certain status bits, I/O points and the resulting motion profile. For additional cam example programs, see Part 3: Example SmartMotor Programs on page 823. Sample Plot from Example Program Note the following: Changes to the SRC sign results in moving the opposite direction through the Cam table.
Page 166
'========================================================= ' Run cam operation PT=0 G TWAIT SRC(2) MCE(1) 'Spline MCW(1,0) MFA(0,1) MFD(0,1) MFMUL=1 MFDIV=1 MCMUL=1 MCDIV=1 MFSLEW(112000,1) MFSDC(100,0) 'Set dwell for "c" counts, auto rev. after dwell RETURN '======================================================== Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 166 of 909...
Page 167
Repeated erasing and rewriting can burn bits and corrupt data. For details and sample code, refer to Electronic Camming Notes and Best Practices on page 159. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 167 of 909...
SmartMotor is running. This procedure assumes that: The SmartMotor is connected to the computer. For details, see Connecting the System in the SmartMotor Installation & Startup Guide for your motor. The SmartMotor is connected to a power source. (Certain models of SmartMotors require separate control and drive power.) For details, see Understanding the Power...
Page 169
3. In the SMI software Terminal window, enter the following commands: T=TRQ The motor switches to Torque mode. The change is visible in the Mode box of the Motor View window. Motor Switched to Torque Mode Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 169 of 909...
Part 1: Programming: Position Counters Position Counters The SmartMotor's processor contains various position counters. These are used to keep track of shaft position and the position of trajectories, or commanded counts within those trajectory generators. Some of the counters are virtual, while others directly track hardware. All counters may be set to zero or changed to a specific value as shown in the following table.
Modulo Position Commands The following commands are used to set and read the modulo position. For more details, see Part 2: SmartMotor Command Reference on page 238. PML=formula Set the modulo limit. The modulo counter reports between 0 and this value minus one.
Trajectory 1 - PC(1) Trajectory 2 - PC(2) Position - MP(1) Velocity - MV(1) CANopen Interpolation Follow - MFR(2) Cam - MC(2) Torque mode overrides all other modes Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 172 of 909...
Page 173
Some commands may be directed at a specific trajectory generator. The following list shows these commands and which trajectory they can act on. For more details, see Part 2: SmartMotor Command Reference on page 238. MP(trj#) trj# = 1 only...
Commands That Read Trajectory Information The following list shows the commands that can be used to read trajectory information. For more details, see Part 2: SmartMotor Command Reference on page 238. Read back what has been set as the velocity target.
Part 1: Programming: Dual Trajectory Example Program Dual Trajectory Example Program In the following program, the SmartMotor moves to its origin and then instantly begins gearing to an external encoder. It then performs a relative move on top of the gearing relationship, with the relative move governed by the VT= and ADT= limits.
In addition to the three-axis limitation, keep in mind the overall limit of 64 characters per line of code in the SmartMotor. Using variables in place of explicit positions is more space efficient. The PTS() command processes the positions as absolute, whereas the PRTS() command treats them as relative.
(current) position before using the PTS or PTSS command. This is done by issuing the Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 177 of 909...
Other Synchronized-Motion Commands The following commands are used to start a synchronized move and wait for a synchronized move to complete. For more details on these commands, see Part 2: SmartMotor Command Reference on page 238. Start Synchronized Move To start a synchronized motion profile, use the GS command.
The next code example adds subroutine efficiency, the efficiency of setting up the next move while the existing move is ongoing, and adds an error check before continuing to issue synchronized move commands. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 179 of 909...
Page 180
Combitronic interface. By loading interrupt routines in each SmartMotor that constantly monitor for drive status, each motor can be made responsible for reporting a local error. By this means, it is no longer necessary to poll each motor.
Part 1: Programming: Program Flow Details Program Flow Details This chapter provides information on using program flow commands with the SmartMotor. Introduction Flow Commands RUN? GOTO#, GOTO(label), C# GOSUB#, GOSUB(label), RETURN IF, ENDIF ELSE, ELSEIF WHILE, LOOP SWITCH, CASE, DEFAULT, BREAK, ENDS...
Program commands are like tasks. Whether the task is to turn on an output, set a velocity or start a move, a program is a list of these tasks. When a programmed SmartMotor is powered- up or is reset with the Z command, it executes its program (list of tasks) from top to bottom, with or without a host PC connected.
Part 1: Programming: RUN Execute Stored User Program If the SmartMotor is reset with a Z command or at power-up, all previous variables and mode changes are erased for a fresh start, and the program begins execution from the top.
ENDIF executes only when the condition directly following the IF command is true. For example: a=IN(0) 'Variable "a" set 0,1 a=a+IN(1) 'Variable "a" 0,1,2 a==1 'Use double "=" to test 'Set "b" to one ENDIF 'End IF Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 184 of 909...
ENDIF command. Also, notice that the SmartMotor language uses a single equal sign (=) to make an assignment, such as where variable a is set to equal the logical state of input 0. Alternatively, a double equal sign (==) is used as a test, to query whether variable a is equal to 1 without making any change to it.
'Set "b" to one BREAK CASE 'Set "c" to one BREAK CASE 'Set "c" to two BREAK DEFAULT 'If not 0 or 1 'Set "d" to one BREAK ENDS 'End SWITCH Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 186 of 909...
STACK command and then a GOTO command, which would send the program back to a label at the beginning. Using this method instead of the RESET command would retain the states of the variables and allow further specific action to resolve the emergency. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 187 of 909...
The SmartMotor program is never erased until a new program is downloaded. To erase the program in a SmartMotor, download only the END command as if it were a new program. That will be the only command that is left in the SmartMotor until a new program is downloaded.
Part 1: Programming: Program Flow Examples Program Flow Examples The following are techniques that can be used for flow control in your SmartMotor program. All sample code shows advanced use of program flow syntax. Additionally, there are references to lesser-used math functions and system parameters to enforce learning of new programming techniques.
ENDIF LOOP C100 UIA>(i*2) 'If current is twice as much GOTO200 'bypass PRINT line below ENDIF PRINT("Current is above ",i,"mAmps",#13) C200 PRINT("Current twice as high as it should be!",#13) RETURN Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 190 of 909...
BREAK 'Note: Defines not allowed in PRINTs CASE 1 PRINT("Value ",y,#13) BREAK CASE 2 PRINT("Value ",y,#13) BREAK CASE 3 PRINT("Value ",y,#13) BREAK CASE 4 PRINT("Value ",y,#13) BREAK ENDS x=FiveValues RETURN Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 191 of 909...
There are dozens of different bits of information available in the SmartMotor, which are held in groups of 16 status bits called Status Words. ITR() can tell the SmartMotor to execute a subroutine after the change of any one of these status bits in any Status Word.
Page 193
'Place a label GOTO10 'Loop, req. for int. operation 'End (never reached) 'Interrupt subroutine 'Decelerate to stop TWAIT 'Hold program until motor reaches stop 'Restart velocity motion RETURNI 'Return to infinite loop Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 193 of 909...
Part 1: Programming: Variables and Math Variables and Math This chapter provides information on using variables and math functions with the SmartMotor. Introduction Variable Commands EPTR=formula VST(variable,number) VLD(variable,number) Math Expressions Math Operations Logical Operations Integer Operations Floating Point Functions Math Operation Details and Examples...
For more details on array variables, see Array Variables on page 198. Variable Commands The following commands are used to load and store variables. For more details, see Part 2: SmartMotor Command Reference on page 238. EPTR=formula Set EEPROM Pointer in Bytes, 0-32767 To read or write into this memory space, it is necessary to properly locate the pointer.
Modulo SQRT (x) Integer Square Root (x = integer, where x>=0) ABS (x) Integer Absolute Value (x = integer) Floating Point Functions The following floating point functions are also supported: Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 197 of 909...
Set variable to a signed 16-bit value where index i=0...101 Set variable to a signed 32-bit value where index i=0...50 al[i]=formula NOTE: The index i may be a number, a variable or an expression. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 198 of 909...
Therefore, it may be necessary to "buffer" or "store" that data until it is time for the SmartMotor to process it. To set up a buffer, the programmer allocates a block of memory to it, assigns one variable to an input pointer and another variable to an output pointer.
Overview Status bits and LED indicators are used to keep the programmer or operator aware of present or past fault conditions of the SmartMotor. Keep the following points in mind when viewing the status bits or LEDs. Red LEDs do not necessarily mean the motor has faulted.
For more details, see Moment of Inertia on page 874. Proper load to motor sizing is crucial in preventing most of these fault conditions from occurring. Please consult the Moog Animatics Product Catalog for more information. Also, see Torque Curves on page 888.
Monitoring the SmartMotor Status on page 206. The following are related commands. For more details on these commands, see Part 2: SmartMotor Command Reference on page 238. PAUSE Suspend Program Execution The PAUSE command suspends program execution until the RESUME command is received. It will not affect the present state of the Interrupt Handler.
These are described in the following sections. Additionally, this section describes the FSA (fault stop action) command. For more details, see Part 2: SmartMotor Command Reference on page 238. Position Error Limits The following commands are used to set and read position error limits: EL=formula Set position error limit.
Software limits offer distinct advantages over hardware limits connected to the limit inputs of the SmartMotor. Software limits are "virtual" (non-hardware) limit switches that can interrupt motion with a limit fault in the event the actual position of the motor strays beyond the desired region of operation.
SMI software interface, which is accessed by pressing the F1 key or selecting Help from the SMI software main menu. The Motor View tool is used to monitor the status of the SmartMotor. To see the status of the connected motor, select: Tools >...
Page 207
Motor View (with Polling Enabled) NOTE: The SmartMotor's hardware limits must be connected (tied low) or disabled for motion to occur. Therefore, if your SmartMotor doesn't move when moving the slider or issuing a motion command, verify that you've either connected the limits or selected both Disable Hardware Limits check boxes (located at the lower-right corner of the SmartMotor Playground screen).
Part 1: Programming: System Status System Status This chapter provides information on using system status words and bits with the SmartMotor. Introduction Retrieving and Manipulating Status Words/Bits System and Motor Status Bits Reset Error Flags System Status Examples Timer Status Bits...
IF and WHILE instructions. Therefore status bits can determine the flow or path of execution of an application program. In addition to the information in this chapter, see Status Words on page 879. Also, the Moog Animatics website contains a useful tool for working with status bits, the SmartMotor Developer's Worksheet, which is available at: http://www.animatics.com/tools.
Page 210
Hardware index/capture input level on the internal motor encoder Bx(0) Hardware index/capture input level on the external encoder Bx(1) For more details, see Part 2: SmartMotor Command Reference on page 238. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 210 of 909...
OFF command before issuing the ZS command, which clears the current commanded trajectory and allows the reset to complete. For more details, see Part 2: SmartMotor Command Reference on page 238. System Status Examples An example of where you could use a System status bit would be to replace the TWAIT command.
Sets Timer Status bit 0 true for 1 second. =TMR(3) Gets the value of Timer 3. For more details, see Part 2: SmartMotor Command Reference on page 238. Interrupt Status Bits Interrupt Status Bits are true if an interrupt is enabled. It is important to note the interrupts need to be configured before being enabled for proper operation.
Typically, to get an I/O port logical status, you would use the IN() instructions for zero-based addressing of the I/O Ports. As with any status of the SmartMotor, you can also retrieve the I/O port status, but not change its state, using the W() and B() status word/bit commands.
The outputs of the trajectory generators can be manipulated to affect the SmartMotor in a combination of ways, which are discussed in other section of this manual. The trajectory generator status bits help you properly control the use of the trajectory generators from an application program or over a network.
Cam User Bits offer a periodic signal based on the phase of a cam, and they can be programmed to come on and off within any given section of the cam. They function much like a standard Programmable Limit Switch (PLS). In a standard Class 5 SmartMotor, these bits reside in Status Word 8.
CANopen network. The same bits supported for cams also exist as a separate set of status bits when operating in IP mode. In a standard Class 5 SmartMotor, these bits reside in Status Word 8. When Moog Animatics SMNC multi-axis contouring software is used, there is built-in support for these status bits.
Class 5 D-Style Motors: Special Functions of I/O Ports Class 5 M-Style Motors: Special Functions of I/O Ports Class 6 M-Style Motors: Special Functions of I/O Ports I/O Brake Output Commands I²C Expansion (D-Style Motors) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 217 of 909...
The extensive and flexible I/O gives the SmartMotor the capability to control an entire machine. Each point of SmartMotor I/O can be used or configured as a digital input or digital output. For example, on the D-style SmartMotor, there are seven points of 5V I/O located in the 15-pin D- sub connector, and an optional ten points of isolated 24V I/O located in a circular, M-12 connector.
This section provides information on how the SmartMotor handles voltage spikes on the I/O lines. While all SmartMotor I/O is confined to operate between 0 and 5 VDC, some circuitry exists to accommodate spikes above and below the operational range. This is permitted as long as those spikes are moderate and have a short duration.
Connector Pinout table in the SmartMotor Installation & Startup Guide for your motor. All SmartMotor I/O points default to inputs when power is applied to the SmartMotor, until the user program makes a change. Because of the pull-up resistor, the voltage read at each port will be about 5 VDC.
=OF(D,word) Returns an error code from the controller associated with this I/O word. For more details, see Part 2: SmartMotor Command Reference on page 238. General-Use Input Configuration This section describes the general-use input configuration commands available for the SmartMotor.
'get first 4 I/O states into ab[0] through ab[3] a=a+1 LOOP WHILE a<4 OS(a+4) 'turn ON I/O ports 4 through 7. a=a+1 LOOP OUT(W,1)=aw[0] 'set expansion I/0 to value in aw[0] OR(W,1,a) 'reset only I/O 16 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 222 of 909...
Analog Functions of I/O Ports An I/O port’s analog value can be monitored with the following commands. The 24V I/O of a SmartMotor offers more flexibility than the 5V I/O, as shown below. All scaled readings are in millivolts. The analog reads can help diagnose wiring issues external to the SmartMotor. For example, while Ports 4 and 5 are being used as RS-485, the signal bias could be monitored;...
This chapter provides information on the special functions of I/O ports for Class 5 and Class 6 motors. Class 5 D-Style Motors: Special Functions of I/O Ports Class 5 M-Style Motors: Special Functions of I/O Ports Class 6 M-Style Motors: Special Functions of I/O Ports Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 224 of 909...
RS4. For more details on these optional protocols, see the documentation for the specified protocol. The communication protocol is specified with the OCHN command type parameter. For details, see OCHN(type,channel,parity,bit rate,stop bits,data bits,mode,timeout) on page 101. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 225 of 909...
Disables capture on indicated encoder For additional information on index capture, see Index Capture Commands on page 128. For more details, see Part 2: SmartMotor Command Reference on page 238. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 226 of 909...
The following commands are used to capture input from internal or external encoders: EIRE Index/registration input capture of the external encoder count (default setting) EIRI Index/registration input capture of the internal motor encoder count Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 227 of 909...
Disables capture on indicated encoder For additional information on index capture, see Index Capture Commands on page 128. For more details, see Part 2: SmartMotor Command Reference on page 238. I/O Port 6 – Go Command The following command is used to issue a G (Go) command:...
The following commands are used to capture input from internal or external encoders: EIRE Index/registration input capture of the external encoder count (default setting) EIRI Index/registration input capture of the internal motor encoder count Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 229 of 909...
I²C and deliver many resources. I²C chips include: I/O expanders, analog input and output, nonvolatile memory, temperature sensors, etc. I²C provides a low cost means of expanding the functionality of a SmartMotor. For more details on I²C, see I²C Communications (D-Style Motors) on page 115.
Understanding the PID Control Tuning the PID Control Using F Setting KP Setting KD Setting KI and KL Setting EL=formula Other PID Tuning Parameters KG=formula KV=formula KA=formula Current Limit Control AMPS=formula Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 231 of 909...
NOTE: The PID filter is off when operating in Torque mode. In the Class 5 SmartMotor, the PID update rate defaults to 125 microseconds (8,000 times per second). Optionally it may be decreased or increased to a maximum of 62.5 microseconds.
For details on the Motor View tool, see Motor View on page 68. NOTE: In most cases, it is unnecessary to tune a SmartMotor. They are factory tuned, and stable in virtually any application.
Typically, KI (integral coefficient) is used to compensate for friction; without it, the SmartMotor will never exactly reach the target. Begin with KI equal to zero and KL equal to 1000. Move the motor off target and start increasing KI and KL. Keep KL at least ten times greater than KI during this phase.
The EL command serves that purpose. It defaults to 1,000, but it can be set from 0 to 262,143. You can view the current value with the REL (report EL) command. For more details, see Part 2: SmartMotor Command Reference on page 238. Other PID Tuning Parameters There are additional parameters that can be used to reduce the position error of a dynamic application.
KA=formula Set KA, Acceleration Feed Forward If the SmartMotor is accelerating a mass, it will be exerting a force during that acceleration (force = mass X acceleration), which disappears immediately on reaching the cruising speed. This momentary torque during acceleration is also predictable, and its effects can be programmed out with the KA (acceleration feed forward) parameter.
PWM duty cycle, which will reduce the maximum speed of the motor as well. NOTE: The AMPS command has no effect in Torque mode. For more details, see Part 2: SmartMotor Command Reference on page 238. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 237 of 909...
Part 2: SmartMotor Command Reference Part 2 of this guide provides the reference pages for the SmartMotor command set. The commands are listed in alphabetical order. In addition: A quick-reference command list sorted alphabetically is available at the end of this manual.
Page 239
Related Commands This section lists commands that are functionally related to the current command. NOTE: A superscript "R" character preceding the command indicates there is a corresponding "report" version of that command. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 239 of 909...
Page 240
EXAMPLE: (as delimiter and null terminator in PRINT command) PRINT("a=1 b=2 ") 'Note space after b=2 as null terminator. equivalent: PRINT("a=1 b=2",#13) 'Note carriage return as null terminator. RELATED COMMANDS: Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 240 of 909...
":3" is the motor address — use the actual address or a variable DETAILED DESCRIPTION: The SmartMotor™ has three groups of predefined user variables: The first group consists of the variables a through z The second group consists of the variables aa through zz...
Page 242
'and modulo divides. 'Reports 605032704; this is what is expected if 'the original value 'wrapped' on 32-bit boundaries. 'Reports 0; this does not cause an error. Program output is: 605032704 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 242 of 909...
Page 243
All user variables are initialized to the value 0 at power up or on execution of the Z system-reset command. Other than by direct assignment, this is the only way the SmartMotor sets all of the user variables to 0. Issuing a RUN command does not perform this automatic initialization.
Page 244
Part 2: Commands: aaa...zzz al[index]=formula Array Long [index] (see page 272) aw[index]=formula Array Word [index] (see page 288) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 244 of 909...
DETAILED DESCRIPTION: The SmartMotor™ has 8, 16 and 32-bit arrays. The 8-bit array takes the form of the variables ab[index]. These are general-purpose, 8-bit, signed-integer variables that can be reported, used on either side of an equation, and mixed in an expression with variables other than 8-bit.
Page 246
In the equation cc=ab[4]-aw[7], both ab[4] and aw[7] are converted into 32-bit numbers before the subtraction occurs. In the SmartMotor language, all user variables are written as lowercase letters, while functions and commands have at least one uppercase character. The term "a" is a general-purpose variable, while "A"...
Page 247
All user variables are initialized to the value 0 at power up or on execution of the Z system-reset command. Other than by direct assignment, this is the only way the SmartMotor sets all of the user variables to 0. Issuing a RUN command does not perform this automatic initialization.
EXAMPLE: a=ABS(-5) 'Set variable = ABS(-5) PRINT(a,#13) 'Print value of variable a RABS(-5) 'Report ABS(-5) Program output is: Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 248 of 909...
Page 249
Part 2: Commands: ABS(value) RELATED COMMANDS: FABS(value) Floating-Point Absolute Value of ( ) (see page 448) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 249 of 909...
Page 250
100000 G (start motion) Positive (increasing position) Positive 100000 X (end motion) Positive (increasing position) Negative -100000 G (start motion) Negative (decreasing position) Negative -100000 X (end motion) Negative (decreasing position) Positive Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 250 of 909...
Page 251
Output Equation Radians/(Sec =AC*PI*2*((((SAMP*1.0)*SAMP)/65536.0)/RES) Encoder Counts/(Sec =AC*(((SAMP*1.0)*SAMP)/65536.0) Rev/(Sec =AC*((((SAMP*1.0)*SAMP)/65536.0)/RES) RPM/Sec =AC*60.0*((((SAMP*1.0)*SAMP)/65536.0)/RES) RPM/Min =AC*3600.0*((((SAMP*1.0)*SAMP)/65536.0)/RES) EXAMPLE: ADT=10 VT=100000 WAIT=10 'Wait to make sure move has started WHILE AC>0 LOOP PRINT("Acceleration Complete",#13) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 251 of 909...
Page 252
Part 2: Commands: AC RELATED COMMANDS: AT=formula Acceleration Target (see page 280) ADT=formula Acceleration/Deceleration Target (see page 257) DT=formula Deceleration Target (see page 390) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 252 of 909...
Although the floating-point variables and their standard binary operations conform to IEEE-754 double precision, the floating-point square root and trigonometric functions only produce IEEE-754 single-precision results. For more details, see Variables and Math on page 195. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 253 of 909...
Page 254
60.000000000 60.000000000 64.329193115 RELATED COMMANDS: ASIN(value) Arcsine (see page 278) ATAN(value) Arctangent (see page 282) COS(value) Cosine (see page 366) SIN(value) Sine (see page 700) TAN(value) Tangent (see page 736) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 254 of 909...
COMBITRONIC: DETAILED DESCRIPTION: The SmartMotor™ is designed to be used as much in multiple-axis systems as in single-axis systems. For that reason, each SmartMotor can be uniquely addressed through the ADDR command. Used within a program, ADDR permits an identical program stored in different motors to differentiate between motors and provide individual runtime controls.
Page 256
0CADDR=ADDR 'Set if not same as motor address 'Reset all motors to enable CAN address RELATED COMMANDS: CADDR=formula CAN Address (see page 350) SADDR# Set Address (see page 688) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 256 of 909...
RES, is shown in RES on page 670 and SAMP on page 690. EXAMPLE: (Shows use of ADT, PT and VT) 'Set mode position ADT=5000 'Set target accel/decel PT=20000 'Set absolute position VT=10000 'Set velocity 'Start motion 'End program Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 257 of 909...
Page 258
PID# Proportional-Integral-Differential Filter Rate (see page 623) PRT=formula Position, Relative Target (see page 652) PT=formula Position, (Absolute) Target (see page 658) VT=formula Velocity Target (see page 788) X Decelerate to Stop (see page 804) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 258 of 909...
The number is stored in a base-2 format, including the fractional part. This can result in subtle issues with precision and representation of base-10 values. This is generally Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 261 of 909...
Page 262
'Reduce the size of the value to something an 'integer can handle. a=(1300000.0*2700000)/1000000 'This has the same result; the equation 'still performs a floating-point divide 'and stores the integer result. Program output is: 123.500000000 0.000000000 0.100000000 3510000 3510000 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 262 of 909...
Page 263
Array Word [index] (see page 288) DFS(value) Dump Float, Single (see page 387) LFS(value) Load Float Single (see page 516) VLD(variable,number) Variable Load (see page 780) VST(variable,number) Variable Save (see page 784) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 263 of 909...
NOTE: The rising and falling edges are stored to different index registers. The value parameter specifies the encoder to be captured; it does not specify the source of the index signal. Ai(0) specifies internal encoder Ai(1) specifies external encoder Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 264 of 909...
Page 265
Bi(enc) Bit, Index Capture, Rising (see page 304) EIRE Enable Index Register, External-Input Capture (see page 412) EIRI Enable Index Register, Internal-Input Capture (see page 414) I(enc) Index, Rising-Edge Position (see page 471) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 265 of 909...
NOTE: The rising and falling edges are stored to different index registers. The argument specifies the encoder to be captured, it does not specify the source of the index signal. Aij(0) specifies internal encoder Aij(1) specifies external encoder Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 266 of 909...
Page 267
EIRE Enable Index Register, External-Input Capture (see page 412) EIRI Enable Index Register, Internal-Input Capture (see page 414) I(enc) Index, Rising-Edge Position (see page 471) J(enc) Index, Falling-Edge Position (see page 493) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 267 of 909...
NOTE: The rising and falling edges are stored to different index registers. The argument specifies the encoder to be captured, it does not specify the source of the index signal. Aj(0) specifies internal encoder Aj(1) specifies external encoder Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 268 of 909...
Page 269
Bj(enc) Bit, Index Capture, Falling (see page 307) EIRE Enable Index Register, External-Input Capture (see page 412) EIRI Enable Index Register, Internal-Input Capture (see page 414) J(enc) Index, Falling-Edge Position (see page 493) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 269 of 909...
NOTE: The rising and falling edges are stored to different index registers. The argument specifies the encoder to be captured, it does not specify the source of the index signal. Aji(0) specifies internal encoder Aji(1) specifies external encoder Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 270 of 909...
Page 271
EIRE Enable Index Register, External-Input Capture (see page 412) EIRI Enable Index Register, Internal-Input Capture (see page 414) I(enc) Index, Rising-Edge Position (see page 471) J(enc) Index, Falling-Edge Position (see page 493) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 271 of 909...
DETAILED DESCRIPTION: The SmartMotor™ has 8, 16 and 32-bit arrays. The 32-bit array takes the form of the variables al[index]. These are general-purpose, 32-bit signed integer variables that can be reported, used on either side of an equation, and can be mixed in an expression with variables other than 32-bit.
Page 273
In the equation al[0]=ab[4]-aw[7], both ab[4] and aw[7] are converted into 32-bit numbers before the subtraction occurs. In the SmartMotor language, all user variables are written as lowercase letters, while functions and commands have at least one uppercase character. The term "a" is a Moog Animatics SmartMotor™...
Page 274
All user variables are initialized to the value 0 at power up or on execution of the Z system-reset command. Other than by direct assignment, this is the only way the SmartMotor sets all of the user variables to 0. Issuing a RUN command does not perform this automatic initialization.
DETAILED DESCRIPTION: The AMPS command limits both the continuous torque and speed of the SmartMotor™. To set the SmartMotor to use maximum available PWM, issue the command AMPS=1023. Setting AMPS=0 limits PWM to 0 and prevents any output torque. To conceptually understand...
Page 276
'Switch to Position mode VT=20000 'Set higher maximum velocity PT=0 'Set target position to be home 'Start motion TWAIT 'Wait for motion to complete AMPS=1023 'Restore current limit to maximum 'End program Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 276 of 909...
Page 277
Part 2: Commands: AMPS=formula RELATED COMMANDS: MT Mode Torque (see page 589) T=formula Torque, Open-Loop Commanded (see page 730) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 277 of 909...
Although the floating-point variables and their standard binary operations conform to IEEE-754 double precision, the floating-point square root and trigonometric functions only produce IEEE-754 single-precision results. For more details, see Variables and Math on page 195. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 278 of 909...
Page 279
30.000000000 30.000000000 25.670810699 RELATED COMMANDS: ACOS(value) Arccosine (see page 253) ATAN(value) Arctangent (see page 282) COS(value) Cosine (see page 366) SIN(value) Sine (see page 700) TAN(value) Tangent (see page 736) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 279 of 909...
SAMP and RES are known (SAMP and RES can be reported from the terminal using the RSAMP and RRES commands, respectively). SAMP can change if the PID command is used. The value of RES can differ between motor models. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 280 of 909...
Page 281
PT=formula Position, (Absolute) Target (see page 658) RES Resolution (see page 670) SAMP Sampling Rate (see page 690) VT=formula Velocity Target (see page 788) X Decelerate to Stop (see page 804) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 281 of 909...
Although the floating-point variables and their standard binary operations conform to IEEE-754 double precision, the floating-point square root and trigonometric functions only produce IEEE-754 single-precision results. For more details, see Variables and Math on page 195. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 282 of 909...
Page 283
88.865577697 88.865577697 23.422260284 RELATED COMMANDS: ACOS(value) Arccosine (see page 253) ASIN(value) Arcsine (see page 278) COS(value) Cosine (see page 366) SIN(value) Sine (see page 700) TAN(value) Tangent (see page 736) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 283 of 909...
The value returned is a float, which can be assigned to a floating-point variable or an integer. EXAMPLE: ab[10]=50 ab[11]=51 ab[12]=48 ab[13]=46 ab[14]=49 ab[15]=0 af[0]=ATOF(10) Raf[0] Program output is: 230.099999999 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 284 of 909...
Page 285
Part 2: Commands: ATOF(index) RELATED COMMANDS: HEX(index) Decimal Value of a Hex String (see page 469) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 285 of 909...
SAMP and RES are known (SAMP and RES can be reported from the terminal using the RSAMP and RRES commands, respectively). SAMP can change if the PID command is used. The value of RES can differ between motor models. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 286 of 909...
Page 287
PTSD Position Target, Synchronized Distance (see page 663) PTSS(...) Position Target, Synchronized Supplemental (see page 664) PTST Position Target, Synchronized Time (see page 666) VTS=formula Velocity Target, Synchronized Move (see page 791) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 287 of 909...
DETAILED DESCRIPTION: The SmartMotor™ has 8, 16 and 32-bit arrays. The 16-bit array takes the form of the variables aw[index]. These are general-purpose, 16-bit signed integer variables that can be reported, used on either side of an equation, and can be mixed in an expression with variables other than 16-bit.
Page 289
In the equation cc=ab[4]-aw[7], both ab[4] and aw[7] are converted into 32-bit numbers before the subtraction occurs. In the SmartMotor language, all user variables are written as lowercase letters, while functions and commands have at least one uppercase character. The term "a" is a Moog Animatics SmartMotor™...
Page 290
All user variables are initialized to the value 0 at power up or on execution of the Z system-reset command. Other than by direct assignment, this is the only way the SmartMotor sets all of the user variables to 0. Issuing a RUN command does not perform this automatic initialization.
"word" is the word number and "bit" is the bit number. EXAMPLE: Check timer status B(4,0)==0 'Check Timer 0 status a=a+1 'Updating a every second TMR(0,1000) 'Set Timer 0 counting ENDIF Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 291 of 909...
Page 292
' For Class 5 Class 5 M-series 5.98.x.x or 5.97.x.x ' NOTE: Not a fault in D-series (((FW/65536)&255) == 98)|(((FW/65536)&255) == 97) IN(12) == 0 PRINT("Drive enable input low",#13) ENDIF Ba==1 ' Look for overcurrent fault PRINT("Overcurrent occurred",#13) ENDIF Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 292 of 909...
Page 293
' Look for Watchdog fault on supported motors ' NOTE: Not all firmware supports this notification PRINT("Watchdog",#13) ENDIF B(2,9)==1 ' Look for ADB (Animatics Data Block) fault ' If ADB is corrupt, motion is prevented PRINT("ADB checksum Fault",#13) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 293 of 909...
Page 294
' NOTE: This will print even if configured to not fault motor PRINT("ABS Battery Fault",#13) ENDIF ELSE ' The drive is ready for motion PRINT("Drive is ready!",#13) ENDIF RELATED COMMANDS: W(word) Report Specified Status Word (see page 793) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 294 of 909...
Page 295
COMBITRONIC: DETAILED DESCRIPTION: The SmartMotor™ firmware checks each PID Sample to see whether or not a peak overcurrent condition exists. The setpoint is in hardware and depends on the model motor and drive stage. If the setpoint is reached, the system flag Ba is to 1.
Page 296
Therefore, try lowering the acceleration value. If the flag is still set for every cycle, then the motor may be under sized for the application. For details on motor sizing, see the Moog Animatics Product Catalog. EXAMPLE: (Subcomponent of system check routine) 'If Peak overcurrent is detected PRINT("OVERCURRENT")
9600 bps. NOTE: SmartMotor commands like 0CADDR=... or 0ADDR=... with a leading number really send a corresponding address byte (i.e., "0", which is hex 80 or Moog Animatics SmartMotor™...
Page 298
'Set all local I/O as general-use inputs 'Clear errors BAUD115200 'Set baud rate of channel 0 to 115,200 RELATED COMMANDS: CAN, CAN(arg) CAN Bus Status (see page 352) CBAUD=formula CAN Baud Rate (see page 358) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 298 of 909...
Page 299
ZS command may not clear the Be bit. If you are unable to reset Be with the ZS command, issue an OFF command before issuing the ZS command, which clears the current commanded trajectory and allows the reset to complete. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 299 of 909...
Page 300
Z(word,bit) Reset Specified Status Bit (see page 808) Z Total CPU Reset (see page 806) Ze Reset Position Error Flag (see page 811) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 300 of 909...
Page 301
Celsius. If the temperature exceeds the TH value, the motor will turn off, and Bh will be set to 1. The SmartMotor will reject any motion command until the temperature has dropped below the trip point by 5 degrees Celsius (below 80 degrees Celsius).
Page 302
IF 'Check for position error PRINT("Position Error", #13) ENDIF IF 'Check for overtemp error PRINT("Overtemp Error",#13) ENDIF IF 'Check for overcurrent error PRINT("Overcurrent Error",#13) ENDIF RETURN 'Return to subroutine call Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 302 of 909...
Page 303
Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) Zh Reset Temperature Fault (see page 812) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 303 of 909...
The command RI(enc) reports the captured index reading. The Bi(0) bit is reset by any of the following: Power reset Z command (total reset of software) Z(1,2) command ZS command Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 304 of 909...
Page 305
ZS G WHILE Bi(0)==0 'Travel positive until index reached LOOP PT=I(0) 'Go back to index ENDIF MP ZS G 'Start motion TWAIT 'Wait till end of trajectory 'Set origin at index Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 305 of 909...
Page 306
W(word) Report Specified Status Word (see page 793) Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 306 of 909...
The command RJ(enc) reports the captured index reading. The Bj(0) bit is reset by any of the following: Power reset Z command (total reset of software) Z(1,3) command ZS command Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 307 of 909...
Page 308
When enabled through EIRI, the Bj(0) flag is set to 1 when a falling edge is seen at I/O pin 6. As a result, I/O pin 6 can be used to capture position for high-speed registration applications. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 308 of 909...
Page 309
W(word) Report Specified Status Word (see page 793) Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 309 of 909...
Page 310
You should not run the program in the SmartMotor™. This can occur if communications was lost or corrupted during a download of a program. Bk is reset to zero by a power reset or Z command, and a valid (pass) checksum is detected through RCKS.
Page 311
EILN command must be used to assign the pin’s function as a limit switch. The Bl bit is reset by any of the following: Power reset Z command (total reset of software) Z(0,13) command ZS command Zl command Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 311 of 909...
Page 312
Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) Zl Reset Historical Left Limit Flag (see page 813) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 312 of 909...
The real-time software left/negative limit flag is Bms, which only remains set to 1 while the motor is past the software limit. When Bms is set to 1, Bls is set to 1. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 313 of 909...
Page 314
Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) Zls Reset Left Software Limit Flag, Historical (see page 814) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 314 of 909...
Page 315
EIGN(3) command or as an output using the OUT(3)= command. To re-enable the left/negative hardware travel limit, issue the EILN command. EXAMPLE: PRINT("LEFT LIMIT PRESENTLY ACTIVE") ELSEIF PRINT("LEFT LIMIT PREVIOUSLY CONTACTED") ELSE PRINT("LEFT LIMIT NEVER REACHED") ENDIF Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 315 of 909...
Page 316
W(word) Report Specified Status Word (see page 793) Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 316 of 909...
SLE and SLD commands, respectively. EXAMPLE: PRINT("SOFTWARE LEFT LIMIT PRESENTLY ACTIVE") ELSEIF PRINT("SOFTWARE LEFT LIMIT PREVIOUSLY CONTACTED") ELSE PRINT("SOFTWARE LEFT LIMIT NEVER REACHED") ENDIF Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 317 of 909...
Page 318
W(word) Report Specified Status Word (see page 793) Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 318 of 909...
Page 319
COMBITRONIC: DETAILED DESCRIPTION: The Bo bit represents the SmartMotor™ drive stage state. When Bo is 0, the drive stage is on; when Bo is 1, the drive stage is off. Bo is set to 1 for any of the following conditions:...
Page 320
EIGN(2) command or as an output using the OUT(2)= command. To re-enable the right/positive software travel limit, issue the EILP command. EXAMPLE: PRINT("RIGHT LIMIT PRESENTLY ACTIVE") ELSEIF PRINT("RIGHT LIMIT PREVIOUSLY CONTACTED") ELSE PRINT("RIGHT LIMIT NEVER REACHED") ENDIF Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 320 of 909...
Page 321
W(word) Report Specified Status Word (see page 793) Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 321 of 909...
SLE and SLD commands, respectively. EXAMPLE: IF Brs PRINT("SOFTWARE RIGHT LIMIT PRESENTLY ACTIVE") ELSEIF Bps PRINT("SOFTWARE RIGHT LIMIT PREVIOUSLY CONTACTED") ELSE PRINT("SOFTWARE RIGHT LIMIT NEVER REACHED") ENDIF Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 322 of 909...
Page 323
W(word) Report Specified Status Word (see page 793) Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 323 of 909...
Page 324
It will be necessary to issue the EILP command to assign the pin’s function to being a limit switch for the pin to again elicit limit behavior, including the setting of Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 324 of 909...
Page 325
Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) Zr Reset Right Limit Flag, Historical (see page 815) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 325 of 909...
BREAK statement, the program would continue to execute into the next CASE, even if it is not true. EXAMPLE: SWITCH CASE PRINT("Hiya!",#13) CASE PRINT("Lo there!",#13) BREAK CASE PRINT("Me here!",#13) BREAK DEFAULT PRINT("Urp!",#13) BREAK ENDS Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 326 of 909...
Page 327
Part 2: Commands: BREAK If a=2, the SmartMotor™ will print "Lo there!" However, if a=1, the SmartMotor will print both "Hiya!" and "Lo there!" There is no BREAK statement to stop the program from running into case 2. The BREAK statement can always be replaced by a GOTO statement, and this is how it is actually executed using the precompiled program location.
CAUTION: It is important to turn the servo off when the brake is engaged. Otherwise, the motor could drive against the brake and overheat. When the SmartMotor™ powers up or comes out of a soft reset, the brake control is set to BRKSRV, by default, to automatically enforce this safety rule.
Page 329
BRKRLS Brake Release (see page 330) BRKSRV Brake Servo, Engage When Not Servoing (see page 332) BRKTRJ Brake Trajectory, Engage When No Active Trajectory (see page 334) EOBK(IO) Enable Output, Brake Control (see page 437) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 329 of 909...
CAUTION: It is important to turn the servo off when the brake is engaged. Otherwise, the motor could drive against the brake and overheat. When the SmartMotor™ powers up or comes out of a soft reset, the brake control is set to BRKSRV, by default, to automatically enforce this safety rule.
Page 331
BRKENG Brake Engage (see page 328) BRKSRV Brake Servo, Engage When Not Servoing (see page 332) BRKTRJ Brake Trajectory, Engage When No Active Trajectory (see page 334) EOBK(IO) Enable Output, Brake Control (see page 437) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 331 of 909...
CAUTION: It is important to turn the servo off when the brake is engaged. Otherwise, the motor could drive against the brake and overheat. When the SmartMotor™ powers up or comes out of a soft reset, the brake control is set to BRKSRV, by default, to automatically enforce this safety rule.
Page 333
BRKENG Brake Engage (see page 328) BRKRLS Brake Release (see page 330) BRKTRJ Brake Trajectory, Engage When No Active Trajectory (see page 334) EOBK(IO) Enable Output, Brake Control (see page 437) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 333 of 909...
DETAILED DESCRIPTION: The SmartMotor™ may be purchased with optional, internal, zero-backlash brakes, which are used to hold a load for safety purposes. They are fail-safe, magnetic-clutch, disk brakes. The default power-on state is to disengage the brake when the drive stage is turned on. When power is lost, the brake engages.
Page 335
BRKENG Brake Engage (see page 328) BRKRLS Brake Release (see page 330) BRKSRV Brake Servo, Engage When Not Servoing (see page 332) EOBK(IO) Enable Output, Brake Control (see page 437) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 335 of 909...
The real-time software right/positive limit flag is Bps, which only remains set to 1 while the motor is past the software limit. When Bps is set to 1, Brs is set to 1. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 336 of 909...
Page 337
Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) Zrs Reset Right Software Limit Flag, Historical (see page 816) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 337 of 909...
Page 338
Z command (total reset of software) Z(2,14) command ZS command Zs command EXAMPLE: Suppose the host should have transmitted ADT=100 but actually transmitted ADT=L00 due to noise in transmission. Bs would be set. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 338 of 909...
Page 339
Part 2: Commands: Bs PRINT("Syntax Error",#13) ENDIF RELATED COMMANDS: Z(word,bit) Reset Specified Status Bit (see page 808) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 339 of 909...
Page 340
Bt bit will be set to 1 and the motor shaft will not move. In other words, if ADT=0 and VT=0, then the motor shaft will not move, but the Bt bit will show a trajectory in progress. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 340 of 909...
Page 341
BRKTRJ Brake Trajectory, Engage When No Active Trajectory (see page 334) G Start Motion (GO) (see page 456) OFF Off (Drive Stage Power) (see page 605) X Decelerate to Stop (see page 804) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 341 of 909...
Page 342
The Bv bit is reset by any of the following methods: Power reset Z command (total reset of software) Z(0,7) command ZS command Zv command EXAMPLE: 'Subroutine C1 Bv==1 'If Bv (Velocity Limit) is true PRINT("VELOCITY LIMIT EXCEEDED",#13) ENDIF RETURN Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 342 of 909...
Page 343
Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) ZS Global Reset System State Flag (see page 818) Zv Reset Velocity Limit Fault (see page 821) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 343 of 909...
Page 344
32-bit position register. Specifically, the position has gone outside of the range -2147483648 to 2147483647. This does not mean that the SmartMotor™ has lost its position information — it is still tracking its position. The Bw bit can be set during any type of motion, it is not a fault and will not stop motion.
Page 345
Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) ZS Global Reset System State Flag (see page 818) Zw Reset Encoder Wrap Status Flag (see page 822) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 345 of 909...
Therefore, this function is mainly used to verify the exact position of the index. For other uses, it is more efficient to use the functions like Bi and I. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 346 of 909...
Page 347
'Wait until end of trajectory 'Set origin at index Bx(0) PRINT("On Index Pulse",#13) ENDIF RELATED COMMANDS: Bi(enc) Bit, Index Capture, Rising (see page 304) I(enc) Index, Rising-Edge Position (see page 471) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 347 of 909...
The program header is read whenever the SmartMotor™ powers up or is reset. This means that the SmartMotor knows how to jump to any label location, even if the program has never been run, and start executing the program from there. This is a common means of making a single program with several routines that can be invoked on demand from a host.
Page 349
PRINT("Routine 1",#13) PRINT("Routine 2",#13) To run routine 1, the host simply issues GOTO1 to the SmartMotor. If the host issues GOTO2, the motor runs routine 2. You can use a similar technique to allow the host to control where the program starts.
The PROFIBUS firmware will also use this to set/read the PROFIBUS address. The SmartMotor supports different protocols over the optional CAN port. CANopen and DeviceNet are popular industrial networks that use CAN. If a master is communicating to a group of SmartMotors as slaves under either of these standard protocols, the Combitronic protocol can still function, and it will not be detected by the CANopen or DeviceNet master.
Page 351
To set the SL17 SmartMotor to "auto address" (automatically assign the CAN address), use the following CADDR command: CADDR=-1 (CADDR=255 has the same effect.) Note that this setting is for the SL17 SmartMotor only; if used with any other motor, it will have no effect. To read the CAN address, use the following CADDR command: var=CADDR where var is any variable.
RCAN provides further detail about the error condition after the CAN error status bit is indicated in status word 2, bit 4. The SmartMotor supports different protocols over the optional CAN port. CANopen and DeviceNet are popular industrial networks that use CAN. If a master is communicating to a group of SmartMotors as slaves under either of these standard protocols, the Combitronic protocol can still function, and it will not be detected by the CANopen or DeviceNet master.
Page 353
CBAUD=formula where formula may be one of the following: 1000000, 800000, 500000, 250000, 125000, 50000 or 20000. Specific features are based on the fieldbus network being used. See the corresponding SmartMotor fieldbus guide for more details. EXAMPLE: 'Subroutine C1 CAN&16 'Test CAN word at value 16 (position 5) PRINT("USER TRIED COMBITRONIC READ FROM BROADCAST ADDRESS",#13)
DeviceNet stack depending on firmware type. Value is ignored. function = 5: Set timeout for Combitronic. Value is in milliseconds; the default is 30. Specific features are based on the fieldbus network being used. See the corresponding SmartMotor fieldbus guide for more details. EXAMPLE: EIGN(W,0)
ENDS of the SWITCH control block. BREAK can be used to isolate CASEs. Without BREAK, the CASE number syntax is transparent and program execution continues at the next instruction. That is, you will run into the next CASE number code sequence. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 355 of 909...
Page 356
BREAK ENDS The first line, SWITCH v, lets the SmartMotor™ know that it is checking the value of the variable v. Each following CASE begins the section of code that tells the SmartMotor what to do if v is equal to that case.
Page 357
BREAK Break from CASE or WHILE Loop (see page 326) DEFAULT Default Case for SWITCH Structure (see page 382) ENDS End SWITCH Structure (see page 435) SWITCH formula Switch, Program Flow Control (see page 727) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 357 of 909...
CBAUD= Set CAN baud rate. The SmartMotor supports different protocols over the optional CAN port. CANopen and DeviceNet are popular industrial networks that use CAN. If a master is communicating to a group of SmartMotors as slaves under either of these standard protocols, the Combitronic protocol can still function, and it will not be detected by the CANopen or DeviceNet master.
Page 359
CBAUD=1000000 'Set CAN network baud rate to 1,000,000 bps RELATED COMMANDS: CADDR=formula CAN Address (see page 350) CAN, CAN(arg) CAN Bus Status (see page 352) CANCTL(function,value) CAN Control (see page 354) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 359 of 909...
EIGN(W,0) 'Make all onboard I/O inputs 'Clear errors CCHN(RS2,0) 'Close main RS-232 communications port 0 RELATED COMMANDS: OCHN(...) Open Channel (see page 601) Z Total CPU Reset (see page 806) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 360 of 909...
COMBITRONIC: DETAILED DESCRIPTION: The read-only function, CHN, holds binary-code, historical error information for serial channels 0 or 1 on the SmartMotor™, which are specified as follows: CHN(0): Channel 0 communications error flag CHN(1): Channel 1 communications error flag The command gives the 5-bit status of either serial port channels 0 or 1, broken down as...
Page 362
PRINT("SERIAL ERROR !!") ENDIF RELATED COMMANDS: CCHN(type,channel) Close Communications Channel (RS-232 or RS-485) (see page 360) OCHN(...) Open Channel (see page 601) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 362 of 909...
EXAMPLE: This example uses code within a WHILE loop that executes during the pause. CLK=0 'Initialize clock WHILE CLK<1000 'Loop one sec LOOP RELATED COMMANDS: WAIT=formula Wait for Specified Time (see page 795) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 363 of 909...
0 at power-up. For example, COMCTL(4,10) will start loading DMX data at aw[10]. For more details on using the SmartMotor with the DMX protocol, see the Class 5 SmartMotor DMX Guide. Moog Animatics SmartMotor™ Developer's Guide, Rev. L...
Page 365
'Set start of array index storage (good for 'bypassing cam mode dynamic array). OCHN(DMX,1,N,250000,2,8,D) 'Open DMX channel: COM 1, no parity, '250 kBd, 2 stop, 8 data, datamode. RELATED COMMANDS: OCHN(...) Open Channel (see page 601) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 365 of 909...
However, the value will be truncated to fit to that integer type. For example, the assignment "aw[0]=" will drop any fractional amount and truncate the result to the range -32768 to 32767 (aw[0]=100.5 will report as 100, and aw[0]=40000.0 will report as -25536). Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 366 of 909...
Page 367
0.540240287 0.540240287 0.739631056 RELATED COMMANDS: ACOS(value) Arccosine (see page 253) ASIN(value) Arcsine (see page 278) ATAN(value) Arctangent (see page 282) SIN(value) Sine (see page 700) TAN(value) Tangent (see page 736) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 367 of 909...
Page 368
The number of segments is primarily limited by the amount of storage available in the Cam table. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 368 of 909...
Page 369
CTW(pos[,seglen][,user]) Cam Table Write Data Points (see page 377) MC Mode Cam (Electronic Camming) (see page 524) MCE(arg) Mode Cam Enable ( ) (see page 528) MCW(table,point) Mode Cam Where (Start Point) (see page 532) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 369 of 909...
Parameter 2 "Segment length": Specifies the master encoder distance between each point. If exp2 is set to 0, then the distance is specified per data record through the CTW command. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 370 of 909...
Page 371
CTW(pos[,seglen][,user]) Cam Table Write Data Points (see page 377) MC Mode Cam (Electronic Camming) (see page 524) MCE(arg) Mode Cam Enable ( ) (see page 528) MCW(table,point) Mode Cam Where (Start Point) (see page 532) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 371 of 909...
NOTE: The feature that allows partial erasure may not be available in future generations of motors. CTE(0) is not defined; therefore, it will not change the table in RAM memory. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 372 of 909...
Page 373
CTW(pos[,seglen][,user]) Cam Table Write Data Points (see page 377) MC Mode Cam (Electronic Camming) (see page 524) MCE(arg) Mode Cam Enable ( ) (see page 528) MCW(table,point) Mode Cam Where (Start Point) (see page 532) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 373 of 909...
MF0 and MS0 will both set CTR(1) to zero in addition to selecting the type of input (quadrature or step/direction, respectively). However, those commands will only have an effect in ENC0 mode (the default mode at power-up). Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 374 of 909...
Page 375
MFR Mode Follow Ratio (see page 570) MS0 Mode Step, Zero External Counter (see page 585) MSR Mode Step Ratio (see page 587) O=formula, O(trj#)=formula Origin (see page 597) OSH=formula, OSH(trj#)=formula Origin Shift (see page 611) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 375 of 909...
The first point of the table is kept at 0, which makes it easier to see that all of the data points are relative to that starting point. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 377 of 909...
Page 378
'Turn on Bit 0 Status Word 8 CTW(46000) 'Will turn off at this point CTW(45000,0,2) 'Turn on Bit 1 Status Word 8 CTW(8000) 'Will turn off at this point CTW(4000) CTW(500) CTW(0) 'CP=14 RETURN Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 378 of 909...
Page 379
CTT Cam Table Total in EEPROM (see page 376) MC Mode Cam (Electronic Camming) (see page 524) MCE(arg) Mode Cam Enable ( ) (see page 528) MCW(table,point) Mode Cam Where (Start Point) (see page 532) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 379 of 909...
As a result, applied current and torque will increase until that condition is met. By adding an additional derivative limit on following error, the servo will fault within milliseconds of contact with an object. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 380 of 909...
Page 381
VT=500000 'Velocity target ADT=50 'Accel/Decel target WHILE <32768 & Bt LOOP PRINT("Possible collision",#13) RELATED COMMANDS: DEL=formula Derivative Error Limit (see page 384) DELM(arg) Derivative Error Limit Mode (see page 386) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 381 of 909...
PRINT(" x = 1 ",#13) BREAK CASE PRINT(" x = 2 ",#13) BREAK CASE PRINT(" x = -23 ",#13) BREAK DEFAULT PRINT("x IS NOT 1, 2 OR -23",#13) BREAK ENDS Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 382 of 909...
Page 383
The first line, SWITCH x, tells the SmartMotor™ that it is checking the value of the variable x. The second line, CASE 1, begins the section of code that tells the SmartMotor what to do if x is equal to 1. Similarly, the eighth line, CASE 3, tells what to do if x=3. Finally, DEFAULT tells what to do if none of the CASEs match the value of x.
As a result, applied current and torque Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 384 of 909...
Page 385
RELATED COMMANDS: DEA Derivative Error, Actual (see page 380) DELM(arg) Derivative Error Limit Mode (see page 386) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 385 of 909...
'Set derivative error limit mode to 1 ELSE DELM(0) 'Otherwise, set to 0 ENDIF RELATED COMMANDS: DEA Derivative Error, Actual (see page 380) DEL=formula Derivative Error Limit (see page 384) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 386 of 909...
The 32-bit value output by this function is not the integer rounded off from the input. It is an encoded number that includes the exponent of the floating point value. The output of this function does not have any usefulness within the SmartMotor programming language. EXAMPLE: af[0]=(a+b)/3.0...
NOTE: The user program must also be running for interrupts to take effect, the END and RUN commands will reset the state of the interrupts to defaults. For more details on interrupt programming, see Interrupt Programming on page 192. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 388 of 909...
Page 389
EITR(int) Enable Interrupts (see page 417) ITR(Int#,StatusWord,Bit#,BitState,Label#) Interrupt Setup (see page 486) ITRD Interrupt Disable, Global (see page 489) ITRE Enable Interrupts, Global (see page 491) RETURNI Return Interrupt (see page 676) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 389 of 909...
SAMP and RES are known (SAMP and RES can be reported from the terminal using the RSAMP and RRES commands, respectively). SAMP can change if the PID command is used. The value of RES can differ between motor models. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 390 of 909...
Page 391
PT=formula Position, (Absolute) Target (see page 658) RES Resolution (see page 670) SAMP Sampling Rate (see page 690) VT=formula Velocity Target (see page 788) X Decelerate to Stop (see page 804) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 391 of 909...
SAMP and RES are known (SAMP and RES can be reported from the terminal using the RSAMP and RRES commands, respectively). SAMP can change if the PID command is used. The value of RES can differ between motor models. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 392 of 909...
Page 393
PTSD Position Target, Synchronized Distance (see page 663) PTSS(...) Position Target, Synchronized Supplemental (see page 664) PTST Position Target, Synchronized Time (see page 666) VTS=formula Velocity Target, Synchronized Move (see page 791) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 393 of 909...
Page 394
EA may be positive or negative. EXAMPLE: EA<1234 'test value of EA 'then do something ENDIF WHILE EA<1234 LOOP 'Loop while EA is less than 1234 'Then continue with program Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 394 of 909...
Page 395
'Set target position to be home 'Start motion TWAIT 'Wait for motion to complete AMPS=1023 'Restore current limit to maximum 'End program RELATED COMMANDS: EL=formula Error Limit (see page 419) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 395 of 909...
COMBITRONIC: DETAILED DESCRIPTION: The ECHO command causes the SmartMotor™ to retransmit (or echo out) all serial bytes on the transmit line that were received on the receive line of COM port 0. This retransmission occurs when the SmartMotor reads these bytes from the buffer, regardless of whether these bytes are command or individual data bytes.
Page 397
ECHO1 Echo Incoming Data on Communications Port 1 (see page 399) ECHO_OFF Turn Off Echo on Communications Port 0 (see page 400) ECHO_OFF1 Turn Off Echo on Communications Port 1 (see page 402) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 397 of 909...
COMBITRONIC: DETAILED DESCRIPTION: The ECHO0 command causes the SmartMotor™ to retransmit (or echo out) all serial bytes on the transmit line that were received on the receive line of COM port 0. This retransmission occurs when the SmartMotor reads these bytes from the buffer, regardless of whether these bytes are command or individual data bytes.
COMBITRONIC: DETAILED DESCRIPTION: The ECHO1 command causes the SmartMotor™ to retransmit (or echo out) all serial bytes on the transmit line that were received on the receive line of COM port 1. This retransmission occurs when the SmartMotor reads these bytes from the buffer, regardless of whether these bytes are command or individual data bytes.
5.x and later COMBITRONIC: DETAILED DESCRIPTION: The ECHO_OFF command causes the SmartMotor™ channel 0 COM port to stop echoing. This is the default power-up state of any SmartMotor. No incoming channel 0 characters are retransmitted. In order to automatically detect and differentiate between multiple motors on a serial daisy- chain cable, the ECHO state can be alternately turned on and off to ensure the motors are properly addressed.
FIRMWARE VERSION: 5.x and later COMBITRONIC: DETAILED DESCRIPTION: The ECHO_OFF0 command causes the SmartMotor™ channel 0 serial port to stop echoing. No incoming channel 0 characters are retransmitted. EXAMPLE: (Shows use of ECHO_OFF0 and OCHN) EIGN(W,0) 'Make all onboard I/O inputs...
FIRMWARE VERSION: 5.x and later COMBITRONIC: DETAILED DESCRIPTION: The ECHO_OFF1 command causes the SmartMotor™ channel 1 serial port to stop echoing. No incoming channel 1 characters are retransmitted. EXAMPLE: (Shows use of ECHO_OFF1 and OCHN) EIGN(W,0) 'Make all onboard I/O inputs...
This command works on top of any gear or Cam mode. It should be used with care because it can cause abrupt changes to position. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 403 of 909...
Page 404
MFH(distance[,m/s]) Mode Follow, High Ascend/Descend Rate (see page 560) MFHTP=formula Mode Follow, High Traverse Point (see page 562) MFL(distance[,m/s]) Mode Follow, Low Ascend/Descend Rate (see page 564) MFLTP=formula Mode Follow, Low Traverse Point (see page 566) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 404 of 909...
See the following table for allowed values for "word" and for the mask range. NOTE: The range of IO and word depends on the motor series: Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 405 of 909...
Page 406
'Set User port 2 as Input EIGN(3) 'Set User port 3 as Input EIGN(4) 'Set User port 4 as Input EIGN(5) 'Set User port 5 as Input EIGN(6) 'Set User port 6 as Input Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 406 of 909...
Page 407
EOBK(IO) Enable Output, Brake Control (see page 437) IN(...) Specified Input (see page 478) INA(...) Specified Input, Analog (see page 481) SLD Software Limits, Disable (see page 702) SLE Software Limits, Enable (see page 704) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 407 of 909...
EXAMPLE: (Subroutine enables negative hardware limit) PRINT("Enter c=1 to enable negative HW limit...",#13) WHILE c==0 LOOP 'Wait for user to change variable c EILN 'Enable negative hardware limit PRINT("Negative HW limit enabled!",#13) RETURN Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 408 of 909...
Page 409
EISM(6) E-Configure Input as Sync Master (see page 416) EOBK(IO) Enable Output, Brake Control (see page 437) OR(value) Output, Reset (see page 607) OS(...) Output, Set (see page 609) OUT(...)=formula Output, Activate/Deactivate (see page 613) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 409 of 909...
EXAMPLE: (Subroutine enables positive hardware limit) PRINT("Enter c=1 to enable positive HW limit...",#13) WHILE c==0 LOOP 'Wait for user to change variable c EILP 'Enable positive hardware limit PRINT("Positive HW limit enabled!",#13) RETURN Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 410 of 909...
Page 411
EISM(6) E-Configure Input as Sync Master (see page 416) EOBK(IO) Enable Output, Brake Control (see page 437) OR(value) Output, Reset (see page 607) OS(...) Output, Set (see page 609) OUT(...)=formula Output, Activate/Deactivate (see page 613) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 411 of 909...
Class 5 M-style motors use I/O logical input 5 (pin 4 of the 12-pin I/O connector) Class 6 M-style motors use I/O logical input 4 (pin 5 of the 12-pin I/O connector) Refer to the following figure for more details. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 412 of 909...
Page 413
EIGN(...) Enable as Input for General-Use (see page 405) EIRI Enable Index Register, Internal-Input Capture (see page 414) I(enc) Index, Rising-Edge Position (see page 471) J(enc) Index, Falling-Edge Position (see page 493) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 413 of 909...
Class 5 M-style motors use I/O logical input 5 (pin 4 of the 12-pin I/O connector) Class 6 M-style motors use I/O logical input 5 (pin 6 of the 12-pin I/O connector) Refer to the following figure for more details. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 414 of 909...
Page 415
EIRE Enable Index Register, External-Input Capture (see page 412) EIGN(...) Enable as Input for General-Use (see page 405) I(enc) Index, Rising-Edge Position (see page 471) J(enc) Index, Falling-Edge Position (see page 493) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 415 of 909...
ADT=100 'Set accel/decel VT=100000 'Set target velocity WHILE LOOP 'Hold program here RELATED COMMANDS: EIGN(...) Enable as Input for General-Use (see page 405) G Start Motion (GO) (see page 456) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 416 of 909...
NOTE: The user program must also be running for interrupts to take effect, the END and RUN commands will reset the state of the interrupts to defaults. For more details on interrupt programming, see Interrupt Programming on page 192. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 417 of 909...
Page 418
EISM(6) E-Configure Input as Sync Master (see page 416) ITR(Int#,StatusWord,Bit#,BitState,Label#) Interrupt Setup (see page 486) ITRD Interrupt Disable, Global (see page 489) ITRE Enable Interrupts, Global (see page 491) RETURNI Return Interrupt (see page 676) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 418 of 909...
Position error is the difference between the calculated trajectory position (PC), at any instant in time, and the actual position (PA). The SmartMotor™ uses the position error to generate a torque by means of the PID filter. The greater the error or deflection, the more torque the motor applies in attempt to correct it.
Page 420
G Start Motion (GO) (see page 456) MP Mode Position (see page 582) MV Mode Velocity (see page 593) PA Position, Actual (see page 615) PC, PC(axis) Position, Commanded (see page 619) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 420 of 909...
As illustrated in the following example, an IF formula can be used when you want the SmartMotor™ to do one thing if the variable g=43 and another if it does not equal that value.
Page 422
'Some subroutine code here RELATED COMMANDS: ELSEIF formula IF-Structure Command Flow Element (see page 423) ENDIF End IF Statement (see page 433) IF formula Conditional Program Code Execution (see page 475) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 422 of 909...
An IF formula's control block may optionally include any number of ELSEIF formulas to perform multiple evaluations in a specified order. For example, ELSEIF would be used when you want the SmartMotor™ to do one thing if the variable g=43, another if g=43000, and another if g=-2.
Page 424
GOSUB4 ELSE GOSUB5 ENDIF RELATED COMMANDS: ELSE IF-Structure Command Flow Element (see page 421) ENDIF End IF Statement (see page 433) IF formula Conditional Program Code Execution (see page 475) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 424 of 909...
The SmartMotor™ can accept inputs from either the internal integrated encoder or an external source. ENC0 causes the SmartMotor to read its position from the internal encoder; ENC1 uses the secondary (external) encoder. When ENC0 is active, PA (position actual) will track the internal encoder.
The SmartMotor™ can accept position information from either the internal integrated encoder or an external source. The ENC1 command will cause the SmartMotor to servo from the secondary (external) encoder channel instead of the internal encoder. When ENC1 is active, PA (Position Actual) will track the external encoder.
Page 427
ENCD(in_out) Set Encoder Bus Port as Input or Output (see page 430) MS0 Mode Step, Zero External Counter (see page 585) MF0 Mode Follow, Zero External Counter (see page 548) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 427 of 909...
This command requires the absolute encoder option for the M-style motor. It does not apply to the typical optical incremental encoder found in most SmartMotors. NOTE: The D-style motor does not offer an ABS option. Refer to the following table for details. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 428 of 909...
Page 429
*Requires the absolute encoder option for the M-style motor. EXAMPLE: EIGN(W,0) 'Make all onboard I/O inputs 'Clear errors ENCCTL(0,0) 'Set absolute encoder to zero RELATED COMMANDS: ENCD(in_out) Set Encoder Bus Port as Input or Output (see page 430) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 429 of 909...
5.97.x or 5.98.x series only COMBITRONIC: DETAILED DESCRIPTION: The M-style SmartMotor™ is equipped with a bidirectional Encoder Bus port, which can be configured as an input or an output for use as a slave or master, respectively, in an "electronic line shaft" configuration.
Page 431
For more details, see the SMI software's online help file, which can be accessed from the Help menu or by pressing the F1 key. EXAMPLE: END ENDIF 'Terminate user program 'on position error Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 431 of 909...
Page 432
RELATED COMMANDS: RCKS Report Checksum (see page 669) RUN Run Program (see page 682) RUN? Halt Program Execution Until RUN Received (see page 684) Z Total CPU Reset (see page 806) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 432 of 909...
Processing an ELSE clause and encountering ENDIF All IF and ELSEIF formulas are false, and there is no ELSE clause ENDIF is not a valid terminal command; it is only valid within a user program. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 433 of 909...
Page 434
PRINT("FALSE") ENDIF RELATED COMMANDS: ELSE IF-Structure Command Flow Element (see page 421) ELSEIF formula IF-Structure Command Flow Element (see page 423) IF formula Conditional Program Code Execution (see page 475) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 434 of 909...
ENDS is not a valid terminal command; it is only valid within a user program. EXAMPLE: SWITCH CASE 1 PRINT("x=1",#13) BREAK CASE 2 PRINT("x=2",#13) BREAK CASE 3 PRINT("x=3",#13) BREAK ENDS 'This is the exit point for SWITCH...ENDS code block Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 435 of 909...
Page 436
BREAK Break from CASE or WHILE Loop (see page 326) CASE formula Case Label for SWITCH Block (see page 355) DEFAULT Default Case for SWITCH Structure (see page 382) SWITCH formula Switch, Program Flow Control (see page 727) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 436 of 909...
I/O port pin. EOBK(-1) disables the brake output from any I/O pin. The logic state follows the current brake-control method (i.e., BRKRLS, BRKENG, BRKSRV or BRKTRJ). Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 437 of 909...
Page 438
BRKENG Brake Engage (see page 328) BRKRLS Brake Release (see page 330) BRKSRV Brake Servo, Engage When Not Servoing (see page 332) BRKTRJ Brake Trajectory, Engage When No Active Trajectory (see page 334) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 438 of 909...
EXAMPLE: (enabling and disabling) EOIDX(6) 'Enable for an SM23165D motor EOIDX(-1) 'Disable RELATED COMMANDS: EIRE Enable Index Register, External-Input Capture (see page 412) EIRI Enable Index Register, Internal-Input Capture (see page 414) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 439 of 909...
The ERRC command reports the most recent command error. Command errors originate from SmartMotor commands through a user program, serial port or command encapsulation such as CANopen object 2500h. The command error bit status word 2, bit 14 will be indicated when a new error has occurred.
Page 442
ERRC may be used in SWITCH CASE code: SWITCH ERRC CASE PRINT("BAD_ARGUMENT",#13) BREAK CASE PRINT("DIVIDE_BY_ZERO",#13) BREAK ENDS RELATED COMMANDS: ERRW Communication Channel of Most Recent Command Error (see page 443) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 442 of 909...
DETAILED DESCRIPTION: The ERRW command reports the command source of the most recent command error. Command errors originate from SmartMotor commands through a user program, serial port or command encapsulation such as CANopen object 2500h. The command error bit status word 2, bit 14 will be indicated when a new error has occurred.
Assign the result to a program variable: x=ETH(arg) As a report: RETH(arg) Specific features are based on the fieldbus network being used. See the corresponding SmartMotor fieldbus guide for more details. EXAMPLE: x=ETH(0) 'Get the Ethernet status and assign it to x.
ETHCTL command, the Ethernet error codes will be checked to determine the state of Object 2304h, sub-index 3, bit 6 (Ethernet error). Specific features are based on the fieldbus network being used. See the corresponding SmartMotor fieldbus guide for more details. EXAMPLE: ETHCTL(13,0)
Page 446
EXAMPLE: KP=100 'Initialize KP to a some value 'Load into present PID filter 'Start motion WAIT=40000 KP=KP+10 'Increment the present KP gain value 'Change into filter Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 446 of 909...
Page 447
KL=formula Constant, Integral Limit (see page 504) KP=formula Constant, Proportional Coefficient (see page 506) KS=formula Constant, Velocity Filter Option (for KD) (see page 509) KV=formula Constant, Velocity Feed Forward (see page 511) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 447 of 909...
However, the value will be truncated to fit to that integer type. For example, the assignment "aw[0]=" will drop any fractional amount and truncate the result to the range -32768 to 32767 (aw[0]=100.5 will report as 100, and aw[0]=40000.0 will report as -25536). Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 448 of 909...
Page 449
'Set array variable = FABS(-5.545) PRINT(af[0],#13) 'Print value of array variable af[0] RFABS(-5.545) 'Report FABS(-5.545) Program output is: 5.545000076 5.545000076 RELATED COMMANDS: ABS(value) Absolute Value of () (see page 248) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 449 of 909...
2 - Soft limit faults action: specifies the desired action: 0 - Default action (MTB) 1 - Servo off 2 - X command 3 - Hard stop (6.0.x.x firmware only) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 450 of 909...
Page 451
'Hardware Travel Limit Faults: servo will turn off. FSA(1,2) 'Hardware Travel Limit Faults: servo will decelerate to 'stop with "X" command. RELATED COMMANDS: MTB Mode Torque Brake (see page 591) X Decelerate to Stop (see page 804) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 451 of 909...
(aw[0]=100.5 will report as 100, and aw[0]=40000.0 will report as -25536). Although the floating-point variables and their standard binary operations conform to IEEE-754 double precision, the floating-point square root and trigonometric functions only Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 452 of 909...
Page 453
'Set array variable af[3] = FSQRT(a) RFSQRT(a) PRINT(af[0],", ",af[1],", ",af[2],", ",af[3],#13) 'Print variable values Program output is: 2.000000000 2.549509763 2.915475845 3.000000000 2.000000000, 2.549509763, 2.915475845, 3.000000000 RELATED COMMANDS: SQRT(value) Integer Square Root (see page 718) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 453 of 909...
Page 454
The resulting number in decimal format is 83886892. EXAMPLE: PRINT(FW,#13) 'Print the motor firmware version as a long 'Report the motor firmware version as a long Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 454 of 909...
Page 455
Part 2: Commands: FW Program output is: 83886892 83886892 RELATED COMMANDS: SP2 Bootloader Revision (see page 717) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 455 of 909...
Page 456
Change to a new Velocity in Mode Position (MP) or Mode Velocity (MV): VT=10000 ADT=100 G WAIT=1000 VT=VT*2 Change to a new Acceleration in Mode Position (MP) or Mode Velocity ( MV): VT=10000 ADT=100 G WAIT=1000 ADT=200 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 456 of 909...
Page 457
Motor has no connections to limit switch inputs on boot-up and, therefore, has a travel-limit fault Drive enable is not asserted (M-style only) Bus voltage is too high or too low Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 457 of 909...
Page 458
MP Mode Position (see page 582) MV Mode Velocity (see page 593) PRT=formula Position, Relative Target (see page 652) PT=formula Position, (Absolute) Target (see page 658) VT=formula Velocity Target (see page 788) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 458 of 909...
Therefore, during development, prevent this by using the RUN? command at the start of each program. NOTE: If you get locked out and are unable to communicate with the SmartMotor, you may be able to recover communications using the SMI software's Communication Lockup Wizard.
Page 460
LEN Length of Character Count in Communications Port 0 (see page 513) LEN1 Length of Character Count in Communications Port 1 (see page 514) OCHN(...) Open Channel (see page 601) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 460 of 909...
Therefore, during development, prevent this by using the RUN? command at the start of each program. NOTE: If you get locked out and are unable to communicate with the SmartMotor, you may be able to recover communications using the SMI software's Communication Lockup Wizard.
Page 462
LEN Length of Character Count in Communications Port 0 (see page 513) LEN1 Length of Character Count in Communications Port 1 (see page 514) OCHN(...) Open Channel (see page 601) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 462 of 909...
RETURN before the next GOSUB. The GOSUB command is valid from both serial channels and within a user program. There are three forms of the command that are valid: Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 463 of 909...
Page 464
GOSUB30 can also be issued from the terminal. RELATED COMMANDS: C{number} Command Label (see page 348) GOTO(label) Branch Program Flow to a Label (see page 465) STACK Stack Pointer Register, Clear (see page 722) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 464 of 909...
The GOTO{number} command is valid for both serial channels and within a user program. However, take care not to issue a GOTO{number} command unless the corresponding C {number} label exists within the stored program. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 465 of 909...
Page 466
BREAK Break from CASE or WHILE Loop (see page 326) C{number} Command Label (see page 348) DEFAULT Default Case for SWITCH Structure (see page 382) ELSE IF-Structure Command Flow Element (see page 421) GOSUB(label) Subroutine Call (see page 463) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 466 of 909...
Page 467
Combitronic syntax — that is because this command is intended to be called on the master within the group of motors. Combitronic communications will automatically be sent to the network so that participating motors will receive this command. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 467 of 909...
Page 468
PTSD Position Target, Synchronized Distance (see page 663) PTSS(...) Position Target, Synchronized Supplemental (see page 664) PTST Position Target, Synchronized Time (see page 666) VTS=formula Velocity Target, Synchronized Move (see page 791) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 468 of 909...
The string must be stored with the most significant hex digit at the beginning. In this example, ab[10] is the most significant digit, and ab[17] is the least significant digit. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 469 of 909...
Page 470
'Report x command Program output is: 5862 RELATED COMMANDS: ATOF(index) ASCII to Float (see page 284) DFS(value) Dump Float, Single (see page 387) LFS(value) Load Float Single (see page 516) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 470 of 909...
6. The internal or external encoder can use this source through the EIRI and EIRE commands, respectively. When using this method, the previously-stated rules for arming and clearing the index still apply. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 471 of 909...
Page 472
Bi(enc) Bit, Index Capture, Rising (see page 304) Bx(enc) Bit, Index Input, Real-Time (see page 346) EIRE Enable Index Register, External-Input Capture (see page 412) EIRI Enable Index Register, Internal-Input Capture (see page 414) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 472 of 909...
COMBITRONIC: DETAILED DESCRIPTION: The IDENT command gets (reads) and sets the identification value for a SmartMotor. It doesn’t have any effect on the motor — it’s just a non-volatile ID that is preserved between power cycles. It allows a SmartMotor's user program to self-detect its designated purpose according to the programmer's setting of IDENT on that motor.
Page 474
Part 2: Commands: IDENT=formula RELATED COMMANDS: IDENT=formula Set Identification Value (see page 473) IF formula Conditional Program Code Execution (see page 475) SWITCH formula Switch, Program Flow Control (see page 727) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 474 of 909...
If the result of formula is 0, then it is considered false and execution skips the code following IF formula. When false, execution skips to the next available ELSE, ELSEIF or ENDIF command. The following table shows various forms of IF formulas and their descriptions: Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 475 of 909...
Page 476
'If Position equals zero PRINT("position is at zero",#13) ENDIF 'This is the next line of code to be executed 'even if position is not at zero and 'not greater than 12345. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 476 of 909...
Page 477
PRINT("This is true",#13) ENDIF RELATED COMMANDS: ELSE IF-Structure Command Flow Element (see page 421) ELSEIF formula IF-Structure Command Flow Element (see page 423) ENDIF End IF Statement (see page 433) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 477 of 909...
(equivalent to using the & operator on the result). See the following table for the allowed values for "word", the output word value range, and the bitmask range. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 478 of 909...
Page 479
7 is on. For more details on Status Word 16, see Status Word: 16 On Board Local I/O Status: M-Style Motor on page 886. For details on the RIN(W,0) command, see the Detailed Description section of this topic. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 479 of 909...
Page 480
OS(...) Output, Set (see page 609) OUT(...)=formula Output, Activate/Deactivate (see page 613) UO(...)=formula User Status Bits (see page 756) UR(...) User Bits, Reset (see page 762) US(...) User Bits, Set (see page 764) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 480 of 909...
VDC) for a given I/O (defined by IO) that is assigned to the variable x. Only applies to inputs 16-25 on the D-style motor with AD1 option, or inputs 0-10 on an M-style motor. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 481 of 909...
Page 483
'Pause before next read GOTO10 'Loop back to label 'Required END (never reached) RELATED COMMANDS: IN(...) Specified Input (see page 478) OC(...) Output Condition (see page 599) OF(...) Output Fault (see page 603) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 483 of 909...
"string" is formatted as an IP address and entered as a string Specific features are based on the fieldbus network being used. See the corresponding SmartMotor fieldbus guide for more details. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 484 of 909...
Page 485
EXAMPLE: (Set a static IP address) IPCTL(0,"192.168.0.10") 'Set the IP address to 192.168.0.10 RELATED COMMANDS: SNAME("string") Set PROFINET Station Name (see page 716) ETHCTL(function,value) Control Industrial Ethernet Network Features (see page 445) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 485 of 909...
This will halt the main loop of the program but will leave the interrupts active. To understand where the PAUSE command will continue on with the main program, see RESUME on page 672. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 486 of 909...
Page 487
'braking, tell other motors to stop. US(0):0 'Set User Status Bit 0 to 1 (Status 'Word 12 bit zero) US(ADDR):0 'Set User Status Bit "address" to 1 '(Status Word 12 Bit "address") RETURNI Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 487 of 909...
Page 488
ITRE Enable Interrupts, Global (see page 491) PAUSE Pause Program Execution (see page 617) RESUME Resume Program Execution (see page 672) RETURNI Return Interrupt (see page 676) RUN Run Program (see page 682) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 488 of 909...
NOTE: The user program must also be running for interrupts to take effect, the END and RUN commands will reset the state of the interrupts to defaults. For more details, see Interrupt Programming on page 192. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 489 of 909...
Page 490
ITRE Enable Interrupts, Global (see page 491) PAUSE Pause Program Execution (see page 617) RESUME Resume Program Execution (see page 672) RETURNI Return Interrupt (see page 676) RUN Run Program (see page 682) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 490 of 909...
NOTE: The user program must also be running for interrupts to take effect, the END and RUN commands will reset the state of the interrupts to defaults. For more details, see Interrupt Programming on page 192. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 491 of 909...
Page 492
ITRD Interrupt Disable, Global (see page 489) PAUSE Pause Program Execution (see page 617) RESUME Resume Program Execution (see page 672) RETURNI Return Interrupt (see page 676) RUN Run Program (see page 682) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 492 of 909...
6. The internal or external encoder can use this source through the EIRI and EIRE commands, respectively. When using this method, the previously-stated rules for arming and clearing the index still apply. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 493 of 909...
Page 494
Bi(enc) Bit, Index Capture, Rising (see page 304) Bx(enc) Bit, Index Input, Real-Time (see page 346) EIRE Enable Index Register, External-Input Capture (see page 412) EIRI Enable Index Register, Internal-Input Capture (see page 414) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 494 of 909...
Therefore, if you think that modifying KA could be useful, use the SMI software Tuner tool for assistance. EXAMPLE: KA=200 'Set buffered acceleration feed forward 'Update PID filter Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 495 of 909...
Page 496
KL=formula Constant, Integral Limit (see page 504) KP=formula Constant, Proportional Coefficient (see page 506) KS=formula Constant, Velocity Filter Option (for KD) (see page 509) KV=formula Constant, Velocity Feed Forward (see page 511) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 496 of 909...
Typically, a KD value of approximately ten times KP is a good starting point when KP<300. The SMI software Tuner tool can be useful in finding the optimum setting. EXAMPLE: KD=2000 'Set buffered derivative gain 'Update PID filter Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 497 of 909...
Page 498
KL=formula Constant, Integral Limit (see page 504) KP=formula Constant, Proportional Coefficient (see page 506) KS=formula Constant, Velocity Filter Option (for KD) (see page 509) KV=formula Constant, Velocity Feed Forward (see page 511) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 498 of 909...
However, extremely high values will cause rapid pulse-width modulation (PWM) saturation, which results in uncontrollable servo behavior. EXAMPLE: KG=1000000 'Set buffered gravity term 'Update PID filter RELATED COMMANDS: KA=formula Constant, Acceleration Feed Forward (see page 495) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 499 of 909...
Page 500
KL=formula Constant, Integral Limit (see page 504) KP=formula Constant, Proportional Coefficient (see page 506) KS=formula Constant, Velocity Filter Option (for KD) (see page 509) KV=formula Constant, Velocity Feed Forward (see page 511) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 500 of 909...
Therefore, when tuning your motor for stability, it is a good idea to set KI to zero and then increase it until you see that it reliably compensates your system. NOTE: KL, the protective upper limit, must be set high enough to allow KI to do its job. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 501 of 909...
Page 502
KL=formula Constant, Integral Limit (see page 504) KP=formula Constant, Proportional Coefficient (see page 506) KS=formula Constant, Velocity Filter Option (for KD) (see page 509) KV=formula Constant, Velocity Feed Forward (see page 511) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 502 of 909...
'Set proportional gain for MDC mode KII=1500 'Set integral gain for MDC mode 'Initiate gains 'Change to Current mode commutation RELATED COMMANDS: KPI=formula Current Control Loop: Proportional (see page 508) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 503 of 909...
MDT, MDE and MDS. Therefore, the position error (EA) may become larger as speed increases. EXAMPLE: KL=1500 'Set buffered integral limit 'Update PID filter RELATED COMMANDS: KA=formula Constant, Acceleration Feed Forward (see page 495) KD=formula Constant, Derivative Coefficient (see page 497) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 504 of 909...
Page 505
KI=formula Constant, Integral Coefficient (see page 501) KP=formula Constant, Proportional Coefficient (see page 506) KS=formula Constant, Velocity Filter Option (for KD) (see page 509) KV=formula Constant, Velocity Feed Forward (see page 511) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 505 of 909...
KD value (for details, see KD=formula on page 497). However, if moving the KD value up or down does not stabilize the servo, then the KP value is too high and must be reduced. EXAMPLE: KP=250 'Set buffered proportional gain 'Update PID filter Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 506 of 909...
Page 507
KI=formula Constant, Integral Coefficient (see page 501) KL=formula Constant, Integral Limit (see page 504) KS=formula Constant, Velocity Filter Option (for KD) (see page 509) KV=formula Constant, Velocity Feed Forward (see page 511) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 507 of 909...
'Set proportional gain for MDC mode KII=1500 'Set integral gain for MDC mode 'Initiate gains 'Change to Current mode commutation RELATED COMMANDS: KII=formula Current Control Loop: Integrator (see page 503) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 508 of 909...
To smooth this out, the quantity can be averaged. The KS value controls the amount of filtering applied. Refer to the following table. Filter Sample Length Notes Value (PID Samples) No filtering Default Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 509 of 909...
Page 510
Part 2: Commands: KS=formula Adjusting the filter will sometimes allow the SmartMotor™ to handle inertial ratios in excess of the traditional 5:1 or 10:1 ratios. This "reflected load to rotor inertia" ratio is often cited as a traditional limit for dependable servo motor applications.
KP and KI are still required, but the KV term will help improve responsiveness. If you put the SmartMotor™ into a high-velocity move with KI=0 and monitor the position error with the Motor View tool's Status tab in the SMI software, then you will see a constant position error.
Page 512
KI=formula Constant, Integral Coefficient (see page 501) KL=formula Constant, Integral Limit (see page 504) KP=formula Constant, Proportional Coefficient (see page 506) KS=formula Constant, Velocity Filter Option (for KD) (see page 509) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 512 of 909...
GETCHR Next Character from Communications Port 0 (see page 459) GETCHR1 Next Character from Communications Port 1 (see page 461) LEN1 Length of Character Count in Communications Port 1 (see page 514) OCHN(...) Open Channel (see page 601) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 513 of 909...
GOSUB5 'If so, process data ENDIF ab[i]=GETCHR1 'Read and store in data 'Process incoming data i=i+1 'Maintain reference index RETURN From the above example, "i" will be equal to LEN1. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 514 of 909...
Page 515
GETCHR Next Character from Communications Port 0 (see page 459) GETCHR1 Next Character from Communications Port 1 (see page 461) LEN Length of Character Count in Communications Port 0 (see page 513) OCHN(...) Open Channel (see page 601) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 515 of 909...
LFS() is directed to DFS(). For details on DFS(), see DFS(value) on page 387. EXAMPLE: al[0]=1162934955 '4 byte value in IEEE-754 format af[0]=LFS(al[0]) 'Convert from IEEE-754 to float Raf[0] 'Report value of float Program output is: 3343.666748046 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 516 of 909...
Page 517
Part 2: Commands: LFS(value) RELATED COMMANDS: af[index]=formula Array Float [index] (see page 261) DFS(value) Dump Float, Single (see page 387) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 517 of 909...
EEPROM in the SmartMotor. The LOAD command causes a SmartMotor to load all incoming host communications into program memory up to the first occurrence of ASCII character 255. Program sizes can be as great as 32 KB. This command is mainly used by host utilities, which also compile the program before download.
Page 519
Therefore, the saved file will not work, and the carriage returns must be removed before downloading the file to the motor. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 519 of 909...
Page 520
RUN Run Program (see page 682) RUN? Halt Program Execution Until RUN Received (see page 684) UP Upload Compiled Program and Header (see page 758) UPLOAD Upload Standard User Program (see page 760) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 520 of 909...
'Issued through serial port only, do not use within a program. 'Requires a motor reboot to take effect. RELATED COMMANDS: UP Upload Compiled Program and Header (see page 758) UPLOAD Upload Standard User Program (see page 760) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 521 of 909...
LOOP is not a valid terminal command. It is only valid within a user program. BREAK can be used to exit the WHILE loop. EXAMPLE: WHILE b<5 PRINT(#13,"b=",b) b=b+1 LOOP PRINT(#13,"Exit Loop") The previous code outputs: Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 522 of 909...
Page 523
Part 2: Commands: LOOP Exit Loop RELATED COMMANDS: BREAK Break from CASE or WHILE Loop (see page 326) WHILE formula While Condition Program Flow Control (see page 801) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 523 of 909...
Page 524
DETAILED DESCRIPTION: The MC command puts the SmartMotor™ into Cam mode, which causes the motor to follow a predetermined profile according to an external encoder source. To set up a Cam operation, you must also specify position data and initialize it to the master source (either an external or internal timer).
Page 525
MCW(table,point) Mode Cam Where (Start Point) (see page 532) ECS(counts) Encoder Count Shift (see page 403) CTA(points,seglen[,location]) Cam Table Attribute (see page 370) CTW(pos[,seglen][,user]) Cam Table Write Data Points (see page 377) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 525 of 909...
Page 526
Part 2: Commands: MC CTE(table) Cam Table Erase (see page 372) SRC(enc_src) Source, Follow and/or Cam Encoder (see page 720) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 526 of 909...
The shape of the spline assumes that both the beginning and end of the table have a slope of 0. Allow spline mode unless a segment has a linear specification. The shape (slope) of the spline takes into consideration wrapping around the end of the table. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 528 of 909...
Page 529
'the output total of the virtual master 'encoder into the cam. MFSDC(-1,0) 'Disable virtual master (gearing) repeat. 'Begin move. 'Required END. RELATED COMMANDS: MC Mode Cam (Electronic Camming) (see page 524) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 529 of 909...
Therefore, issuing a G command will only work if the cam is at the starting slave position and remains there long enough to reliably issue that command. It may be difficult to correctly time this in a program. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 530 of 909...
Page 531
MCMUL=formula Mode Cam Multiplier (see page 530) MFSDC(distance,mode) Mode Follow, Stall-Dwell-Continue (see page 573) MFSLEW(distance[,m/s]) Mode Follow Slew (see page 575) SRC(enc_src) Source, Follow and/or Cam Encoder (see page 720) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 531 of 909...
MCW should be called at least once before the G command to enter cam mode. Refer to the following example. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 532 of 909...
Page 533
CTT Cam Table Total in EEPROM (see page 376) CTW(pos[,seglen][,user]) Cam Table Write Data Points (see page 377) G Start Motion (GO) (see page 456) MC Mode Cam (Electronic Camming) (see page 524) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 533 of 909...
Page 534
This option is off by default. Status Word 6, Bit 9 indicates if this mode is active. NOTE: MDE, MDS and MDC require angle match before they will take effect. This means the SmartMotor's factory calibration is valid and the index mark of the internal encoder has been seen after startup. The default commutation mode for D-style motors is MDT (see MDT on page 546);...
Page 535
MDH Mode Hybrid (Commutation Mode) (see page 540) MDHV Mode Hybrid Velocity (Commutation Mode) (see page 542) MDS Mode Sine (Commutation Mode) (see page 544) MDT Mode Trap (Commutation Mode) (see page 546) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 535 of 909...
Page 536
DETAILED DESCRIPTION: The MDC command enables the motor's sinusoidal (sine) commutation mode augmented with digital current control. Available only in the M-style SmartMotor, this method offers optimum performance without sacrificing quiet operation. It is the best choice for an application when this capability is available.
Page 537
MDH Mode Hybrid (Commutation Mode) (see page 540) MDHV Mode Hybrid Velocity (Commutation Mode) (see page 542) MDS Mode Sine (Commutation Mode) (see page 544) MDT Mode Trap (Commutation Mode) (see page 546) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 537 of 909...
Page 538
Use status word 6 to see the active commutation mode. NOTE: MDE, MDS and MDC require angle match before they will take effect. This means the SmartMotor's factory calibration is valid and the index mark of the internal encoder has been seen after startup. The default commutation mode for D-style motors is MDT (see MDT on page 546);...
Page 539
MDH Mode Hybrid (Commutation Mode) (see page 540) MDHV Mode Hybrid Velocity (Commutation Mode) (see page 542) MDS Mode Sine (Commutation Mode) (see page 544) MDT Mode Trap (Commutation Mode) (see page 546) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 539 of 909...
Page 540
To determine the selection of either MDS or MDE commutation, the motor's actual measured speed as an absolute (positive) value is compared to the value set by the MDHV command based on the criteria described above. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 540 of 909...
Page 541
MDE Mode Enhanced (Commutation Mode) (see page 538) MDHV Mode Hybrid Velocity (Commutation Mode) (see page 542) MDS Mode Sine (Commutation Mode) (see page 544) MDT Mode Trap (Commutation Mode) (see page 546) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 541 of 909...
'Set velocity move VT=600000 'Set velocity target ADT=10 'Set accel/decel target 'Start motion RELATED COMMANDS: MDB Enable TOB Feature (Commutation Mode) (see page 534) MDC Mode Current (Commutation Mode) (see page 536) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 542 of 909...
Page 543
MDE Mode Enhanced (Commutation Mode) (see page 538) MDH Mode Hybrid (Commutation Mode) (see page 540) MDS Mode Sine (Commutation Mode) (see page 544) MDT Mode Trap (Commutation Mode) (see page 546) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 543 of 909...
Page 544
Refer to the following figure. It shows the differences between sine and 6-step trapezoidal commutation modes, used by the SmartMotor, for one magnetic cycle. (Commutation ensures firing of switches on the proper magnetic cycle.) The shaded leading areas indicate the application of current sooner in trapezoidal commutation mode, which results in greater torque.
Page 545
Use status word 6 to see the active commutation mode. NOTE: MDE, MDS and MDC require angle match before they will take effect. This means the SmartMotor's factory calibration is valid and the index mark of the internal encoder has been seen after startup. The default commutation mode for D-style motors is MDT (see MDT on page 546);...
Page 546
Use status word 6 to see the active commutation mode. NOTE: MDE, MDS and MDC require angle match before they will take effect. This means the SmartMotor's factory calibration is valid and the index mark of the internal encoder has been seen after startup. The default commutation mode for D-style motors is MDT (see MDT on page 546);...
Page 547
MDE Mode Enhanced (Commutation Mode) (see page 538) MDH Mode Hybrid (Commutation Mode) (see page 540) MDHV Mode Hybrid Velocity (Commutation Mode) (see page 542) MDS Mode Sine (Commutation Mode) (see page 544) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 547 of 909...
Page 548
The MF0 command zeroes the second encoder register (see CTR(enc) on page 374) without changing the current motion mode of the SmartMotor™. Following MF0, the A and B pins will be interpreted as a quadrature encoder signal. MS0 is the opposite input mode.
Page 549
'Start following external encoder RELATED COMMANDS: CTR(enc) Counter, Encoder, Step and Direction (see page 374) MS0 Mode Step, Zero External Counter (see page 585) MSR Mode Step Ratio (see page 587) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 549 of 909...
This ramp starts when motion is commanded to start with a G command, and will end when the Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 550 of 909...
Page 551
MFD(distance[,m/s]) Mode Follow Descend (see page 555) MFDIV=formula Mode Follow Divisor (see page 558) MFMUL=formula Mode Follow Multiplier (see page 568) MFR Mode Follow Ratio (see page 570) MFSDC(distance,mode) Mode Follow, Stall-Dwell-Continue (see page 573) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 551 of 909...
Page 552
Part 2: Commands: MFA(distance[,m/s]) MFSLEW(distance[,m/s]) Mode Follow Slew (see page 575) MSR Mode Step Ratio (see page 587) SRC(enc_src) Source, Follow and/or Cam Encoder (see page 720) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 552 of 909...
This state is not reset by an X or an OFF. (Default at power up) When G is issued, initially traverse toward higher bound. When G is issued, initially traverse toward lower bound. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 553 of 909...
Page 554
MFLTP=formula Mode Follow, Low Traverse Point (see page 566) MFMUL=formula Mode Follow Multiplier (see page 568) MFR Mode Follow Ratio (see page 570) MFSDC(distance,mode) Mode Follow, Stall-Dwell-Continue (see page 573) MSR Mode Step Ratio (see page 587) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 554 of 909...
When operating in MFR or MSR mode, it is possible to create a motion profile where the ratio of the incoming encoder signal to the motor output motion can be gradually ramped down. This ramp starts when an X (decelerate to stop) is commanded, or a pre-programmed Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 555 of 909...
Page 556
'Specify the second argument as a 1 to 'force this number as the output total of 'the virtual encoder into the cam. MFSDC(-1,0) 'Disable virtual encoder profile repeat. 'Enter Cam mode. 'Begin move. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 556 of 909...
Page 557
MFMUL=formula Mode Follow Multiplier (see page 568) MFR Mode Follow Ratio (see page 570) MFSDC(distance,mode) Mode Follow, Stall-Dwell-Continue (see page 573) MFSLEW(distance[,m/s]) Mode Follow Slew (see page 575) MSR Mode Step Ratio (see page 587) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 557 of 909...
Page 559
RELATED COMMANDS: MC Mode Cam (Electronic Camming) (see page 524) MFMUL=formula Mode Follow Multiplier (see page 568) MFR Mode Follow Ratio (see page 570) MSR Mode Step Ratio (see page 587) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 559 of 909...
However, MFH has a slightly different application. It is only used in absolute traverse mode, MFSDC(x,2). MFH defines the descent and ascent ramps at the high end of the absolute Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 560 of 909...
Page 561
MFLTP=formula Mode Follow, Low Traverse Point (see page 566) MFMUL=formula Mode Follow Multiplier (see page 568) MFR Mode Follow Ratio (see page 570) MSR Mode Step Ratio (see page 587) MFSDC(distance,mode) Mode Follow, Stall-Dwell-Continue (see page 573) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 561 of 909...
The MFHTP traverse point can be set at any time. However, it is buffered and accepted into the motion profile when the motion profile reaches the opposite traverse point (MFLTP). Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 562 of 909...
Page 563
MFLTP=formula Mode Follow, Low Traverse Point (see page 566) MFMUL=formula Mode Follow Multiplier (see page 568) MFR Mode Follow Ratio (see page 570) MFSDC(distance,mode) Mode Follow, Stall-Dwell-Continue (see page 573) MSR Mode Step Ratio (see page 587) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 563 of 909...
MFL behaves similar to MFA and MFD — a ramp is defined during the follow profile. However, MFL is only used in absolute traverse mode, MFSDC(x,2). MFL defines the descent and ascent Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 564 of 909...
Page 565
MFLTP=formula Mode Follow, Low Traverse Point (see page 566) MFMUL=formula Mode Follow Multiplier (see page 568) MFR Mode Follow Ratio (see page 570) MFSDC(distance,mode) Mode Follow, Stall-Dwell-Continue (see page 573) MSR Mode Step Ratio (see page 587) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 565 of 909...
The MFLTP traverse point can be set at any time. However, it is buffered and accepted into the motion profile when the motion profile reaches the opposite traverse point (MFHTP). Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 566 of 909...
Page 567
MFL(distance[,m/s]) Mode Follow, Low Ascend/Descend Rate (see page 564) MFMUL=formula Mode Follow Multiplier (see page 568) MFR Mode Follow Ratio (see page 570) MFSDC(distance,mode) Mode Follow, Stall-Dwell-Continue (see page 573) MSR Mode Step Ratio (see page 587) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 567 of 909...
Page 569
RELATED COMMANDS: MC Mode Cam (Electronic Camming) (see page 524) MFDIV=formula Mode Follow Divisor (see page 558) MFR Mode Follow Ratio (see page 570) MSR Mode Step Ratio (see page 587) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 569 of 909...
Page 570
DETAILED DESCRIPTION: The MFR command is used to implement a fractional relationship between an incoming secondary encoder signal and the SmartMotor™ internal shaft position, which is represented by the primary internal encoder count. The fractional relationship is defined by the user-set ratio of MFMUL to MFDIV.
Page 571
For instance, MFMUL=10 and MFDIV=395 gives a reduction ratio of 39.5. NOTE: The only method of inputting a ratio to the SmartMotor is with the MFMUL and MFDIV commands, which require integers within a certain range.
Page 572
MFSDC(distance,mode) Mode Follow, Stall-Dwell-Continue (see page 573) MFSLEW(distance[,m/s]) Mode Follow Slew (see page 575) MSR Mode Step Ratio (see page 587) SRC(enc_src) Source, Follow and/or Cam Encoder (see page 720) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 572 of 909...
Values from 0 to 2147483647 to specify the number of master counts the slave dwells at zero ratio. Set to -1 (default) to disable. When disabled, Follow Mode will not restart automatically. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 573 of 909...
Page 574
MFDIV=formula Mode Follow Divisor (see page 558) MFMUL=formula Mode Follow Multiplier (see page 568) MFR Mode Follow Ratio (see page 570) MFSLEW(distance[,m/s]) Mode Follow Slew (see page 575) MSR Mode Step Ratio (see page 587) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 574 of 909...
MFA and MFD ramps form a triangular profile. (Optional) Specifies the meaning of exp1. Values are: 0 for designating input units (master units); 1 for designating distance traveled (slave units). Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 575 of 909...
Page 576
MFDIV=formula Mode Follow Divisor (see page 558) MFMUL=formula Mode Follow Multiplier (see page 568) MFR Mode Follow Ratio (see page 570) MFSDC(distance,mode) Mode Follow, Stall-Dwell-Continue (see page 573) MSR Mode Step Ratio (see page 587) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 576 of 909...
MINV(1) inverts the direction convention When looking at the end of the motor shaft, the default direction convention of the SmartMotor is clockwise shaft rotation = positive encoder counts, and counterclockwise shaft rotation = negative encoder counts. Issuing the MINV(1) command inverts (flips) this direction convention.
Page 578
'Manually rotate the motor shaft a few turns clockwise 'Responds with a higher count, like 8723 RELATED COMMANDS: CTR(enc) Counter, Encoder, Step and Direction (see page 374) PA Position, Actual (see page 615) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 578 of 909...
MODE gets the active operating mode MODE(...) gets the active operating mode, specific trajectory For example x=MODE(1) will report trajectory 1 (MP, MV, MT) The following table describes the possible meaning for the returned value: Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 579 of 909...
Page 580
Mixed: MP and MC Mixed: MV and MFR Mixed: MV and MSR Mixed: MV and MC EXAMPLE: In the SMI editor, create the following program, download it to a SmartMotor and then run it. EIGN(W,0) 'Disable hardware limits 'Clear status bits 'Set position mode AT=500 'Preset acceleration.
Page 581
MFR Mode Follow Ratio (see page 570) MP Mode Position (see page 582) MSR Mode Step Ratio (see page 587) MT Mode Torque (see page 589) MV Mode Velocity (see page 593) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 581 of 909...
Page 582
MP command. The mode request is buffered until a G command is issued. NOTE: For a standard position-mode move, the SmartMotor™ requires, at a minimum, a position target (PT), nonzero trajectory velocity (VT) and a nonzero positive acceleration/deceleration (ADT).
Page 583
'Switch to Position mode VT=20000 'Set higher maximum velocity PT=0 'Set target position to be home 'Start motion TWAIT 'Wait for motion to complete AMPS=1023 'Restore current limit to maximum 'End program Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 583 of 909...
Page 584
G Start Motion (GO) (see page 456) MV Mode Velocity (see page 593) PRT=formula Position, Relative Target (see page 652) PT=formula Position, (Absolute) Target (see page 658) VT=formula Velocity Target (see page 788) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 584 of 909...
Page 585
DETAILED DESCRIPTION: The MS0 command zeroes the second encoder register (see CTR(enc) on page 374) without changing the current motion mode of the SmartMotor™. Following MS0, the A and B pins will be interpreted as a step-and-direction signal. MF0 is the opposite input mode.
Page 586
MF0 Mode Follow, Zero External Counter (see page 548) MFDIV=formula Mode Follow Divisor (see page 558) MFMUL=formula Mode Follow Multiplier (see page 568) MFR Mode Follow Ratio (see page 570) MSR Mode Step Ratio (see page 587) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 586 of 909...
Page 587
MSR is typically used in applications where the input signal is from a controller using stepper motors. The SmartMotor™ can be used in place of a stepper drive and stepper motor. By carefully applying MFMUL and MFDIV, you can select a wide range of motion per input step.
Page 588
MFR Mode Follow Ratio (see page 570) MFSDC(distance,mode) Mode Follow, Stall-Dwell-Continue (see page 573) MFSLEW(distance[,m/s]) Mode Follow Slew (see page 575) SRC(enc_src) Source, Follow and/or Cam Encoder (see page 720) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 588 of 909...
Page 589
TS ramp has been set. The motion is not restricted by the current EL value. For instance, issuing EL=0 would have no effect on the current motion. The motion is subject to the currently defined activity of the limit switches. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 589 of 909...
Page 590
'Increase the torque by 1 unit of T per PID sample 'Begin move RELATED COMMANDS: Bt Bit, Trajectory In Progress (see page 340) T=formula Torque, Open-Loop Commanded (see page 730) TS=formula Torque Slope (see page 747) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 590 of 909...
Page 591
DETAILED DESCRIPTION: The MTB (Mode Torque Brake) command places the SmartMotor™ into dynamic brake mode. In this mode, the motor coils are shorted together. Any motion of the shaft would normally produce Back EMF (BEMF) that is proportional to speed. However, having the windings shorted out causes this BEMF to be dissipated immediately.
Page 592
RELATED COMMANDS: BRKRLS Brake Release (see page 330) FSA(cause,action) Fault Stop Action (see page 450) G Start Motion (GO) (see page 456) OFF Off (Drive Stage Power) (see page 605) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 592 of 909...
Page 593
X command, which will decelerate the motor to a stop. The velocity mode calculates position as a function of time. This is different than simpler velocity Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 593 of 909...
Page 594
ADT=formula Acceleration/Deceleration Target (see page 257) EL=formula Error Limit (see page 419) G Start Motion (GO) (see page 456) MP Mode Position (see page 582) VT=formula Velocity Target (see page 788) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 594 of 909...
Page 595
Pre-operational state (SDO communications are allowed; no PDO communications) DEFAULT state at power up Reset application (resets the whole motor) Reset communications (resets the CANopen stack mappings, etc., but motor program, variables, etc retains current state) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 595 of 909...
Page 596
' NMT command failed. ENDIF RELATED COMMANDS: CAN, CAN(arg) CAN Bus Status (see page 352) CANCTL(function,value) CAN Control (see page 354) SDORD(...) SDO Read (see page 692) SDOWR(...) SDO Write (see page 694) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 596 of 909...
PA set to PC - EA O(0)=formula PC set to 'formula value' PA set to PC - EA O(1)=formula PC(1) set to 'formula value' O(2)=formula PC(2) set to 'formula value' Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 597 of 909...
Page 598
Position is 8000 RELATED COMMANDS: EA Error Actual (see page 394) OSH=formula, OSH(trj#)=formula Origin Shift (see page 611) PA Position, Actual (see page 615) PC, PC(axis) Position, Commanded (see page 619) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 598 of 909...
D-style: word is 1; result is 0–1023 M-style: word is 0; result is 0–2047 NOTE: This does not represent the state of the inputs. Only the commanded outputs are represented. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 599 of 909...
Page 600
Output 24 on pin 8 is LOW. Output 25 on pin 9 is LOW. RELATED COMMANDS: OF(...) Output Fault (see page 603) OR(value) Output, Reset (see page 607) OS(...) Output, Set (see page 609) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 600 of 909...
Therefore, during development, prevent this by using the RUN? command at the start of each program. NOTE: If you get locked out and are unable to communicate with the SmartMotor, you may be able to recover communications using the SMI software's Communication Lockup Wizard.
Page 602
Parity: O=odd, E=even, N=none; Mode: C=command, D=data NOTE: For the D-style motor, opening channel 0 as an RS-485 port dedicates I/O pin 6 to the RS-485 control function. This is required for use with Moog Animatics RS-232 to RS-485 converters like the RS485 and RS485-ISO.
Page 603
Returns the bit mask of Latched Faulted I/O points, where word is the 16-bit word number. Reading a 16-bit word will attempt to clear the I/O word latch. D-style: word is 1; result is 0–1023 M-style: word is 0; result is 0–2047 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 603 of 909...
Page 604
Output 24 on pin 8 is LOW. Output 25 on pin 9 is LOW. RELATED COMMANDS: OC(...) Output Condition (see page 599) OR(value) Output, Reset (see page 607) OS(...) Output, Set (see page 609) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 604 of 909...
Page 605
By default, the motor will activate MTB. To disable this default behavior, issue BRKRLS and OFF commands. For more details on MTB, see MTB on page 591. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 605 of 909...
Page 606
B(word,bit) Status Byte (see page 291) BRKRLS Brake Release (see page 330) G Start Motion (GO) (see page 456) MTB Mode Torque Brake (see page 591) W(word) Report Specified Status Word (see page 793) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 606 of 909...
Page 607
Reset a single output to logic 0 (off). OR(W,word) Simultaneously resets all outputs in the specified word. OR(W,word[,mask]) Reset outputs in the specified word if those bits are also a "1" in the bitmask. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 607 of 909...
Page 608
IN(...) Specified Input (see page 478) OC(...) Output Condition (see page 599) OF(...) Output Fault (see page 603) OS(...) Output, Set (see page 609) OUT(...)=formula Output, Activate/Deactivate (see page 613) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 608 of 909...
Page 609
Sets a single output to logic 1 (on). OS(W,word) Simultaneously sets all outputs in the specified word. OS(W,word[,mask]) Sets outputs in the specified word if those bits are also a "1" in the bitmask. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 609 of 909...
Page 610
IN(...) Specified Input (see page 478) OC(...) Output Condition (see page 599) OF(...) Output Fault (see page 603) OR(value) Output, Reset (see page 607) OUT(...)=formula Output, Activate/Deactivate (see page 613) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 610 of 909...
Page 611
OSH(1)=, or OSH(2)=. The OSH command shifts the position counters as follows: Command Trajectory Position Actual Position OSH=formula PC=PC+'formula value' PA=PA+'formula value' OSH(0)=formula PC=PC+'formula value' PA=PA+'formula value' OSH(1)=formula PC(1)=PC(1)+'formula value' OSH(2)=formula PC(2)=PC(2)+'formula value' Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 611 of 909...
Page 612
'Absolute position motion profile. RETURN RELATED COMMANDS: EA Error Actual (see page 394) O=formula, O(trj#)=formula Origin (see page 597) PA Position, Actual (see page 615) PC, PC(axis) Position, Commanded (see page 619) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 612 of 909...
Page 613
Set the group of bits in the specified I/O word to the bitwise value from the formula. However, leave bits as-is if they are bitwise set to 0 in the bitmask value. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 613 of 909...
Page 614
IN(...) Specified Input (see page 478) OC(...) Output Condition (see page 599) OF(...) Output Fault (see page 603) OR(value) Output, Reset (see page 607) OS(...) Output, Set (see page 609) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 614 of 909...
Page 615
PA will be changed by the net number of encoder counts occurring during the shaft motion. The primary encoder is tracked at all times — it is independent of the operation mode of the SmartMotor™ or any error condition. For details on adjusting the value of PA, see the commands O=formula, O(trj#)=formula on page 597 and OSH=formula, OSH(trj#)=formula on page 611.
Page 616
ENC1 Encoder Zero (Close Loop on External Encoder) (see page 426) PC, PC(axis) Position, Commanded (see page 619) PMA Position, Modulo Actual (see page 626) PT=formula Position, (Absolute) Target (see page 658) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 616 of 909...
Page 617
GOSUB from a terminal or an interrupt) after a RETURN or RETURNI. Any RESUME that occurred during the time the GOSUB or interrupt routine was executing will not impact the PAUSE in the previous context. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 617 of 909...
Page 618
'Set User Status Bit 0 to 1 (Status 'Word 12 bit zero) US(ADDR):0 'Set User Status Bit "address" to 1 '(Status Word 12 Bit "address") RETURNI RELATED COMMANDS: RESUME Resume Program Execution (see page 672) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 618 of 909...
Page 619
— it depends on how closely the PID tuning brings the position error (EA) to 0. NOTE: If the drive is off, then PC and PC(0) simply follow the actual position PA. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 619 of 909...
Page 621
After relative move, the values are... The external encoder CTR(1)=1000 PC(0)=3000 PC(1)=2000 PC(2)=1000 PRA=1991 PRC=2000 Position Error=9 RELATED COMMANDS: PA Position, Actual (see page 615) PT=formula Position, (Absolute) Target (see page 658) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 621 of 909...
Page 622
ACOS(value) Arccosine (see page 253) ASIN(value) Arcsine (see page 278) ATAN(value) Arctangent (see page 282) COS(value) Cosine (see page 366) SIN(value) Sine (see page 700) TAN(value) Tangent (see page 736) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 622 of 909...
Page 623
PID2 (8000 samples per second) is the default value. For details on determining the actual sample rate of your SmartMotor™, see the RSP on page 678. During each PID sample period, the motor firmware scans and updates the encoder position, trajectory generator and serial communications ports.
Page 624
4000 25000/5... PID8 2 kHz 2000 50000/5... EXAMPLE: (comparison of the different PID values) 'For a 4000 count encoder SmartMotor: 'Using three fixed values under each of the PID settings v=655360 'use to Set commanded Velocity (4000 count encoder) a=256 'use to Set commanded Acceleration...
Page 625
RSP Report Sampling Rate and Firmware Revision (see page 678) SAMP Sampling Rate (see page 690) SRC(enc_src) Source, Follow and/or Cam Encoder (see page 720) VT=formula Velocity Target (see page 788) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 625 of 909...
Page 626
0. At that point, it will be automatically rolled to PML-1. The PML command will reset the PMA counter to 0. The RPMA (report PMA) command updates according to the active encoder selected by ENC0 or ENC1. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 626 of 909...
Page 627
ENC0 Encoder Zero (Close Loop on Internal Encoder) (see page 425) ENC1 Encoder Zero (Close Loop on External Encoder) (see page 426) PML=formula Modulo Position Limit (see page 628) PMT=formula Position, Modulo Target (see page 630) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 627 of 909...
Page 628
The PML value must be greater than the motor speed in terms of encoder counts per PID sample. However, the PML value must be smaller than 2147483647 encoder counts per sample — this prevents overflow. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 628 of 909...
Page 629
ENC0 Encoder Zero (Close Loop on Internal Encoder) (see page 425) ENC1 Encoder Zero (Close Loop on External Encoder) (see page 426) PMA Position, Modulo Actual (see page 626) PMT=formula Position, Modulo Target (see page 630) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 629 of 909...
Page 630
Note that the PT, PRT and PMT targets all act on the ideal currently commanded position instead of the actual position, which may be subject to position error (EA). Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 630 of 909...
Page 631
ENC0 Encoder Zero (Close Loop on Internal Encoder) (see page 425) ENC1 Encoder Zero (Close Loop on External Encoder) (see page 426) PMA Position, Modulo Actual (see page 626) PML=formula Modulo Position Limit (see page 628) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 631 of 909...
Page 632
The value reported from PRA is calculated using the value of PC(1) at the time the move began. Therefore, for accurate PRA calculation, if the origin is changed (i.e., O=0), then also correct trajectory 1 to the same value at that time: O(1)=0. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 632 of 909...
Page 633
Then type GOSUB10 GOSUB10 The external encoder CTR(1)=1000 PC(0)=1000 PC(1)=0 PC(2)=1000 PRA=0 PRC=0 After relative move, the values are... The external encoder CTR(1)=1000 PC(0)=3000 PC(1)=2000 PC(2)=1000 PRA=1991 PRC=2000 Position Error=9 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 633 of 909...
Page 634
Part 2: Commands: PRA RELATED COMMANDS: PA Position, Actual (see page 615) PC, PC(axis) Position, Commanded (see page 619) PRC Position, Relative Commanded (see page 635) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 634 of 909...
Page 635
The value reported from PRC is calculated using the value of PC(1) at the time the move began. Therefore, for accurate PRC calculations, if the origin is changed (i.e., O=0), then also correct trajectory 1 to the same value at that time: O(1)=0. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 635 of 909...
Page 636
Then type GOSUB10 GOSUB10 The external encoder CTR(1)=1000 PC(0)=1000 PC(1)=0 PC(2)=1000 PRA=0 PRC=0 After relative move, the values are... The external encoder CTR(1)=1000 PC(0)=3000 PC(1)=2000 PC(2)=1000 PRA=1991 PRC=2000 Position Error=9 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 636 of 909...
Page 637
Part 2: Commands: PRC RELATED COMMANDS: PA Position, Actual (see page 615) PC, PC(axis) Position, Commanded (see page 619) PRA Position, Relative Actual (see page 632) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 637 of 909...
Page 638
For version 6.0 and later firmware, the PRINT command follows the value of STDOUT, which is 8 (USB port) by default. For STDOUT details, see STDOUT=formula on page 725. To explicitly output to the Class 6 SmartMotor's communication port 0, use the PRINT0 command. For details, see PRINT0(...) on page 642.
Page 639
PRINT(a) PRINT(b) PRINT(c) from within a program while the host terminal is transmitting GOSUB5 to the motor could lead to the GOSUB5 routine executing between the PRINT commands, which would result in the PRINT sequence not outputting as desired. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 639 of 909...
Page 640
'Tell Motor-4 to run subroutine C123 v=100000 a=100 p=2000 PRINT(#130,"ADT=",a," VT=",v,#13) 'Set speed and accel/decel in motor 2 WAIT=10 PRINT(#130,"MP PT=",p," G",#13) 'Command Motor-2 to position 2000 WAIT=10 PRINT(#13,#13,"End of Demonstration.",#13) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 640 of 909...
Page 641
OCHN(...) Open Channel (see page 601) PRINT0(...) Print Data to Communications Port 0 (see page 642) PRINT1(...) Print Data to Communications Port 1 (see page 646) PRINT8(...) Print Data to USB Port (see page 649) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 641 of 909...
Page 642
Literal values for characters may be specified (one 8-bit character at a time): PRINT0 (#32) Binary data may be specified (one 8-bit character at a time): PRINT0(#ab[0], #ab[1]) This is useful in data mode when communicating with non-ASCII mode systems. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 642 of 909...
Page 643
PRINT0(a) PRINT0(b) PRINT0(c) from within a program while the host terminal is transmitting GOSUB5 to the motor could lead to the GOSUB5 routine executing between the PRINT0 commands, which would result in the PRINT0 sequence not outputting as desired. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 643 of 909...
Page 644
'Tell Motor-4 to run subroutine C123 v=100000 a=100 p=2000 PRINT0(#130,"ADT=",a," VT=",v,#13) 'Set speed and accel/decel in motor 2 WAIT=10 PRINT0(#130,"MP PT=",p," G",#13) 'Command Motor-2 to position 2000 WAIT=10 PRINT0(#13,#13,"End of Demonstration.",#13) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 644 of 909...
Page 645
OCHN(...) Open Channel (see page 601) PRINT(...) Print Data to Communications Port (see page 638) PRINT1(...) Print Data to Communications Port 1 (see page 646) PRINT8(...) Print Data to USB Port (see page 649) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 645 of 909...
Page 646
The only difference between PRINT and PRINT1 is the destination (output): for version 5.x firmware, PRINT outputs to COM 0, PRINT1 outputs to COM 1. Refer to PRINT(...) on page 638 for more PRINT/PRINT1 details. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 646 of 909...
Page 647
'Tell Motor-4 to run subroutine C123 v=100000 a=100 p=2000 PRINT1(#130,"ADT=",a," VT=",v,#13) 'Set speed and accel/decel in motor 2 WAIT=10 PRINT1(#130,"MP PT=",p," G",#13) 'Command Motor-2 to position 2000 WAIT=10 PRINT1(#13,#13,"End of Demonstration.",#13) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 647 of 909...
Page 648
OCHN(...) Open Channel (see page 601) PRINT(...) Print Data to Communications Port (see page 638) PRINT0(...) Print Data to Communications Port 0 (see page 642) PRINT8(...) Print Data to USB Port (see page 649) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 648 of 909...
Page 649
6.0 and later COMBITRONIC: DETAILED DESCRIPTION: The PRINT8( ) command is used to transmit (output) data to the Class 6 SmartMotor's USB port. The only difference between PRINT0 and PRINT8 is the destination (output): PRINT0 explicitly outputs to COM 0, PRINT8 explicitly outputs to the USB port. Refer to PRINT0(...) on page 642 for more PRINT details.
Page 650
'Tell Motor-4 to run subroutine C123 v=100000 a=100 p=2000 PRINT8(#130,"ADT=",a," VT=",v,#13) 'Set speed and accel/decel in motor 2 WAIT=10 PRINT8(#130,"MP PT=",p," G",#13) 'Command Motor-2 to position 2000 WAIT=10 PRINT8(#13,#13,"End of Demonstration.",#13) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 650 of 909...
Page 651
OCHN(...) Open Channel (see page 601) PRINT(...) Print Data to Communications Port (see page 638) PRINT0(...) Print Data to Communications Port 0 (see page 642) PRINT1(...) Print Data to Communications Port 1 (see page 646) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 651 of 909...
Page 652
Status word 3, bit 8 reports 1 when acting on a PRT target (relative position). PRT acts on the ideal currently commanded position and not the actual position, which may be subject to position error (EA). Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 652 of 909...
Page 653
MP Mode Position (see page 582) PRA Position, Relative Actual (see page 632) PRC Position, Relative Commanded (see page 635) PT=formula Position, (Absolute) Target (see page 658) VT=formula Velocity Target (see page 788) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 653 of 909...
Page 654
NOTE: There is a three-axis limitation for this command. Additional axes can be synchronized using the PTSS and PRTSS commands. The synchronized motion is initiated with a GS command. For more details, see Synchronized Motion on page 175. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 654 of 909...
Page 655
PTS(...) Position Target, Synchronized (see page 660) PTSS(...) Position Target, Synchronized Supplemental (see page 664) TSWAIT Trajectory Synchronized Wait (see page 749) VTS=formula Velocity Target, Synchronized Move (see page 791) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 655 of 909...
Page 656
The supplemental axis motions will start with the next GS at exactly the same time as the main PTS( ) or PRTS( ) motion. Further, they will transition from their accelerations to their Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 656 of 909...
Page 657
PTS(...) Position Target, Synchronized (see page 660) PTSS(...) Position Target, Synchronized Supplemental (see page 664) TSWAIT Trajectory Synchronized Wait (see page 749) VTS=formula Velocity Target, Synchronized Move (see page 791) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 657 of 909...
Page 658
DETAILED DESCRIPTION: The PT command is used to get (read) or set absolute target position. To specify an absolute target position to the SmartMotor’s™ position origin, set PT=target position (either positive or negative) and then follow with a G command. PT=formula sets the target position in Position mode.
Page 659
G Start Motion (GO) (see page 456) MP Mode Position (see page 582) PA Position, Actual (see page 615) PRT=formula Position, Relative Target (see page 652) VT=formula Velocity Target (see page 788) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 659 of 909...
Page 660
NOTE: There is a three-axis limitation for this command. Additional axes can be synchronized using the PTSS and PRTSS commands. The command is illustrated in the following example: Position target X = 1000 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 660 of 909...
Page 661
'Go, starts the synchronized move RELATED COMMANDS: ADTS=formula Acceleration/Deceleration Target, Synchronized (see page 259) GS Start Synchronized Motion (GO Synchronized) (see page 467) PRTSS(...) Position, Relative Target, Synchronized, Supplemental (see page 656) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 661 of 909...
Page 662
Part 2: Commands: PTS(...) PTSS(...) Position Target, Synchronized Supplemental (see page 664) TSWAIT Trajectory Synchronized Wait (see page 749) VTS=formula Velocity Target, Synchronized Move (see page 791) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 662 of 909...
Page 663
PTS(...) Position Target, Synchronized (see page 660) PTST Position Target, Synchronized Time (see page 666) TSWAIT Trajectory Synchronized Wait (see page 749) VTS=formula Velocity Target, Synchronized Move (see page 791) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 663 of 909...
Page 664
The supplemental axis motions will start with the next GS at exactly the same time as the main PTS( ) or PRTS( ) motion. Further, they will transition from their accelerations to their Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 664 of 909...
Page 665
PRTSS(...) Position, Relative Target, Synchronized, Supplemental (see page 656) PTS(...) Position Target, Synchronized (see page 660) TSWAIT Trajectory Synchronized Wait (see page 749) VTS=formula Velocity Target, Synchronized Move (see page 791) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 665 of 909...
Page 666
PTS(...) Position Target, Synchronized (see page 660) PTSD Position Target, Synchronized Distance (see page 663) TSWAIT Trajectory Synchronized Wait (see page 749) VTS=formula Velocity Target, Synchronized Move (see page 791) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 666 of 909...
Page 667
If an unpredictable seed is desired, then a more creative approach must be used to initialize the value based on events in the real world. For example, you could measure the time between some real-world inputs that are somewhat random. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 667 of 909...
Page 668
-100 to +100, then the following formula may be helpful: a=(RANDOM%201)-100 EXAMPLE: x=200000 'Max distance (full stroke) of actuator 'in encoder counts. PT=RANDOM%x 'Use Modulo function and RANDOM function 'to create random position targets within max stroke. RELATED COMMANDS: Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 668 of 909...
Page 669
EXAMPLE: (Commanded from the terminal window) RCKS The command reports: 000000 0000E1 P RELATED COMMANDS: Bk Bit, Program EEPROM Data Status (see page 310) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 669 of 909...
Page 670
This command can also serve as a check at the beginning of a program to ensure that the program is running on a motor with the expected encoder type. Refer to the following example. EXAMPLE: (Check for proper encoder type) RES!=4000 PRINT("Wrong encoder.",#13) ENDIF Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 670 of 909...
Page 671
'Suppose you wish to read real time velocity in units of RPS: s=VA*af[5] 'Converts native VA (actual velocity) into RPS 'and assigns it to the variable "s" RELATED COMMANDS: FW Firmware Version (see page 454) SAMP Sampling Rate (see page 690) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 671 of 909...
Page 672
If a main program is at a PAUSE but other commands are executing in the interrupt, then a RESUME at that time will not affect the PAUSE in the main program— it will remain paused. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 672 of 909...
Page 673
'Set User Status Bit 0 to 1 (Status 'Word 12 bit zero). US(ADDR):0 'Set User Status Bit "address" to 1 '(Status Word 12 Bit "address"). RETURNI RELATED COMMANDS: PAUSE Pause Program Execution (see page 617) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 673 of 909...
Page 674
Therefore, do not use more than nine nested subroutines; otherwise, it may cause a stack overflow and crash the program. NOTE: RETURNI must be used to return from interrupt subroutines; RETURN must always be used to return from GOSUB subroutines. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 674 of 909...
Page 675
END End Program Code Execution (see page 431) GOSUB(label) Subroutine Call (see page 463) RETURNI Return Interrupt (see page 676) RUN Run Program (see page 682) RUN? Halt Program Execution Until RUN Received (see page 684) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 675 of 909...
Page 676
GOSUB command. NOTE: RETURNI must be used to return from interrupt subroutines; RETURN must always be used to return from GOSUB subroutines. For more details, see Interrupt Programming on page 192. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 676 of 909...
Page 677
ITRE Enable Interrupts, Global (see page 491) RETURN Return From Subroutine (see page 674) RUN Run Program (see page 682) RUN? Halt Program Execution Until RUN Received (see page 684) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 677 of 909...
Page 678
The PID sample period, in microseconds, is the five-digit number reported/100. The sample period is followed by a "/" character and the firmware version string. EXAMPLE: (Terminal command sent to an SM23165D SmartMotor with 5.0.3.44 firmware) The command reports: 12500/5.0.3.44 Moog Animatics SmartMotor™...
Page 679
PID# Proportional-Integral-Differential Filter Rate (see page 623) RSP1 Report Firmware Compile Date (see page 680) RSP5 Report Network Card Firmware Version (see page 681) SAMP Sampling Rate (see page 690) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 679 of 909...
Page 680
All version 5.xx series motors respond in the form of: Month Day, Year HH:MM:SS EXAMPLE: (Terminal command sent to an SM23165D SmartMotor with 5.0.3.44 firmware) RSP1 The command reports: Dec 20 2012 13:08:28...
Page 681
All version 6.x series SmartMotors respond in the form of: n.n.n.n Refer to the following example. EXAMPLE: (Terminal command sent to a SmartMotor) RSP5 The command reports the motor's firmware version, for example: 2.5.28.0...
Page 682
For details, see Z on page 806. If a program exists within the SmartMotor™ user EEPROM, it will automatically run every time the motor is turned on. To prevent this, make RUN? the first command of your user program.
Page 683
RESUME Resume Program Execution (see page 672) RUN? Halt Program Execution Until RUN Received (see page 684) UP Upload Compiled Program and Header (see page 758) UPLOAD Upload Standard User Program (see page 760) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 683 of 909...
Page 684
COMBITRONIC: DETAILED DESCRIPTION: If a program exists within the SmartMotor™ user EEPROM, it will automatically run every time the motor is turned on. To prevent this, make RUN? the first command of your user program. Or, if you wish, place a RUN? command further down in your program. At power up, the program will automatically execute only down to the RUN? statement.
Page 685
RESUME Resume Program Execution (see page 672) RUN? Halt Program Execution Until RUN Received (see page 684) UP Upload Compiled Program and Header (see page 758) UPLOAD Upload Standard User Program (see page 760) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 685 of 909...
Page 686
EL command. This will, in turn, cause the motor to turn off and coast. Consequently, careful use of the S command is vital. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 686 of 909...
Page 687
MP Mode Position (see page 582) MV Mode Velocity (see page 593) PRT=formula Position, Relative Target (see page 652) PT=formula Position, (Absolute) Target (see page 658) X Decelerate to Stop (see page 804) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 687 of 909...
Page 688
The echo function of the SmartMotor is not affected by the addressed state. That is, if told to echo, then a SmartMotor will echo regardless of whether it is listening to commands or not.
Page 689
GOSUB40 BREAK ENDS 'MOTOR 1 CODE RETURN 'MOTOR 2 CODE RETURN 'MOTOR 3 CODE RETURN 'MOTOR 4 CODE RETURN RELATED COMMANDS: ADDR=formula Address (for RS-232 and RS-485) (see page 255) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 689 of 909...
Page 691
'Suppose you wish to read real time velocity in units of RPS: s=VA*af[5] 'Converts native VA (actual velocity) into RPS 'and assigns it to the variable "s" RELATED COMMANDS: FW Firmware Version (see page 454) RES Resolution (see page 670) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 691 of 909...
Page 692
The function will pause (not proceed) a user program until a confirmation is received or a timeout occurs. In the event of a timeout, the value 0 is returned and an error code will be Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 692 of 909...
Page 693
' Go do something to deal with error when read fails. ENDIF RELATED COMMANDS: CAN, CAN(arg) CAN Bus Status (see page 352) CANCTL(function,value) CAN Control (see page 354) NMT Send NMT State (see page 595) SDOWR(...) SDO Write (see page 694) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 693 of 909...
Page 694
1234 (max 32-bits of data). If the length is shorter than the variable or constant given, then the value is truncated regardless of sign. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 694 of 909...
Page 695
' Go do something to deal with error when write fails. ENDIF RELATED COMMANDS: CAN, CAN(arg) CAN Bus Status (see page 352) CANCTL(function,value) CAN Control (see page 354) NMT Send NMT State (see page 595) SDORD(...) SDO Read (see page 692) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 695 of 909...
Page 696
COMBITRONIC: DETAILED DESCRIPTION: The SILENT command causes the SmartMotor™ to suppress all PRINT messages from being transmitted on channel 0. Report commands originating from a user program are also suppressed if they are configured to transmit from COM channel 0 (see STDOUT=formula on page 725).
Page 697
STDOUT=formula Set Device Output (see page 725) SILENT1 Silence Outgoing Communications on Communications Port 1 (see page 698) TALK Talk on Communications Port 0 (see page 732) TALK1 Talk on Communications Port 1 (see page 734) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 697 of 909...
Page 698
COMBITRONIC: DETAILED DESCRIPTION: The SILENT1 command causes the SmartMotor™ to suppress all PRINT1 messages from being transmitted on channel 1. Report commands originating from a user program are also suppressed if they are configured to transmit from COM channel 1 (see STDOUT=formula on page 725).
Page 699
STDOUT=formula Set Device Output (see page 725) SILENT Silence Outgoing Communications on Communications Port 0 (see page 696) TALK Talk on Communications Port 0 (see page 732) TALK1 Talk on Communications Port 1 (see page 734) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 699 of 909...
Page 700
However, the value will be truncated to fit to that integer type. For example, the assignment "aw[0]=" will drop any fractional amount and truncate the result to the range -32768 to 32767 (aw[0]=100.5 will report as 100, and aw[0]=40000.0 will report as -25536). Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 700 of 909...
Page 701
0.841510772 0.841510772 0.673012495 RELATED COMMANDS: ACOS(value) Arccosine (see page 253) ASIN(value) Arcsine (see page 278) ATAN(value) Arctangent (see page 282) COS(value) Cosine (see page 366) TAN(value) Tangent (see page 736) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 701 of 909...
Page 702
The SLD command is used to disable the software limits. The limits are enabled using the SLE command. As an alternative to hardware limits connected to the limit inputs of the SmartMotor™, software limits are "virtual" limit switches that offer distinct advantages. For example, in the event the actual position of the motor strays beyond the desired region of operation, software limits can interrupt motion with a fault.
Page 703
'Set the negative software limit to -8000 encoder counts SLP=8000 'Set the positive software limit to 8000 encoder counts 'Enable software limits 'Set the SmartMotor to position mode ADT=100 'Set a value for accel/decel VT=20000 'Set a value for velocity target...
Page 704
The SLE command is used to enable the software limits. The software limits are disabled using the SLD command. For details, see SLD on page 702. As an alternative to hardware limits connected to the limit inputs of the SmartMotor™, software limits are "virtual" limit switches that offer distinct advantages. For example, in the event the actual position of the motor strays beyond the desired region of operation, software limits can interrupt motion with a fault.
Page 705
'Set the negative software limit to -8000 encoder counts SLP=8000 'Set the positive software limit to 8000 encoder counts 'Enable software limits 'Set the SmartMotor to position mode ADT=100 'Set a value for accel/decel VT=20000 'Set a value for velocity target...
Page 706
COMBITRONIC: DETAILED DESCRIPTION: The SLEEP command is used to put a SmartMotor™ into sleep mode with respect to channel 0 serial commands. While in sleep mode, a SmartMotor will continue to echo (if in ECHO mode) all characters received over the network, but it will ignore all commands other than a WAKE command.
Page 707
ECHO_OFF Turn Off Echo on Communications Port 0 (see page 400) SLEEP1 Ignore Incoming Commands on Communications Port 1 (see page 708) WAKE Wake Communications Port 0 (see page 797) WAKE1 Wake Communications Port 1 (see page 799) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 707 of 909...
Page 708
COMBITRONIC: DETAILED DESCRIPTION: The SLEEP1 command is used to put a SmartMotor™ into sleep mode with respect to channel 1 serial commands. While in sleep mode, a SmartMotor will continue to echo (if in ECHO mode) all characters received over the network, but it will ignore all commands other than a WAKE1 command.
Page 709
ECHO_OFF1 Turn Off Echo on Communications Port 1 (see page 402) SLEEP Ignore Incoming Commands on Communications Port 0 (see page 706) WAKE Wake Communications Port 0 (see page 797) WAKE1 Wake Communications Port 1 (see page 799) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 709 of 909...
Page 710
Make a soft limit trigger the flag and cause a fault (default mode) As an alternative to hardware limits connected to the limit inputs of the SmartMotor™, software limits are "virtual" limit switches that offer distinct advantages. For example, in the event the actual position of the motor strays beyond the desired region of operation, software limits can interrupt motion with a fault.
Page 711
'Set the negative software limit to -8000 encoder counts SLP=8000 'Set the positive software limit to 8000 encoder counts 'Enable software limits 'Set the SmartMotor to position mode ADT=100 'Set a value for accel/decel VT=20000 'Set a value for velocity target...
Page 712
NOTE: SLP should typically be set to a higher value than SLN. As an alternative to hardware limits connected to the limit inputs of the SmartMotor™, software limits are "virtual" limit switches that offer distinct advantages. For example, in the event the actual position of the motor strays beyond the desired region of operation, software limits can interrupt motion with a fault.
Page 713
'Set the negative software limit to -8000 encoder counts SLP=8000 'Set the positive software limit to 8000 encoder counts 'Enable software limits 'Set the SmartMotor to position mode ADT=100 'Set a value for accel/decel VT=20000 'Set a value for velocity target...
Page 714
NOTE: SLP should typically be set to a higher value than SLN. As an alternative to hardware limits connected to the limit inputs of the SmartMotor™, software limits are "virtual" limit switches that offer distinct advantages. For example, in the event the actual position of the motor strays beyond the desired region of operation, software limits can interrupt motion with a fault.
Page 715
'Set the negative software limit to -8000 encoder counts SLP=8000 'Set the positive software limit to 8000 encoder counts 'Enable software limits 'Set the SmartMotor to position mode ADT=100 'Set a value for accel/decel VT=20000 'Set a value for velocity target...
Page 716
DETAILED DESCRIPTION: The SNAME command sets a unique PROFINET station name. For proper PROFINET operation, each SmartMotor must have a unique station name set with the SNAME instruction. The command setting is nonvolatile. Therefore, it will be remembered between power cycles.
Page 717
EXAMPLE: RSP2 RELATED COMMANDS: FW Firmware Version (see page 454) RSP Report Sampling Rate and Firmware Revision (see page 678) RSP1 Report Firmware Compile Date (see page 680) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 717 of 909...
Page 718
6, the integer square root is 2 because 2 is the greatest integer ≤ the square root of 6. Therefore, all inputs for x from 4 through 8 will give the result 2; when x is 9 through 15, the result changes to 3. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 718 of 909...
Page 719
'Set variable u = SQRT(a) RSQRT(a) PRINT(r,", ",s,", ",t,", ",u,#13) 'Print value of each variable Program output is: 2, 2, 2, 3 RELATED COMMANDS: FSQRT(value) Floating-Point Square Root (see page 452) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 719 of 909...
Page 720
The SRC(enc_src) command is used to select the input source used in Follow and Cam modes. The SRC command allows the SmartMotor to use the many advanced following and camming functions even without an external encoder input. For example, through the use of the SRC command either the external encoder or a fixed-rate "virtual encoder"...
Page 721
G Start Motion (GO) (see page 456) MFR Mode Follow Ratio (see page 570) MFDIV=formula Mode Follow Divisor (see page 558) MFMUL=formula Mode Follow Multiplier (see page 568) MSR Mode Step Ratio (see page 587) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 721 of 909...
Page 722
GOTO commands or otherwise, should be used to prevent a memory mapping error. Because the GOSUB command may be issued serially to the SmartMotor, it may be possible to overflow the stack regardless of the downloaded program code. The STACK command could also be issued through serial communications to clear the stack and prevent overflow.
Page 723
Often, the STACK command is used after an error or motor-protection fault is detected. Then, immediately after the STACK command, a RUN, END or GOTO command (located near the top of the program) is issued to recover. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 723 of 909...
Page 724
GOTO(label) Branch Program Flow to a Label (see page 465) PAUSE Pause Program Execution (see page 617) RUN Run Program (see page 682) RUN? Halt Program Execution Until RUN Received (see page 684) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 724 of 909...
Page 725
Sets internal report commands to communications channel COM 1. For Class 6 motors with firmware version 6.0 and later only: STDOUT=0 Sets internal report commands to communications channel COM 0. STDOUT=8 (default) Sets internal report commands to USB port. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 725 of 909...
Page 726
'The Absolute Position will be sent out channel 0 (RS-232). STDOUT=1 'Channel 1 is selected for output of report commands. 'The Absolute Position will be sent out channel 1 (RS-485). RELATED COMMANDS: (none) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 726 of 909...
Page 727
ENDS of the SWITCH control block. BREAK can be used to isolate CASEs. Without BREAK, the CASE number syntax is transparent and program execution continues at the next instruction. That is, you will run into the next CASE number code sequence. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 727 of 909...
Page 728
BREAK ENDS The first line, SWITCH v, lets the SmartMotor™ know that it is checking the value of the variable v. Each following CASE begins the section of code that tells the SmartMotor what to do if v is equal to that case.
Page 729
BREAK Break from CASE or WHILE Loop (see page 326) CASE formula Case Label for SWITCH Block (see page 355) DEFAULT Default Case for SWITCH Structure (see page 382) ENDS End SWITCH Structure (see page 435) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 729 of 909...
Page 730
To reduce the impact, the TS= command can be used to gently apply the current. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 730 of 909...
Page 731
'Final torque after the TS ramp that we want TS=65536 'Increase the torque by 1 unit of T per PID sample 'Begin move RELATED COMMANDS: MT Mode Torque (see page 589) TS=formula Torque Slope (see page 747) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 731 of 909...
Page 732
0 if that ability was previously suppressed with the SILENT command. This command is typically used following the download a user program to a SmartMotor™ within a daisy chain. It could also be used to "un-silence" a debug routine.
Page 733
SILENT Silence Outgoing Communications on Communications Port 0 (see page 696) SILENT1 Silence Outgoing Communications on Communications Port 1 (see page 698) STDOUT=formula Set Device Output (see page 725) TALK1 Talk on Communications Port 1 (see page 734) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 733 of 909...
Page 734
This command is typically used following the download of a user program to a SmartMotor™ within a daisy chain. It could also be used to "un-silence" a debug routine. TALK1 may be issued from the terminal or within a user program. However, the command is typically sent from a host.
Page 735
SILENT Silence Outgoing Communications on Communications Port 0 (see page 696) SILENT1 Silence Outgoing Communications on Communications Port 1 (see page 698) STDOUT=formula Set Device Output (see page 725) TALK Talk on Communications Port 0 (see page 732) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 735 of 909...
Page 736
However, the value will be truncated to fit to that integer type. For example, the assignment "aw[0]=" will drop any fractional amount and truncate the result to the range -32768 to 32767 (aw[0]=100.5 will report as 100, and aw[0]=40000.0 will report as -25536). Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 736 of 909...
Page 737
1.024738192 1.024738192 4.828816413 RELATED COMMANDS: ACOS(value) Arccosine (see page 253) ASIN(value) Arcsine (see page 278) ATAN(value) Arctangent (see page 282) COS(value) Cosine (see page 366) SIN(value) Sine (see page 700) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 737 of 909...
Page 738
Sensor in winding a) When the value is assigned to a floating-point variable, resolution improves to 0.1 degrees C. EXAMPLE: t=TEMP 'response 30 PRINT(TEMP) 'response 31 - the motor is warming up Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 738 of 909...
Page 739
Restart announced at TH - TEMP = 6. RELATED COMMANDS: Bh Bit, Overheat (see page 301) TH=formula Temperature, High Limit (see page 740) Zh Reset Temperature Fault (see page 812) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 739 of 909...
Page 740
Bh will be set to 1, the motor off bit (Bo) will be set to 1, and the trajectory bit will be cleared to 0. NOTE: The SmartMotor will reject any command to clear the Bh fault or start motion until the temperature has fallen by 5 degrees Celsius.
Page 741
Read TH overheat value 32 Read Bh overheat flag 1 Read the temperature 29 Read TH overheat value 33 Read Bh overheat flag 1 RELATED COMMANDS: Bh Bit, Overheat (see page 301) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 741 of 909...
Page 742
Part 2: Commands: TH=formula TEMP, TEMP(arg) Temperature, Motor (see page 738) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 742 of 909...
Page 743
1. When it reaches zero, the status bit will revert to 0. This bit change can be used to trigger a subroutine through the ITR() function. For more details on ITR(), see ITR (Int#,StatusWord,Bit#,BitState,Label#) on page 486. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 743 of 909...
Page 744
'Wait for desired position to pass OUT(1)=0 'Set output lo TMR(0,400) 'Use timer 0 for pulse width TWAIT WAIT=1000 'wait 1 second LOOP . . . RELATED COMMANDS: ITR(Int#,StatusWord,Bit#,BitState,Label#) Interrupt Setup (see page 486) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 744 of 909...
Page 745
In other modes where the servo is enabled, the value of TRQ reports the demand of the PID loop. EXAMPLE: At the SMI terminal prompt, type the following commands: T=3000 NOTE: In Torque mode, the new torque value does not take effect until a G command is issued. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 745 of 909...
Page 746
Now use the TRQ command to read the real-time torque: PRINT(TRQ) Program output is: 2999 RELATED COMMANDS: MT Mode Torque (see page 589) T=formula Torque, Open-Loop Commanded (see page 730) TS=formula Torque Slope (see page 747) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 746 of 909...
Page 747
NOTE: In Torque mode, the new torque value does not take effect until a G command is issued. After executing the above code, in the SMI software Terminal window, use the PRINT (TS) command to get the current torque slope value: Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 747 of 909...
Page 748
Part 2: Commands: TS=formula PRINT(TS) 65536 RELATED COMMANDS: MT Mode Torque (see page 589) T=formula Torque, Open-Loop Commanded (see page 730) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 748 of 909...
Page 749
RELATED COMMANDS: PRTS(...) Position, Relative Target, Synchronized (see page 654) PTS(...) Position Target, Synchronized (see page 660) TWAIT(gen#) Trajectory Wait (see page 750) WAIT=formula Wait for Specified Time (see page 795) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 749 of 909...
Page 750
To access the specific trajectory (1 or 2), use the command form TWAIT(1) or TWAIT(2). Also, note there are associated status bits in status word 7 (bits 0 and 8). Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 750 of 909...
Page 751
GOTO10 'Go back to label RELATED COMMANDS: Bt Bit, Trajectory In Progress (see page 340) TSWAIT Trajectory Synchronized Wait (see page 749) WAIT=formula Wait for Specified Time (see page 795) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 751 of 909...
Page 752
Because the drive is a power-conversion device, the current from the supply is not the same amount of current supplied to the motor windings. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 752 of 909...
Page 753
PRINT("Current twice as high as it should be!",#13) RETURN RELATED COMMANDS: Bh Bit, Overheat (see page 301) TEMP, TEMP(arg) Temperature, Motor (see page 738) TH=formula Temperature, High Limit (see page 740) UJA Bus Voltage (see page 754) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 753 of 909...
Page 754
'Set final position 'Set Position Mode 'Start motion WHILE 'Loop while motion continues UJA<18500 'If voltage is below 18.5 Volts 'Turn motor off ENDIF LOOP 'Loop back to WHILE 'Required END Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 754 of 909...
Page 755
Part 2: Commands: UJA RELATED COMMANDS: Bh Bit, Overheat (see page 301) TEMP, TEMP(arg) Temperature, Motor (see page 738) TH=formula Temperature, High Limit (see page 740) UIA Motor Current (see page 752) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 755 of 909...
Page 756
User Bits User Word Status Word (individually addressed) 0, e.g., UO(W,0)=x 12, e.g., RW(12) or RB(12,x) 0-15, e.g., UO(15)=0 1, e.g., UO(W,1)=x 13, e.g., RW(13) or RB(13,x) 16-31, e.g., UO(31)=0 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 756 of 909...
Page 757
User bits allow the programmer to keep track of events or status within an application program. Their functions are defined by the application program in the SmartMotor. User bits are individually addressed starting at 0 (zero based). Likewise, the user-bit words are addressed starting at 0 (zero based).
Page 758
7. Repeat step 5. If less than 8 bytes (including 0 bytes) of program data is remaining, then the end of program was found. The program is ended with a hex character FF. If this character is seen, no further program data will follow. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 758 of 909...
Page 759
Comments are removed by the SMI software compiler, which is normal for any compiled computer program. When uploading a program from a SmartMotor in a daisy chain, use the SILENT and SLEEP commands to prevent the other SmartMotors in the chain from issuing unexpected characters.
Page 760
COMBITRONIC: DETAILED DESCRIPTION: The UPLOAD command uploads only the text portion of the SmartMotor’s™ program as it is shown in the original source file. The program is uploaded to the serial port where it was requested. All comments and blank spaces are removed. In contrast, the UP command uploads the text along with all of the binary information created by the compiler.
Page 761
Comments are removed by the SMI software compiler, which is normal for any compiled computer program. When uploading a program from a SmartMotor in a daisy chain, use the SILENT and SLEEP commands to prevent the other SmartMotors in the chain from issuing unexpected characters.
Page 762
16-31, e.g., UR(31) User bits allow the programmer to keep track of events or status within an application program. Their functions are defined by the application program in the SmartMotor. User bits Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 762 of 909...
Page 763
B(word,bit) Status Byte (see page 291) ITR(Int#,StatusWord,Bit#,BitState,Label#) Interrupt Setup (see page 486) UO(...)=formula User Status Bits (see page 756) US(...) User Bits, Set (see page 764) W(word) Report Specified Status Word (see page 793) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 763 of 909...
Page 764
16-31, e.g., US(31) User bits allow the programmer to keep track of events or status within an application program. Their functions are defined by the application program in the SmartMotor. User bits Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 764 of 909...
Page 765
B(word,bit) Status Byte (see page 291) ITR(Int#,StatusWord,Bit#,BitState,Label#) Interrupt Setup (see page 486) UO(...)=formula User Status Bits (see page 756) UR(...) User Bits, Reset (see page 762) W(word) Report Specified Status Word (see page 793) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 765 of 909...
Page 766
Result Value Requested Information Range Meaning 0: Detached state Report connection state 0-32 1: Attached state 2: Powered state 4: Default state 8: Address-pending state 16: Address state 32: Configured state Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 766 of 909...
Page 767
Part 2: Commands: USB(arg) EXAMPLE: x=USB(0) 'Read the status of USB connection. RELATED COMMANDS: Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 767 of 909...
Page 768
Reads the actual velocity measured by the selected encoder. When ENC1 mode is chosen, the external encoder is used. The SmartMotor can be given a variety of motion commands. Under all types of motion, the actual velocity (rotational) can be reported. This also applies to a back-driven motor when the drive is off.
Page 770
SAMP Sampling Rate (see page 690) VAC(arg) Velocity Actual (filter) Control (see page 771) VC Velocity Commanded (see page 776) VL=formula Velocity Limit (see page 778) VT=formula Velocity Target (see page 788) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 770 of 909...
Page 771
Therefore, use the default value unless a specific problem with the VA reading requires tuning it. Refer to the following table for PID sample rate of 8000 Hz (set with the PID2 command). Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 771 of 909...
Page 772
In this case, the time constant is 60 msec. Therefore, you would wait for 300 msec (60 x 5 = 300) to allow the value to settle to a valid reading. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 772 of 909...
Page 773
3. Wait 300 msec for the speed to settle (to obtain a valid reading) 4. Read VA (with RVA or x=VA). Examples of RVA readings with different settings of VAC() Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 773 of 909...
Page 774
Dramatic Example of Filter Causing Lag in Readings EXAMPLE: VAC(65000) 'Set VAC to default value. VAC(65400) 'Set VAC to higher value to smooth out VA readings, 'resulting in slower update time. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 774 of 909...
Page 775
Part 2: Commands: VAC(arg) EXAMPLE: For this example, try changing the VAC() value while polling VA. EIGN(W,0) 'Make all onboard I/O inputs 'Clear errors. 'Set the SmartMotor to Velocity Mode VAC(65400) 'Set time constant to 60 milliseconds ADT=10 'Set a value for accel/decel VT=200000 'Set a value for velocity target 'Start motion.
Page 776
RES can be reported from the terminal using the RSAMP and RRES commands, respectively). SAMP can change if the PID command is used. The value of RES can differ between motor models. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 776 of 909...
Page 777
PRINT VC = 1000000 RVC = 1000000 RELATED COMMANDS: RES Resolution (see page 670) SAMP Sampling Rate (see page 690) VA Velocity Actual (see page 768) VT=formula Velocity Target (see page 788) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 777 of 909...
Page 778
This command helps provide a safety mechanism for high speeds and other situations that could damage equipment. Of greatest concern are those from gravitational loads that could back drive the motor. EXAMPLE: VL=3500 'Set Velocity Limit to 3500 RPM Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 778 of 909...
Page 779
Part 2: Commands: VL=formula RELATED COMMANDS: VA Velocity Actual (see page 768) VAC(arg) Velocity Actual (filter) Control (see page 771) VC Velocity Commanded (see page 776) VT=formula Velocity Target (see page 788) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 779 of 909...
Page 780
(refer to the following table). For example, VSD(aw [0],3) transfers three words in sequence, where each word is two bytes. In this example, the total number of bytes stored is six. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 780 of 909...
Page 781
VST(ab[0],1) 'Store into EEPROM (EPTR incremental 'to 101 automatically) EPTR=100 'Set EEPROM to 100 again VLD(ab[1],1) 'Load from location 100 into the variable ab[1] Rab[1] 'Report result will be: 126 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 781 of 909...
Page 782
NOTE: The EEPROM value automatically increments for each value stored or read. The EPTR value after the above execution will be set to 3200+(7 variable * 2 bytes each) or 3214. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 782 of 909...
Page 783
'Variables you wish to store VLD(aw[r],s) WHILE t<5 PRINT(#13,aw[t+r]," ") t=t+1 LOOP 'Output is 111 222 333 444 -1111 RELATED COMMANDS: EPTR=formula EEPROM Pointer (see page 440) VST(variable,number) Variable Save (see page 784) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 783 of 909...
Page 784
(refer to the following table). For example, VSD(aw [0],3) transfers three words in sequence, where each word is two bytes. In this example, the total number of bytes stored is six. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 784 of 909...
Page 785
VST(ab[0],1) 'Store into EEPROM (EPTR incremental 'to 101 automatically) EPTR=100 'Set EEPROM to 100 again VLD(ab[1],1) 'Load from location 100 into the variable ab[1] Rab[1] 'Report result will be: 126 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 785 of 909...
Page 786
NOTE: The EEPROM value automatically increments for each value stored or read. The EPTR value after the above execution will be set to 3200+(7 variable * 2 bytes each) or 3214. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 786 of 909...
Page 787
'Variables you wish to store VLD(aw[r],s) WHILE t<5 PRINT(#13,aw[t+r]," ") t=t+1 LOOP 'Output is 111 222 333 444 -1111 RELATED COMMANDS: EPTR=formula EEPROM Pointer (see page 440) VLD(variable,number) Variable Load (see page 780) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 787 of 909...
Page 788
In this case, the actual speed will exceed the target speed. The value defaults to zero, so it must be set before any motion can occur. The new value does not take effect until the next G command is issued. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 788 of 909...
Page 789
'Switch to Position mode VT=20000 'Set higher maximum velocity PT=0 'Set target position to be home 'Start motion TWAIT 'Wait for motion to complete AMPS=1023 'Restore current limit to maximum 'End program Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 789 of 909...
Page 790
VA Velocity Actual (see page 768) VAC(arg) Velocity Actual (filter) Control (see page 771) VC Velocity Commanded (see page 776) VL=formula Velocity Limit (see page 778) VTS=formula Velocity Target, Synchronized Move (see page 791) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 790 of 909...
Page 791
A useful Scale Factor Multiplier code example, which also illustrates the use of af[], SAMP and RES, is shown in RES on page 670 and SAMP on page 690. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 791 of 909...
Page 792
PRTS(...) Position, Relative Target, Synchronized (see page 654) PRTSS(...) Position, Relative Target, Synchronized, Supplemental (see page 656) PTS(...) Position Target, Synchronized (see page 660) PTSS(...) Position Target, Synchronized Supplemental (see page 664) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 792 of 909...
Page 793
The W(word) command reports the specified 16-bit status word. Refer to the following table. Also, see Status Words on page 879, and see Logical I/O User Read Commands Example for Class 5 M-style Motor on page 479. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 793 of 909...
Page 794
ENDIF C100 'Subroutine code here. RETURN RELATED COMMANDS: B(word,bit) Status Byte (see page 291) Z Total CPU Reset (see page 806) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 794 of 909...
Page 795
'Wait about 2 seconds T=TRQ 'Set torque to the value the PID filter 'was commanding in MV MT G 'Set motor to Torque mode WAIT=2000 'Wait about 2 seconds 'Turn the motor off Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 795 of 909...
Page 796
'Set new accel/decel of 500 'Initiate change in speed and acceleration RELATED COMMANDS: CLK=formula Millisecond Clock (see page 363) TMR(timer,time) Timer (see page 743) TWAIT(gen#) Trajectory Wait (see page 750) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 796 of 909...
Page 797
DETAILED DESCRIPTION: WAKE clears the SLEEP condition of a SmartMotor™. Except for the WAKE command, a SmartMotor that has been put to SLEEP rejects all other commands received through the primary port (communications channel 0). WAKE is typically used by a host communicating over the serial channel to isolate individual motors.
Page 798
SLEEP Ignore Incoming Commands on Communications Port 0 (see page 706) SLEEP1 Ignore Incoming Commands on Communications Port 1 (see page 708) WAKE1 Wake Communications Port 1 (see page 799) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 798 of 909...
Page 799
5.0.x, 5.16.x or 5.32.x series only COMBITRONIC: DETAILED DESCRIPTION: WAKE1 clears the SLEEP1 condition of a SmartMotor™. Except for the WAKE1 command, a SmartMotor that has been put to SLEEP1 rejects all other commands received through the channel 1 serial port.
Page 800
SLEEP Ignore Incoming Commands on Communications Port 0 (see page 706) SLEEP1 Ignore Incoming Commands on Communications Port 1 (see page 708) WAKE Wake Communications Port 0 (see page 797) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 800 of 909...
Page 801
The formula may be similar to that used when assigning a value to a variable. However, it is strongly recommended to always use a comparison operator such as: < > <= >= (for more information, see Math Operators on page 873). Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 801 of 909...
Page 802
'Set Position mode 'Start motion WHILE 'Loop while motion continues IF UJA<18500 'If voltage is below 18.5 volts OFF 'Turn motor off ENDIF LOOP 'Loop back to WHILE 'Required END Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 802 of 909...
Page 803
IF formula Conditional Program Code Execution (see page 475) LOOP Loop Back to WHILE Formula (see page 522) SWITCH formula Switch, Program Flow Control (see page 727) WHILE formula While Condition Program Flow Control (see page 801) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 803 of 909...
Page 804
The X command leaves the motor in its current motion mode. Refer to the following table for the motion modes and appropriate parameters to set. Appropriate Motion Parameter Mode to Set DT or ADT DT or ADT MFD() MFD() MFD() Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 804 of 909...
Page 805
'Decelerate to a stop PRINT("Motion Stopped") ENDIF LOOP 'Required END Program output is: Motion Stopped RELATED COMMANDS: G Start Motion (GO) (see page 456) S (as command) Stop Motion (see page 686) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 805 of 909...
Page 806
2. Hold the serial port closed for approximately ¼ second. 3. Open and initialize the serial port. 4. Delay for ½ second. At the end of this time, the SmartMotor will examine the communications buffer. The stored program will be aborted only if the specific characters "EE"...
Page 807
Doing so may cause a continuous and repetitive resetting of the CPU and lock out the motor. NOTE: If you get locked out and are unable to communicate with the SmartMotor, you may be able to recover communications using the SMI software's Communication Lockup Wizard.
Page 808
The Z(word,bit) command resets the specified status bit as follows: Z(word,bit) Clears specific status bit in the specific status word. Refer to the following table, which shows the bits that can be reset with Z(word,bit). Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 808 of 909...
Page 809
B(word,bit) Status Byte (see page 291) Z Total CPU Reset (see page 806) ZS Global Reset System State Flag (see page 818) W(word) Report Specified Status Word (see page 793) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 809 of 909...
Page 810
If the Ba flag is repeatedly set, there may be a problem such as incorrect motor size. Therefore, verify the correct motor has been selected for the current task. For details on motor sizing, see the Moog Animatics Product Catalog. EXAMPLE: 'Test flag...
Page 811
Be Bit, Following Error Limit (see page 299) Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 811 of 909...
Page 812
Be Bit, Following Error Limit (see page 299) Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 812 of 909...
Page 813
Bl Bit, Left Hardware Limit, Historical (see page 311) Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 813 of 909...
Page 814
Bls Bit, Left Software Limit, Historical (see page 313) Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 814 of 909...
Page 815
Br Bit, Right Hardware Limit, Historical (see page 324) Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 815 of 909...
Page 816
Brs Bit, Right Software Limit, Historical (see page 336) Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 816 of 909...
Page 817
Bs Bit, Syntax Error (see page 338) Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 817 of 909...
Page 818
DETAILED DESCRIPTION: Almost any event that occurs within a SmartMotor™ gets recorded in system flags. These flags can be read as part of a program or a host inquiry. After a flag is read, it must be reset so it can record the next event. ZS resets all of the latched bits in the S status byte, the W status word, and the status bits such as Ba, Be, Bh, Bi, etc.
Page 819
ZS command may not clear the Be bit. If you are unable to reset Be with the ZS command, issue an OFF command before issuing the ZS command, which clears the current commanded trajectory and allows the reset to complete. EXAMPLE: 'Reset error and limit flag latches Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 819 of 909...
Page 820
Zrs Reset Right Software Limit Flag, Historical (see page 816) Zs Reset Command Syntax Error Flag (see page 817) Zv Reset Velocity Limit Fault (see page 821) Zw Reset Encoder Wrap Status Flag (see page 822) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 820 of 909...
Page 821
Bv Bit, Velocity Limit (see page 342) Z Total CPU Reset (see page 806) Z(word,bit) Reset Specified Status Bit (see page 808) ZS Global Reset System State Flag (see page 818) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 821 of 909...
Page 822
COMBITRONIC: DETAILED DESCRIPTION: Zw resets the encoder wraparound status flag, Bw, to zero. The SmartMotor™ tracks its position as 32-bit data, so a valid position is from -2147483648 to +2147483647. If the motor moves out of this range, the position will overflow or "wraparound".
Page 823
Part 3: Example SmartMotor Programs Part 3: Example SmartMotor Programs Part 3 of this guide provides examples of SmartMotor programs that can be used as reference material for application development. The code examples can be copied and pasted into the SMI program editor.
Page 824
The following example is identical to the previous, except that instead of pausing program execution during the move with the TWAIT, a subroutine is used to monitor for excessive load during the moves. This is an important distinction — most SmartMotor programs should have the ability to react to events during motion.
Page 825
Part 3: Examples: Home Against a Hard Stop (Basic) Home Against a Hard Stop (Basic) Because the SmartMotor has the capability of lowering its own power level and reading its position error, it can be programmed to gently feel for the end of travel. This provides a means to develop a consistent home position subsequent to each power-up.
Page 826
'=========================================================================== Home Against a Hard Stop (Two Motors) Because the SmartMotor has the capability of lowering its own power level and reading its position error, it can be programmed to gently feel for the end of travel. This provides a means to develop a consistent home position subsequent to each power-up.
Page 827
'Stop the other to prevent racking LOOP T:0=tt*rr 'Preset Torque Values MT:0 'Switch to Torque mode (hold against stop) WAIT=50 'Wait 50 milliseconds o=hh*rr 'Calculate home position O:0=o 'Set Origin to home offset Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 827 of 909...
Page 828
RETURN Home to Index Using Different Modes Each SmartMotor has an encoder with an index marker at one angle. This marker is useful for establishing a repeatable start-up (home) position. The following example uses two different modes to home the motor: The first method (C1) does this by slowly moving the motor shaft past the index marker and decelerating to a stop, and then moving it back to align with the index marker.
Page 829
Part 3: Examples: Maintain Velocity During Analog Drift Maintain Velocity During Analog Drift This example causes the SmartMotor's velocity to track an analog input. Analog signals drift and dither, so a dead-band feature has been added to maintain a stable velocity when the operator is not changing the signal.
Page 830
Part 3: Examples: Long-Term Storage of Variables Long-Term Storage of Variables Each SmartMotor is equipped with a kind of solid-state disk drive, called EEPROM, reserved just for long term data storage and retrieval. Data stored in the EEPROM will remain even after power cycling, just like the SmartMotor's program itself.
Page 831
It is often necessary to fire an output when a certain position is reached. There are many ways to do this with a SmartMotor. This example sets I/O B as an output and makes sure that it comes up to 1 by presetting the output value.
Page 832
The voltage, current and temperature of a SmartMotor are always known. These values can be used within a program to react to changes. In this example, the SmartMotor begins a move and then stops motion if the voltage falls below 18.5 volts.
Page 833
Repeated erasing and rewriting can burn bits and corrupt data. For details and sample code, refer to Electronic Camming Notes and Best Practices on page 159. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 833 of 909...
Page 834
' Enable cam mode SRC(2) MFSLEW(k,1)' Get result in ramp output units to match the cam input units MFSDC(-1,0) MFA(a,m) ' m=1 for ramp output to match cam input units. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 834 of 909...
Page 835
Repeated erasing and rewriting can burn bits and corrupt data. For details and sample code, refer to Electronic Camming Notes and Best Practices on page 159. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 835 of 909...
Page 837
Repeated erasing and rewriting can burn bits and corrupt data. For details and sample code, refer to Electronic Camming Notes and Best Practices on page 159. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 837 of 909...
Page 838
'Prevent overshoot at high end of the spool. nn>n s=(w-(nn-n))/n*c 'calculating slew distance for MFSLEW ELSE s=(w/n)*c ENDIF cc=c/2 'Calculate 180 deg turn of master spool. ITR(1,7,10,0,1) EITR(1) ITRE PAUSE MCMUL=MCMUL*-1 RETURNI Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 838 of 909...
Page 839
Change to SRC(1) for external encoder from master spool. MFA(0,1) 'No ascend into motion. MFD(0,1) 'No descend out of motion. MFSLEW(s,1) 'Slew distance is width of spool in slave motor counts. 'Start moving. MFMUL=-1 RETURN Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 839 of 909...
Page 840
Part 3: Examples: CAN Bus - Timed SDO Poll CAN Bus - Timed SDO Poll This program makes use of one-shot SDO commands to get data while using SmartMotor timer interrupts to poll continuously. This method is used where high-speed polling is not required.
Page 841
' ab[2] 0x2220 03 08 a=572523272 SDOWR(1,5632,1,4,a) ' 0x1600 rx ' ab[3] 0x2220 04 08 a=572523528 SDOWR(1,6656,1,4,a) ' 0x1a00 tx ' aw[32] 0x2221 01 10 ' aw[32] is 1st analog voltage input Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 841 of 909...
Page 842
Z(10,2) ' Clear event flag PRINT("Rx PDO 2",#13) ENDIF B(10,3)==1 Z(10,3) ' Clear event flag PRINT("Rx PDO 3",#13) ENDIF B(10,4)==1 Z(10,4) ' Clear event flag PRINT("Rx PDO 4",#13) ENDIF B(10,5)==1 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 842 of 909...
Page 843
' Set the User Bits in Status Word 12 to reflect the status of the 8 inputs UO(W,0)=ab[2]&255 ' Turn on outputs (continuous count up) ab[3]=ab[3]+(1*b) ' Set the User Bits in Status Word 13 to reflect the status of the 8 outputs UO(W,1)=ab[3]&254 WAIT=100 LOOP Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 843 of 909...
Page 844
This program makes use of CANopen objects to provide following of a CANopen encoder on a CANopen network. For the purposes of an example, one SmartMotor acts as a "master", and a second SmartMotor can act as the encoder if a CANopen encoder is not available.
Page 845
PRINT("Multi-turn absolute rotary encoder.",#13) BREAK CASE PRINT("Single-turn absolute rotary encoder ") PRINT("with electronic turn-count.",#13) BREAK CASE PRINT("Incremental rotary encoder.",#13) BREAK CASE PRINT("Incremental rotary encoder with electronic counting.",#13) BREAK CASE PRINT("Incremental linear encoder.",#13) BREAK Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 845 of 909...
Page 846
' We want the max value, not the number of steps. CAN(4)!=0 PRINT("Failed to read encoder range.",#13) ENDIF ENDIF t==2 rrr=-1 ' Smartmotor, which is the range 0x00000000 to 0xffffffff. ENDIF t==0 PRINT("This type not supported, ending now.",#13) ENDIF Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 846 of 909...
Page 847
' set Transmit Com Parameter ' on every Synch x000 0001 SDOWR(eee,x1A01,0,1,0) GOSUB10 ' set Transmit map number of ' entries x00 SDOWR(eee,x1A01,1,4,1617166368) GOSUB10 ' set Transmit map x6064 00 20 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 847 of 909...
Page 848
PRINT("Follow motor: re-starting X.",#13) G(2) ' Restart following ELSE ' Some other motor is the follow motor. ' ... ENDIF ELSEIF CADDR==eee ' We are a motor pretending to be the encoder. WAIT=500 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 848 of 909...
Page 849
PRINT("SmartMotor acting as encoder: starting motion.",#13) VT=100000 ADT=50 ' A simple constant motion. ' Follow motor is already started and will follow exactly. PRINT("SmartMotor acting as encoder: ") PRINT("running for 10 seconds.",#13) WAIT=10000 PRINT("SmartMotor acting as encoder: freewheel.",#13) BRKRLS OFF...
Page 850
100925511 PRINT(" General internal incompatibility in the device.") BREAK CASE 101056512 PRINT(" Access failed due to an hardware error.") BREAK CASE 101122064 PRINT(" Data type mismatch, length of service parameter.") Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 850 of 909...
Page 851
' One of the CANopen errors PRINT(" Consult CANopen error list.") ELSE ' One of our error, but not included in the list above. ENDIF BREAK ENDS PRINT(#13) RETURN Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 851 of 909...
Page 852
'Set the speed to 500000. PRT=22.5*GearOutputPosition 'Results in 22.5 rotations of gear head 'output shaft. VT=JogSpeed 'Set the speed to 10000. C100 'Place the home routine code here PRINT("Home Routine Called",#13) RETURN Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 852 of 909...
Page 853
Part 3: Examples: Text Replacement in an SMI Program PRINT("Subroutine",x," called",#13) RETURN Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 853 of 909...
Page 854
Appendix Appendix This appendix provides related information for use with the SmartMotor. With the exception of the Motion Command Quick Reference on page 856, all other topics are listed in alphabetical order. Motion Command Quick Reference Array Variable Memory Map ASCII Character Set...
Page 855
Supply Voltage Effects on Torque Curves and Motor Response: Example 1: Rotary Application Example 2: Linear Application Dyno Test Data vs. the Derated Torque Curve Proper Sizing and Loading of the SmartMotor Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 855 of 909...
Page 856
RES command. The RRES command will report encoder resolution. You can also use the RES command directly in math formulas. EXAMPLE: If you want it the axis to move to location 1234, then you would issue: PT=1234 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 856 of 909...
Page 857
RBt would report a 1 (while moving) because the trajectory is active. After the move has completed, RBt would report a 0 (to indicate the trajectory is no longer active). Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 857 of 909...
Page 858
Long (32-bit signed) Word (16-bit signed) Bytes (8-bit signed) aw[n] where n is: ab[n] where n is: al[n] where n is: middle bytes Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 858 of 909...
Page 859
Integer Variable Memory Non-Overlapping: Name Quantity Type 32-bit signed aa-zz 32-bit signed aaa-zzz 32-bit signed 78 total letter variables Float Variable Memory: Name Quantity Type af[0]-af[7] 64 bit IEEE-754 8 total floating-point variables Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 859 of 909...
Page 860
If a SmartMotor is asked its position over the RS-232 connection, and it is at position 1, it will not return a byte of value one, but instead will return the ASCII code for 1 which is binary value 49.
Page 861
Appendix: Binary Data Binary Data The SmartMotor language allows the programmer to access data at the binary level. Understanding binary data is useful when programming the SmartMotor or any electronic device. The following is an explanation of how binary data works.
Page 862
To make use of the limited memory available with micro controllers that can fit into a SmartMotor, there are occasions where every bit is used. One example is Status Word 0. A single value can be uploaded from a SmartMotor and be binary coded with eight, sixteen or thirty-two independent bits of information.
Page 863
'Execute subroutine ENDIF Example 4: IN(W,0,3) 'Look at both inputs 0 and 1 GOSUB200 'Execute subroutine ENDIF Both examples 3 and 4 accomplish the same task with different levels of efficiency. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 863 of 909...
Page 864
INVALID_INTERRUPT EITR command for interrupt not defined) NO_PERMISSION Operation or memory range is not user-accessible OPERATION_FAILED General error MATH_OVERFLOW CMD_TIMEOUT Combitronics timeout IO_NOT_PRESENT NO_CROSS_AXIS_SUPPORT BAD_MOTOR_STATE BAD_CROSS_AXIS_ID BAD_COMBITRONIC_FCODE BAD_COMBITRONIC_SFCODE EE_WRITE_QUEUE_FULL CAM_FULL Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 864 of 909...
Page 865
Code Description Notes CMD_COMM0 RS-232 for D-style, RS-485 for M-style CMD_COMM1 RS-485 for D-style only CMD_PROG From downloaded program CMD_CAN CAN port (CANopen, DeviceNet , Combitronic) or PROFIBUS CMD_MB0 CMD_MB1 Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 865 of 909...
Page 866
The output is then adjusted to reach the desired condition. In motion control, the term typically describes a system utilizing a velocity and/or position transducer to generate correction signals in relation to desired parameters. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 866 of 909...
Page 867
A passive technique for stopping a permanent magnet brush or brushless motor. The motor windings are shorted together through a resistor which results in motor braking with an exponential decrease in speed. Efficiency The ratio of power output to power input. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 867 of 909...
Page 868
Holding torque (sometimes called static torque) specifies the maximum external torque that can be applied to a stopped, energized motor without causing the rotor to move. Typically used as a feature specification when comparing motors. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 868 of 909...
Page 869
The device that is controlling the downstream device(s), or slave(s). For example, it could be a PLC controlling one or more SmartMotors and other devices (e.g., via fieldbus communications), a SmartMotor controlling other SmartMotors (e.g., Combitronic communications). Master, in follow mode or cam mode, refers to the encoder source input.
Page 870
Repeatability The degree to which a parameter such as position or velocity can be duplicated. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 870 of 909...
Page 871
SmartMotors and other devices being controlled by a PLC (e.g., via fieldbus communications), one or more SmartMotors being controlled by a SmartMotor (e.g., Combitronic communications). Slave, in follow mode or cam mode, refers to the intermediate counts produced by the trapezoidal move profile.
Page 872
The shape of the voltage waveform depends on the specific motor design. For example, in a brushless motor, the wave shape may be trapezoidal or sinusoidal. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 872 of 909...
Page 873
Appendix: Math Operators Math Operators The following table shows the math operators that are available for the SmartMotor. Operator Description Basic operations: Subtract Multiply Divide Logical operations: > Greater than < Less than Equal to Less than or equal to <=...
Page 874
Matching Motor to Load A common rule of thumb for SmartMotor sizing is that the load should have no more than ten times the Moment of Inertia of the motor rotor that is driving it. This provides a good starting point and typically allows for safe sizing over a wide range of applications.
Page 875
RCHN(n) or =CHN(n) where n is the id of the serial port. Returns an integer. Only the lower four bits indicate the state of the error Description Value Bit Buffer Overflow Error Framing Error Parity Error Timeout Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 875 of 909...
Page 876
'Sets the variable x equal to the value of the current mode. IF MODE==1 'Executes the IF structure when mode equals the specified value. WHILE MODE==4 'Executes the WHILE loop when the mode equals the specified value. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 876 of 909...
Page 877
NOTE: This feature is not available for Class 6 SmartMotors. The SmartMotor controllers default to 8000 samples per second, but it is adjustable by use of the PID command. The command PID2 is the default. However, the commands PID1, PID4, and PID8 are also available.
Page 878
If you wish to calculate Acceleration in real world units from native units: NOTE: At this time, there is no method for reporting actual real-time acceleration in Class 5 SmartMotors. The previous equation may be used with either AT or DT. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 878 of 909...
Page 879
Zl, ZS 8192 RB(0,13) =B(0,13) Negative) (W,3), FSA() Right ( + or Positive) Za, ZS 16384 RB(0,14) =B(0,14) RIN(2) Limit Asserted Left Limit ( - or Negative) 32768 RB(0,15) =B(0,15) RIN(3) Asserted Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 879 of 909...
Page 882
1. Defaults as health check of internal encoder. Other use depends on encoder mode (ENC0 or ENC1) and firmware version. Set due to hardware problems with internal encoder (or external encoder when in ENC1 mode). Contact factory for more details. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 882 of 909...
Page 884
1–5, after the event hander part of the user program is executed. Bit 0 cannot be cleared—it is an indication of the master status. NOTE: The ZS command will have no effect on these bits. Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 884 of 909...
Page 885
12 RB(13,12) =B(13,12) US(28), UR(28) User Bit 29 8192 13 RB(13,13) =B(13,13) US(29), UR(29) User Bit 30 16384 14 RB(13,14) =B(13,14) US(30), UR(30) User Bit 31 32768 15 RB(13,15) =B(13,15) US(31), UR(31) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 885 of 909...
Page 888
This limit is either 70ºC or 85ºC depending on the model number. All Class 5 SmartMotor servos are set to 85ºC. Peak Torque Curve (fit to curve)
Page 889
*In some versions of Moog Animatics literature, this was incorrectly shown as "kW". For any given mechanical system being moved by a SmartMotor, it is ideal to ensure the motor is running within its optimum performance range (see the following figure). Through...
Page 890
A best-fit torque curve is created from these data points and is then derated to at least 5% below the worst case data points. The derated curve is shown in the Moog Animatics Product Catalog. This means that within any given model number, every motor sold will perform at or higher than the advertised torque.
Page 891
Proper Sizing and Loading of the SmartMotor It is important to properly calculate load torque to ensure the correct SmartMotor is selected and designed into the application. Consider the following sample figure. If properly sized/loaded, the motor can run at or under the Continuous Torque limit continuously, assuming 25°C ambient temperature.
Page 892
Properly size the motor for the intended application Consider the thermal environment Follow the proper mechanical and environmental implementation For more details on these items, see the SmartMotor Success Checklist in the Moog Animatics Product Catalog. Also, refer to the following topics in this section: Understanding Torque Curves on page 888 Dyno Test Data vs.
Page 893
Bi(enc) Bit, Index Capture, Rising (see page 304) Bj(enc) Bit, Index Capture, Falling (see page 307) Bk Bit, Program EEPROM Data Status (see page 310) Bl Bit, Left Hardware Limit, Historical (see page 311) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 893 of 909...
Page 894
DEL=formula Derivative Error Limit (see page 384) DELM(arg) Derivative Error Limit Mode (see page 386) DFS(value) Dump Float, Single (see page 387) DITR(int) Disable Interrupts (see page 388) DT=formula Deceleration Target (see page 390) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 894 of 909...
Page 895
GOSUB(label) Subroutine Call (see page 463) GOTO(label) Branch Program Flow to a Label (see page 465) GS Start Synchronized Motion (GO Synchronized) (see page 467) HEX(index) Decimal Value of a Hex String (see page 469) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 895 of 909...
Page 896
MFA(distance[,m/s]) Mode Follow Ascend (see page 550) MFCTP(arg1,arg2) Mode Follow Control Traverse Point (see page 553) MFD(distance[,m/s]) Mode Follow Descend (see page 555) MFDIV=formula Mode Follow Divisor (see page 558) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 896 of 909...
Page 897
PRT=formula Position, Relative Target (see page 652) PRTS(...) Position, Relative Target, Synchronized (see page 654) PRTSS(...) Position, Relative Target, Synchronized, Supplemental (see page 656) PT=formula Position, (Absolute) Target (see page 658) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 897 of 909...
Page 898
TALK1 Talk on Communications Port 1 (see page 734) TAN(value) Tangent (see page 736) TEMP, TEMP(arg) Temperature, Motor (see page 738) TH=formula Temperature, High Limit (see page 740) TMR(timer,time) Timer (see page 743) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 898 of 909...
Page 899
Zs Reset Command Syntax Error Flag (see page 817) ZS Global Reset System State Flag (see page 818) Zv Reset Velocity Limit Fault (see page 821) Zw Reset Encoder Wrap Status Flag (see page 822) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 899 of 909...
Page 900
NOTE: A superscript "R" character preceding the command indicates there is a corresponding "report" version of that command. Communications Control Data Conversion EEPROM (Nonvolatile Memory) I/O Control Math Function Motion Control Program Access Program Execution and Flow Control Reset Commands System Variables Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 900 of 909...
Page 901
TALK1 Talk on Communications Port 1 (see page 734) USB(arg) USB Status Word (see page 766) WAKE Wake Communications Port 0 (see page 797) WAKE1 Wake Communications Port 1 (see page 799) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 901 of 909...
Page 902
OC(...) Output Condition (see page 599) OF(...) Output Fault (see page 603) OR(value) Output, Reset (see page 607) OS(...) Output, Set (see page 609) OUT(...)=formula Output, Activate/Deactivate (see page 613) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 902 of 909...
Page 903
DT=formula Deceleration Target (see page 390) DTS=formula Deceleration Target, Synchronized (see page 392) EA Error Actual (see page 394) ECS(counts) Encoder Count Shift (see page 403) EL=formula Error Limit (see page 419) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 903 of 909...
Page 904
MFR Mode Follow Ratio (see page 570) MFSDC(distance,mode) Mode Follow, Stall-Dwell-Continue (see page 573) MFSLEW(distance[,m/s]) Mode Follow Slew (see page 575) MINV(arg) Mode Inverse (Commutation Inverse) (see page 577) MODE Mode Operating (see page 579) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 904 of 909...
Page 905
VC Velocity Commanded (see page 776) VL=formula Velocity Limit (see page 778) VT=formula Velocity Target (see page 788) VTS=formula Velocity Target, Synchronized Move (see page 791) X Decelerate to Stop (see page 804) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 905 of 909...
Page 906
TSWAIT Trajectory Synchronized Wait (see page 749) TWAIT(gen#) Trajectory Wait (see page 750) WAIT=formula Wait for Specified Time (see page 795) WHILE formula While Condition Program Flow Control (see page 801) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 906 of 909...
Page 907
Bv Bit, Velocity Limit (see page 342) Bw Bit, Wrapped Encoder Position (see page 344) Bx(enc) Bit, Index Input, Real-Time (see page 346) CLK=formula Millisecond Clock (see page 363) ERRC Error Code, Command (see page 441) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 907 of 909...
Page 908
32-Bit Variables (see page 241) ab[index]=formula Array Byte [index] (see page 245) af[index]=formula Array Float [index] (see page 261) al[index]=formula Array Long [index] (see page 272) aw[index]=formula Array Word [index] (see page 288) Moog Animatics SmartMotor™ Developer's Guide, Rev. L Page 908 of 909...
Need help?
Do you have a question about the SmartMotor and is the answer not in the manual?
Questions and answers