SmartMotor Overview
The SmartMotor is an integrated servo control system combining a controller, amplifier, and encoder within a servo motor. It operates using power and either an internal program or external serial commands. Key motion parameters include target position, maximum velocity, and acceleration, managed by a PID filter for precise control.
Motion Control Functions
The motor's controller uses a PID filter to maintain position, updating over 4,000 times per second. It can dynamically adjust position, velocity, and acceleration, follow encoder signals, interpolate positions, and perform complex contours with external coordination.
System Control Functions
The SmartMotor can be programmed in a BASIC-like language, offering flexibility and potentially eliminating the need for a PLC. It supports various I/O functions for interaction with peripherals like sensors and other SmartMotors.
Communication Functions
Standard communication ports include RS-232 and RS-485, with options for networks like CANopen, DeviceNET, and Ethernet. Commands are interpreted from ASCII text, with serial commands taking priority over internal program commands.
I/O Functions
The SmartMotor's I/O ports offer digital and analog capabilities, with each I/O point having a pre-assigned variable name for programming.
Quick Start GuideTo operate the SmartMotor, you need a SmartMotor, a compatible computer, a DC
power supply, a data cable, and host software. The SMDEVPACK is recommended for first-time users, including necessary cables and software.
Software Installation
Install the SMI software from a CD-ROM or download from the Animatics website. After installation, restart the computer before running the SMI program.
SmartMotor Interface (SMI)
The SMI software connects SmartMotors to a computer, allowing direct control and monitoring. Users can write and download programs into the SmartMotor's memory.
Learning the SMI Interface
The SMI main screen includes a menu, Configuration Window, Information Window, and Terminal Window. Users can monitor motor status via the "Motor View" tool and redefine limit inputs if necessary.
Initiating Motion
Instructions are provided for setting acceleration, velocity, and position to initiate motor movement. Users can write and save programs using the SMI program editing window, with guidance on transmitting programs to the SmartMotor.
Tuning the Motor
The document explains PID filter tuning to improve motor performance, including adjusting proportional, derivative, and integral gains.
Creating Motion and Program Flow
Detailed commands for creating motion and managing program flow are listed, including setting acceleration, velocity, and position, as well as program execution and subroutine management.
Variables and Reporting Commands
Information on variable storage, EEPROM pointers, and reporting commands is provided, along with encoder and pulse train following instructions.
Inputs and Outputs
The document covers RS-232 port functions, general I/O functions, and the AnaLink port using I2C and RS-485 protocols.
Communications
Communication protocols such as RS-232 and RS-485 are discussed, including daisy chaining and setting motor addresses. Commands like SADDR#, SLEEP, WAKE, and ECHO are explained for managing communication states.
Programming
The programming section includes commands for motion control, such as setting acceleration (A=), velocity (V=), and position (P=). It explains the use of commands like G (Go), S (Stop), and X (Decelerate) for motion execution.
PID Filter and Current Limit Control
The PID filter section discusses tuning for optimal control, while the current limit control section provides commands for managing motor current limits to prevent damage.
Motion Creation
Detailed instructions are provided for creating motion, including setting absolute and relative positions, and using binary data transfer for efficient communication.
Contouring Mode
The contouring mode allows for complex motion profiles using G-Code interfaces. It enables multiple SmartMotors to perform linear, circular, and helical interpolations, facilitating advanced multi-axis motion control.
Key Considerations
The document emphasizes the importance of clearing errors before executing certain commands, the impact of encoder counts on motion parameters, and the need for careful management of motor limits to avoid damage.
SmartMotor Q Command Response
The SmartMotor responds to the Q command with a 249-byte format, providing status, clock, and buffer space information.
Delta Calculations
Position and time data differences, or "deltas," are calculated with time deltas limited to 16 bits and position deltas to 23 bits.
Status Byte Construction
The status byte indicates various conditions such as mode pending, running, invalid deltas, data space errors, and buffer overflows or underflows.
Trajectory Termination
Trajectories terminate on position errors, invalid data, or buffer issues.
Motion Creation Example
Illustrates byte values for constant speed motion segments.
Addressing SmartMotors
Addressing bytes differentiate motors on a network, with a global address option for synchronized data transmission.
Brake Commands
Commands like BRKRLS and BRKENG control brake engagement.
Mode Torque Brake (MTB)
MTB dynamically brakes the motor when off, stopping it abruptly.
Software Limits
Software limits act as virtual switches to interrupt motion if the motor exceeds operational boundaries.
Program Flow Control
Commands like RUN and RUN? manage program execution. GOTO# and C# labels redirect flow, with up to 1000 labels available for program structuring.
Program Execution and Control
The document discusses the use of GOTO and END commands in programming, emphasizing that any program can be structured with a single GOTO for better organization.
Subroutines and Interrupts
Subroutines are managed using GOSUB# and RETURN commands, allowing code reuse and better readability.
Conditional Statements
The document explains the use of IF, ELSE, and ELSEIF commands for conditional testing, with examples provided.
Looping Structures
WHILE and LOOP commands are used for creating loops, with the BREAK command available to exit loops prematurely.
Waiting and Timing
The TWAIT command is used to pause execution during motor movement, while the WAIT command pauses execution for a specified number of sample periods.
Variables and Arrays
Variables in the SmartMotor language are 32-bit signed integers, stored in volatile memory.
Array Variables
The document describes the use of array variables in SmartMotor programming, which can be 8-bit, 16-bit, or 32-bit signed integers.
Buffer Setup
A buffer is used to store data temporarily while the SmartMotor processes it.
Variable Storage
SmartMotors use EEPROM for long-term data storage, which can be accessed using specific commands.
Fixed Variables
The document lists several fixed variables that provide access to SmartMotor functions, such as current position, velocity, and temperature.
Variable Space Restrictions
Certain SmartMotor functions use specific variable spaces, which can impact user programming.
Reporting Commands
A variety of commands are available to report the status and data from the SmartMotor, including position, velocity, and error statuses.
Modes of Operation
The SmartMotor supports several modes of operation, including Follow, Step and Direction, and Cam modes, which allow for advanced control and synchronization with external signals.
SmartMotor Modes and Commands
Mode Follow (MF1, MF2, MF4): Allows the SmartMotor to follow an external encoder with selectable resolutions.
MF0, MS0 Commands
Used to track encoder or step signals without directly following them.
Ratio Commands (MFDIV, MFMUL)
Set the ratio divisor and multiplier for mode follow, allowing for a floating-point ratio calculation.
Encoder and Pulse Train Following
The SM2315D lacks quadrature encoder following capability.
Mode Cam (MC)
Simulates cam motion electronically by programming a cam profile into the SmartMotor.
Cam Mode Commands
CI re-initializes cam parameters at zero crossover, CX provides the current cam index.
Dynamic Cam Reprogramming
Allows changes to cam parameters like Dwell, BASE, and SIZE during operation.
Encoder Select (ENC0, ENC1)
ENC1 uses an external encoder for servoing, while ENC0 defaults to the internal encoder.
System State Flags
Binary values indicating system states, which can be tested and reset using RB and Z commands.
Reset System State Flags
Commands like Za, Zb, and ZS reset specific state flags, ensuring the system does not repeatedly act on the same occurrence.
I/O Points
The SmartMotor provides seven I/O points (UA, UB, UC, etc.) with multiple functions, including digital input/output, analog input, and external encoder inputs.
Specifications
The SmartMotor supports TTL digital inputs/outputs (0 to 5 volts) and 10-bit analog inputs (0 to 1023).
Commands and Functions
The document lists commands for configuring ports, such as setting ports to input or output, reading digital and analog inputs, and controlling motor functions.
Communication Protocols
The document details the use of AniLink (I2C protocol) for expanding digital and analog I/O capabilities.
Interfacing and Expansion
The document discusses interfacing with external devices using AniLink and RS-485, including the use of additional I/O cards and peripheral devices like LCD displays and push-wheel banks for user interfaces.
Best Practices
Recommendations include designing systems such that +5V is OFF and 0V is ON to prevent unintended activation of external devices upon power-up.
Limitations
The document notes that certain features, such as secondary RS-485 and AniLink, are not available on all models.
Printers and Communication
The document provides an example program for transmitting messages between devices, specifically SmartMotors.
PID Filter ControlThe document explains the PID (Proportional, Integral, Derivative) filter used in SmartMotors for precise control of brushless D.C.
servomotors.
Tuning the PID Filter
Tuning involves increasing the proportional coefficient (KP) for system stiffness, adjusting the derivative coefficient (KD) for stability, and setting the integral coefficient (KI) to compensate for friction.
Current Limit Control
The document discusses setting a current limit to prevent damage to mechanisms by limiting the motor's torque output.
SMI Software
The document outlines the capabilities of the SMI software, which facilitates communication with SmartMotors, program creation, and testing.
Configuration Window
The Configuration Window is crucial for organizing multiple SmartMotor systems.
Program Editor
The SMI Program Editor is used for writing and editing SmartMotor programs.
Information Window
This window displays program status and errors.
Serial Data Analyzer
This tool provides a detailed view of data exchanged between the PC and SmartMotor, useful for debugging communications.
Motor View
The Motor View Window offers real-time monitoring of motor parameters.
Monitor and Chart View
These tools allow users to create custom monitors and graphical representations of data.
Macros
Users can create macros to associate commands with keyboard shortcuts, streamlining development processes.
Tuner
The SMI Tuner simplifies the tuning of SmartMotors by graphically displaying step responses and allowing parameter adjustments to improve motor performance.
SMI Options and Help
The software offers customization options and a comprehensive help facility for accessing detailed information on SMI functions.
Appendix A - ASCII Character Set
This section explains the ASCII character set used for data interchange.
Binary Data Explanation
The document concludes with an explanation of binary data, describing how bits are organized to represent more complex data structures.
Binary Data Representation
A byte consists of 8 bits, each with a value that is double the previous one, starting from 1.
Status Byte Encoding
The status byte in a SmartMotor uses each bit to represent different statuses.
Binary Operators
The document explains the use of binary operators "&" (AND) and "|" (OR) to manipulate binary data.
Code Optimization Examples
Examples are provided to demonstrate how using binary operators can shorten and speed up code execution.
Command Reference
The document includes an extensive list of commands related to SmartMotor operations.
Technical Document Summary
1. Specifications and Commands
This section lists various commands used for controlling and monitoring motor operations.
2. Example Programs
This section provides example programs for various motor operations.
3. Appendices
Appendix C: Detailed list of commands for motor control.
Appendix D: Data variables memory map.
Appendix E: Example programs illustrating various motor control scenarios.
Specifications and Parameters
- KP=200: Increase stiffness from default.
- KD=1000: Increase dampening from default.
- A=100: Set maximum acceleration.
- V=1000000: Set maximum velocity.
- P=1000000: Set final position.
- MP: Set Position Mode.
- F: Activate new tuning parameters.
- UB=1: Preset future output value.
- UBO: Set I/O B to output, high.
Procedures
- Start motion with 'G'.
- Use a loop to continue motion while a condition is met (e.g., @P<250000).
- Stop motion if voltage drops below 18.5 volts.
- Measure command execution time by comparing loop times.
Norms and Recommendations
- Double space indentation within conditional statements or loops for readability.
- Use shadow variables for setting F= commands to avoid clearing other bits.
Example Programs
- SmartMotor motion control with voltage monitoring.
- Command execution time measurement.
- Custom parser with checksum for command differentiation and communication verification.
F= Commands
- F=1: Decelerate to stop on limit trigger.
- F=2: Reverse shaft direction.
- F=4: Redirect prints to channel 1.
- F=8: Clear PID integral term at trajectory end.
- F=16: Use relative positioning in CAM mode.
- F=32: Call subroutine C1 on faults.
- F=64: Trigger subroutine C2 on low transitions of port G.
- F=128: Reset values in Relative Cam Mode.