Galil DMC-4040, DMC-4080 User Manual

DMC-40x0
Manual Rev. 1.0f
USER MANUAL
By Galil Motion Control, Inc.
Galil Motion Control, Inc.
270 Technology Way
Rocklin, California 95765
Phone: (916) 626-0101
E-mail Address: support@galilmc.com
URL: www.galilmc.com
Rev 8/09
Using This Manual
4080
This user manual provides information for proper operation of the DMC-40x0 controller. A separate supplemental manual, the Command Reference, contains a description of the commands available for use with this controller.
Your DMC-40x0 motion controller has been designed to work with both servo and stepper type motors. Installation and system setup will vary depending upon whether the controller will be used with stepper motors or servo motors. To make finding the appropriate instructions faster and easier, icons will be next to any information that applies exclusively to one type of system. Otherwise, assume that the instructions apply to all types of systems. The icon legend is shown below.
Attention: Pertains to servo motor use.
Attention: Pertains to stepper motor use.
Attention: Pertains to controllers with more than 4 axes.
Please note that many examples are written for the DMC-4040 four-axes controller or the DMC-4080 eight axes controller. Users of the DMC-4030 3-axis controller, DMC-4020 2-axes controller or DMC-4010 1-axis controller should note that the DMC-4030 uses the axes denoted as XYZ, the DMC-4020 uses the axes denoted as XY, and the DMC-4010 uses the X-axis only.
Examples for the DMC-4080 denote the axes as A,B,C,D,E,F,G,H. Users of the DMC-4050 5-axes controller. DMC-4060 6-axes controller or DMC-4070, 7-axes controller should note that the DMC-4050 denotes the axes as A,B,C,D,E, the DMC-4060 denotes the axes as A,B,C,D,E,F and the DMC-4070 denotes the axes as A,B,C,D,E,F,G. The axes A,B,C,D may be used interchangeably with A,B,C,D.
WARNING: Machinery in motion can be dangerous! It is the responsibility of the user to design effective error handling and safety protection as part of the machinery. Galil shall not be liable or responsible for any incidental or consequential damages.
DMC-40x0 Contents i

Contents

Contents iii
Chapter 1 Overview 1
Introduction ................................................................................................................... 1
Overview of Motor Types ............................................................................................. 2
Overview of External Amplifiers .................................................................................. 3
Overview of Galil Amplifiers and Drivers ................................................................... 3
DMC-40x0 Functional Elements .................................................................................. 4
Standard Servo Motor with +/- 10 Volt Command Signal ....... 2
Brushless Servo Motor with Sinusoidal Commutation ............. 2
Stepper Motor with Step and Direction Signals ....................... 2
Amplifiers in Current Mode ...................................................... 3
Amplifiers in Velocity Mode .................................................... 3
Stepper Motor Amplifiers ......................................................... 3
A1 – AMP-430x0 (-D3040, -D3020) ........................................ 3
A2 – AMP-43140 (-D3140) ...................................................... 3
A3 – SDM-44040 (-D4040) ...................................................... 3
A4 – SDM-44140 (-D4140) ...................................................... 3
Microcomputer Section ............................................................. 4
Motor Interface ......................................................................... 4
Communication ......................................................................... 4
General I/O ................................................................................ 4
System Elements ....................................................................... 5
Motor ......................................................................................... 5
Amplifier (Driver) ..................................................................... 5
Encoder ..................................................................................... 6
Watch Dog Timer ..................................................................... 6
Chapter 2 Getting Started 7
DMC-4040 Layout ........................................................................................................ 7
DMC-4080 Layout ........................................................................................................ 8
DMC-40x0 Power Connections .................................................................................... 9
DMC-4040 Dimensions ................................................................................................ 10
DMC-4080 Dimensions ................................................................................................ 11
Elements You Need ...................................................................................................... 12
Installing the DMC-40x0 .............................................................................................. 13
Design Examples .......................................................................................................... 25
Step 1. Determine Overall Motor Configuration ...................... 13
Step 2. Install Jumpers on the DMC-40x0 ................................ 14
Step 3. Install the Communications Software ........................... 14
Step 4. Connect 20-80VDC Power to the Controller ................ 15
Step 5. Establish Communications with Galil Software ........... 15
Step 6. Determine the Axes to be Used for Sinusoidal Commutation .......................................................... 17
Step 7. Make Connections to Amplifier and Encoder. ............. 18
Step 8a. Connect Standard Servo Motors ................................. 19
Step 8b. Connect Sinusoidal Commutation Motors .................. 21
Step 8c. Connect Step Motors ................................................... 24
Step 9. Tune the Servo System ................................................. 24
Example 1 - System Set-up ....................................................... 25
Example 2 - Profiled Move ....................................................... 25
DMC-40x0 Contents ii
Example 3 - Multiple Axes ....................................................... 26
Example 4 - Independent Moves .............................................. 26
Example 5 - Position Interrogation ........................................... 26
Example 6 - Absolute Position ................................................. 26
Example 7 - Velocity Control ................................................... 27
Example 8 - Operation Under Torque Limit ............................. 27
Example 9 - Interrogation ......................................................... 27
Example 10 - Operation in the Buffer Mode ............................ 28
Example 11 - Using the On-Board Editor ................................. 28
Example 12 - Motion Programs with Loops ............................. 28
Example 13 - Motion Programs with Trippoints ...................... 29
Example 14 - Control Variables ............................................... 29
Example 15 - Linear Interpolation ............................................ 30
Example 16 - Circular Interpolation ......................................... 30
Chapter 3 Connecting Hardware 32
Overview ....................................................................................................................... 32
Using Optoisolated Inputs ............................................................................................. 32
Wiring the Optoisolated Inputs ..................................................................................... 34
TTL Inputs .................................................................................................................... 37
High Power Opto-Isolated Outputs ............................................................................... 38
Analog Inputs ................................................................................................................ 39
TTL Outputs ................................................................................................................. 39
Extended I/O of the DMC-40x0 Controller ................................................................. 40
Amplifier Interface ........................................................................................................ 41
Limit Switch Input .................................................................... 32
Home Switch Input ................................................................... 33
Abort Input ................................................................................ 33
ELO (Electronic Lock-Out) Input ............................................. 34
Reset Input ................................................................................ 34
Uncommitted Digital Inputs ..................................................... 34
Electrical Specifications ............................................................ 34
Bi-Directional Capability .......................................................... 34
Using an Isolated Power Supply ............................................... 36
Bypassing the Opto-Isolation: ................................................... 37
The Auxiliary Encoder Inputs ................................................... 37
Electrical Specifications ............................................................ 38
Wiring the Opto-Isolated Outputs ............................................. 38
AQ settings ................................................................................ 39
Electrical Specifications ............................................................ 39
Output Compare ........................................................................ 39
Error Output .............................................................................. 39
Electrical Specifications (3.3V – Standard) .............................. 40
Electrical Specifications (5V – Option) .................................... 40
Electrical Specifications ............................................................ 41
Overview ................................................................................... 41
ICM-42000 and ICM-42100 Amplifier Enable Circuit ............ 41
ICM-42200 Amplifier Enable Circuit ....................................... 44
Chapter 4 Software Tools and Communication 48
Introduction ................................................................................................................... 48
RS232 and RS422 Ports ................................................................................................ 48
Ethernet Configuration .................................................................................................. 50
Modbus ......................................................................................................................... 53
Data Record .................................................................................................................. 55
Controller Response to Commands .............................................................................. 61
Unsolicited Messages Generated by Controller ............................................................ 62
RS-232 Configuration ............................................................... 48
RS-422 Configuration ............................................................... 50
Communication Protocols ......................................................... 50
Addressing ................................................................................ 51
Communicating with Multiple Devices .................................... 52
Multicasting .............................................................................. 52
Using Third Party Software ...................................................... 52
Modbus Examples .................................................................... 54
Explanation Data Record Bit Fields ......................................... 60
Notes Regarding Velocity and Torque Information ................. 61
QZ Command ............................................................................ 61
DMC-40x0 Contents iii
GalilTools (Windows and Linux) ................................................................................. 63
Creating Custom Software Interfaces ........................................................................... 65
DOS, and QNX tools .................................................................................................... 69
Chapter 5 Command Basics 70
Introduction ................................................................................................................... 70
Command Syntax - ASCII ............................................................................................ 70
Command Syntax – Binary (advanced) ........................................................................ 72
Controller Response to DATA ...................................................................................... 74
Interrogating the Controller .......................................................................................... 74
Chapter 6 Programming Motion 76
Overview ....................................................................................................................... 76
Independent Axis Positioning ....................................................................................... 78
Independent Jogging ..................................................................................................... 80
Position Tracking .......................................................................................................... 81
Linear Interpolation Mode ............................................................................................ 86
Vector Mode: Linear and Circular Interpolation Motion ............................................. 91
Electronic Gearing ........................................................................................................ 95
Ramped Gearing ........................................................................................................... 96
Electronic Cam .............................................................................................................. 99
PVT Mode ..................................................................................................................... 105
HelloGalil – Quick Start to PC programming ........................... 65
GalilTools Communication Libraries ....................................... 65
ActiveX Toolkit ........................................................................ 66
DMCWin Programmers Toolkit ............................................... 66
Galil Communications API with C/C++ ................................... 67
Galil Communications API with Visual Basic ........................ 67
Coordinated Motion with more than 1 axis .............................. 71
Binary Command Format ......................................................... 72
Binary command table .............................................................. 73
Interrogation Commands .......................................................... 74
Summary of Interrogation Commands ...................................... 75
Interrogating Current Commanded Values. .............................. 75
Operands ................................................................................... 75
Command Summary ................................................................. 75
Command Summary - Independent Axis .................................. 78
Operand Summary - Independent Axis .................................... 78
Command Summary - Jogging ................................................ 80
Operand Summary - Independent Axis .................................... 81
Example - Motion 2: ............................................................... 83
Example Motion 4 ................................................................... 84
Trip Points ................................................................................. 85
Command Summary – Position Tracking Mode ..................... 86
Specifying Linear Segments ..................................................... 86
Command Summary - Linear Interpolation .............................. 88
Operand Summary - Linear Interpolation ................................ 88
Example - Linear Move ............................................................ 89
Example - Multiple Moves ....................................................... 90
Specifying the Coordinate Plane ............................................... 91
Specifying Vector Segments ..................................................... 91
Additional commands ............................................................... 92
Command Summary - Coordinated Motion Sequence ............. 94
Operand Summary - Coordinated Motion Sequence ................ 94
Example – Electronic Gearing Over a Specified Interval ......... 97
Command Summary - Electronic Gearing ................................ 98
Example - Simple Master Slave ................................................ 98
Example - Electronic Gearing ................................................... 98
Example - Gantry Mode ............................................................ 98
Command Summary - Electronic CAM ................................... 103
Operand Summary - Electronic CAM ...................................... 103
Example - Electronic CAM ...................................................... 103
Specifying PVT Segments ........................................................ 105
Exiting PVT Mode .................................................................... 105
Error Conditions and Stop Codes ............................................. 105
Additional PVT Information ..................................................... 105
Command Summary – PVT ...................................................... 106
PVT Examples .......................................................................... 106
DMC-40x0 Contents iv
Contour Mode ............................................................................................................... 110
Stepper Motor Operation .............................................................................................. 115
Stepper Position Maintenance Mode (SPM) ................................................................. 117
Dual Loop (Auxiliary Encoder) .................................................................................... 120
Motion Smoothing ....................................................................................................... 122
Homing ......................................................................................................................... 124
High Speed Position Capture (The Latch Function) .................................................... 127
Fast Update Rate Mode ................................................................................................ 129
Chapter 7 Application Programming 130
Overview ....................................................................................................................... 130
Using the DMC-40x0 Editor to Enter Programs ........................................................... 130
Program Format ............................................................................................................ 131
Executing Programs - Multitasking .............................................................................. 133
Debugging Programs .................................................................................................... 134
Program Flow Commands ............................................................................................ 135
Mathematical and Functional Expressions ................................................................... 149
Variables ....................................................................................................................... 151
Operands ....................................................................................................................... 153
Arrays ............................................................................................................................ 154
Input of Data (Numeric and String) .............................................................................. 157
Output of Data (Numeric and String) ........................................................................... 160
Multi-Axis Coordinated Move .................................................. 108
Specifying Contour Segments ................................................... 110
Additional Commands .............................................................. 111
Command Summary - Contour Mode ...................................... 111
Specifying Stepper Motor Operation ....................................... 115
Using an Encoder with Stepper Motors .................................... 116
Command Summary - Stepper Motor Operation ..................... 116
Operand Summary - Stepper Motor Operation ......................... 116
Internal Controller Commands (user can query): ..................... 117
User Configurable Commands (user can query & change): ..... 117
Error Limit ................................................................................ 117
Correction ................................................................................. 117
Backlash Compensation ............................................................ 121
Using the IT Command: ............................................................ 122
Using the KS Command (Step Motor Smoothing): .................. 124
Stage 1: ...................................................................................... 124
Stage 2: ...................................................................................... 124
Stage 3: ...................................................................................... 124
Command Summary - Homing Operation ............................... 127
Operand Summary - Homing Operation ................................... 127
Edit Mode Commands .............................................................. 131
Using Labels in Programs ......................................................... 131
Special Labels ........................................................................... 132
Commenting Programs ............................................................. 132
Event Triggers & Trippoints ..................................................... 135
Event Trigger Examples: .......................................................... 137
Conditional Jumps .................................................................... 139
Using If, Else, and Endif Commands ........................................ 141
Subroutines ............................................................................... 142
Stack Manipulation ................................................................... 142
Auto-Start Routine .................................................................... 143
Automatic Subroutines for Monitoring Conditions .................. 143
JS Subroutine Stack Variables (^a, ^b, ^c, ^d, ^e, ^f, ^g, ^h) ... 147
Mathematical Operators ............................................................ 149
Bit-Wise Operators ................................................................... 150
Functions .................................................................................. 151
Programmable Variables ........................................................... 152
Special Operands (Keywords) .................................................. 153
Defining Arrays ........................................................................ 154
Assignment of Array Entries .................................................... 154
Automatic Data Capture into Arrays ........................................ 155
De-allocating Array Space ........................................................ 157
Input of Data ............................................................................. 157
Operator Data Entry Mode ....................................................... 158
Using Communication Interrupt .............................................. 158
Sending Messages ..................................................................... 160
Displaying Variables and Arrays ............................................. 161
DMC-40x0 Contents v
Interrogation Commands .......................................................... 162
Formatting Variables and Array Elements ............................... 163
Hardware I/O ................................................................................................................ 164
Extended I/O of the DMC-40x0 Controller ................................................................. 168
Example Applications ................................................................................................... 169
Chapter 8 Hardware & Software Protection 177
Introduction ................................................................................................................... 177
Hardware Protection ..................................................................................................... 177
Software Protection ....................................................................................................... 178
Converting to User Units .......................................................... 164
Digital Outputs .......................................................................... 164
Digital Inputs ............................................................................ 165
The Auxiliary Encoder Inputs ................................................... 166
Input Interrupt Function ............................................................ 166
Analog Inputs ............................................................................ 167
Configuring the I/O of the DMC-40x0 ..................................... 168
Saving the State of the Outputs in Non-Volatile Memory ........ 168
Accessing Extended I/O ............................................................ 169
Wire Cutter ................................................................................ 169
X-Y Table Controller ................................................................ 170
Speed Control by Joystick ........................................................ 173
Position Control by Joystick ..................................................... 174
Backlash Compensation by Sampled Dual-Loop ..................... 174
Output Protection Lines ............................................................ 177
Input Protection Lines ............................................................... 178
Programmable Position Limits ................................................. 179
Off-On-Error ............................................................................. 179
Automatic Error Routine ........................................................... 179
Limit Switch Routine ................................................................ 180
Chapter 9 Troubleshooting 181
Overview ....................................................................................................................... 181
Installation ..................................................................................................................... 181
Stability ......................................................................................................................... 182
Operation ....................................................................................................................... 182
Chapter 10 Theory of Operation 183
Overview ....................................................................................................................... 183
Operation of Closed-Loop Systems .............................................................................. 185
System Modeling .......................................................................................................... 186
System Analysis ............................................................................................................ 191
System Design and Compensation ................................................................................ 193
Appendices 197
Electrical Specifications ................................................................................................ 197
Performance Specifications .......................................................................................... 199
Fast Update Rate Mode ................................................................................................ 200
Ordering Options for the DMC-40x0 ........................................................................... 201
Motor-Amplifier ....................................................................... 187
Encoder ..................................................................................... 189
DAC .......................................................................................... 189
Digital Filter .............................................................................. 190
ZOH .......................................................................................... 191
The Analytical Method ............................................................. 193
Servo Control ............................................................................ 197
Stepper Control ......................................................................... 197
Input / Output ............................................................................ 197
Power Requirements ................................................................. 198
Max Power Output .................................................................... 198
Minimum Servo Loop Update Time: ........................................ 199
Overview ................................................................................... 201
DMC-40x0 Controller Board Options ...................................... 201
CMB Communication Board Options ...................................... 202
ICM Interconnect Board Options .............................................. 202
AMP Internal Amplifier Options .............................................. 204
DMC-40x0 Contents vi
Power Connectors for the DMC-40x0 .......................................................................... 205
Cable Connections for DMC-40x0 ............................................................................... 206
Pin-Out Description for DMC-40x0 ............................................................................. 208
Configuring the Amplifier Enable Circuit .................................................................... 210
Coordinated Motion - Mathematical Analysis ............................................................. 225
Example- Communicating with OPTO-22 SNAP-B3000-ENET ................................. 228
DMC-40x0/DMC-2200 Comparison ............................................................................ 230
List of Other Publications ............................................................................................. 231
Training Seminars ......................................................................................................... 231
Contacting Us ................................................................................................................ 232
WARRANTY ............................................................................................................... 233
Integrated Components 234
Overview ....................................................................................................................... 234
Overview ................................................................................... 205
Molex Part Numbers Used ........................................................ 205
Standard RS-232 Specifications ............................................... 206
DMC-40x0 Serial Cable Specifications .................................... 207
ICM-42000 and ICM-42100 ..................................................... 210
DMC-4040 (Steps 1 and 2) ....................................................... 210
DMC-4080 (Steps 1 and 2) ....................................................... 212
DMC-4040 and DMC-4080 (Step 3) ........................................ 214
DMC-4040 (Steps 4 and 5) ....................................................... 221
DMC-4080 (Steps 4 and 5) ....................................................... 223
A1 – AMP-430x0 (-D3040,-D3020) 2- and 4-axis 500W Servo Drives .................................................... 234
A2 – AMP-43140 (-D3140) 4-axis 20W Linear Servo Drives 234
A3 – SDM-44040 (-D4040) 4-axis Stepper Drives ................. 234
A4 – SDM-44140 (-D4140) 4-axis Microstep Drives .............. 234
A5 – CMB-41012 (-C012) Communications Board ................. 234
A6 – ICM-42000 (-I000) Interconnect Module ........................ 234
A7 – ICM-42100 (-I100) Sinusoidal Encoder Interpolation Module ......................................................... 235
A8 – ICM-42200 (-I200) Interconnect Module ........................ 235
A1 – AMP-430x0 (-D3040,-D3020) 236
Description .................................................................................................................... 236
Electrical Specifications ................................................................................................ 237
Operation ....................................................................................................................... 238
A2 – AMP-43140 (-D3140) 242
Description .................................................................................................................... 242
Electrical Specifications ................................................................................................ 243
Operation ....................................................................................................................... 244
A3 – SDM-44040 (-D4040) 245
Description .................................................................................................................... 245
Electrical Specifications ................................................................................................ 246
Operation ....................................................................................................................... 247
Mating Connectors .................................................................... 237
Brushless Motor Setup .............................................................. 238
Brushless Amplifier Software Setup ......................................... 238
Chopper Mode .......................................................................... 238
Brush Amplifier Operation ....................................................... 239
Using External Amplifiers ........................................................ 239
Error Monitoring and Protection ............................................... 239
Hall Error Protection ................................................................. 240
Under-Voltage Protection ......................................................... 240
Over-Voltage Protection ........................................................... 240
Over-Current Protection ............................................................ 240
Over-Temperature Protection ................................................... 241
ELO Input ................................................................................. 241
Mating Connectors .................................................................... 243
Using External Amplifiers ........................................................ 244
ELO Input ................................................................................. 244
-SSR Option .............................................................................. 244
Mating Connectors .................................................................... 246
Current Level Setup (AG Command) ....................................... 247
DMC-40x0 Contents vii
Low Current Setting (LC Command) ....................................... 247
Step Drive Resolution Setting (YA command) ........................ 247
ELO Input ................................................................................. 248
A4 – SDM-44140 (-D4140) 249
Description .................................................................................................................... 249
Electrical Specifications ................................................................................................ 250
Operation ....................................................................................................................... 251
A5 – CMB-41012 (-C012) 252
Description .................................................................................................................... 252
Connectors for CMB-41012 Interconnect Board ......................................................... 252
A6 – ICM-42000 (-I000) 256
Description .................................................................................................................... 256
Connectors for ICM-42000 Interconnect Board ........................................................... 256
Mating Connectors .................................................................... 250
Current Level Setup (AG Command) ....................................... 251
Low Current Setting (LC Command) ....................................... 251
ELO Input ................................................................................. 251
CMB-41012 Extended I/O 44 pin HD D-Sub Connector (Male) ............................................................... 252
RS-232-Main Port (Male) ....................................................... 253
RS-232-Auxiliary Port (Female) ............................................... 253
RS-422-Main Port (Non-Standard Option) ............................... 253
RS-422-Auxiliary Port (Non-Standard Option) ........................ 254
Ethernet ..................................................................................... 254
Jumper Description for CMB-41012 ........................................ 255
ICM-42000 I/O (A-D) 44 pin HD D-Sub Connector (Female) 256 ICM-42000 I/O (E-H) 44 pin HD D-Sub Connector (Female) . 257
ICM-42000 External Driver (A-D) 44 pin HD D-Sub Connector (Male) .................................................. 257
ICM-42000 External Driver (E-H) 44 pin HD D-Sub Connector (Male) .................................................. 258
ICM-42000 Encoder 15 pin HD D-Sub Connector (Female) ... 259
ICM-42000 Analog 15 pin D-sub Connector (Male) ............... 259
Jumper Description for ICM-42000 ......................................... 260
A7 – ICM-42100 (-I100) 261
Description .................................................................................................................... 261
Connectors for ICM-42100 Interconnect Board ........................................................... 261
Theory of Operation ...................................................................................................... 266
A8 – ICM-42200 (-I200) 268
Description .................................................................................................................... 268
Connectors for ICM-42200 Interconnect Board ........................................................... 268
Index 271
ICM-42100 I/O (A-D) 44 pin HD D-Sub Connector (Female) 261 ICM-42100 I/O (E-H) 44 pin HD D-Sub Connector (Female) . 262
ICM-42100 External Driver (A-D) 44 pin HD D-Sub Connector (Male) .................................................. 262
ICM-42100 External Driver (E-H) 44 pin HD D-Sub Connector (Male) .................................................. 264
ICM-42100 Encoder 15 pin HD D-Sub Connector (Female) ... 265
ICM-42100 Analog 15 pin D-sub Connector (Male) ............... 265
ICM-42200 I/O (A-D) 44 pin HD D-Sub Connector (Female) 268
ICM-42200 DMC-40x0 I/O (E-H) 44 pin HD D-Sub Connector (Female) ............................................... 269
ICM-42200 Encoder 26 pin HD D-Sub Connector (Female) ... 269
ICM-42200 Analog 15 pin D-sub Connector (Male) ............... 270
Jumper Description for ICM-42000 ......................................... 270
DMC-40x0 Contents viii

Chapter 1 Overview

Introduction

The DMC-40x0 Series are Galil’s highest performance stand-alone controller. The controller series offers many enhanced features including high speed communications, non-volatile program memory, faster encoder speeds, and improved cabling for EMI reduction.
Each DMC-40x0 provides two communication channels: high speed RS-232 (2 channels up to 115K Baud) and 10BaseT Ethernet. The controllers allow for high-speed servo control up to 22 million encoder counts/sec and step
motor control up to 6 million steps per second. Sample rates as low as 31.25 µsec per axis are available.
A Flash EEPROM provides non-volatile memory for storing application programs, parameters, arrays and firmware. New firmware revisions are easily upgraded in the field.
The DMC-40x0 is available with up to eight axes in a single stand alone unit. The DMC-4010, 4020, 4030, 4040 are one thru four axes controllers and the DMC-4050, 4060, 4070, 4080 are five thru eight axes controllers. All eight axes have the ability to use Galil’s integrated amplifiers or drivers and connections for integrating external devices.
Designed to solve complex motion problems, the DMC-40x0 can be used for applications involving jogging, point­to-point positioning, vector positioning, electronic gearing, multiple move sequences, and contouring. The controller eliminates jerk by programmable acceleration and deceleration with profile smoothing. For smooth following of complex contours, the DMC-40x0 provides continuous vector feed of an infinite number of linear and arc segments. The controller also features electronic gearing with multiple master axes as well as gantry mode operation.
For synchronization with outside events, the DMC-40x0 provides uncommitted I/O, including 8 opto-isolated digital inputs (16 inputs for DMC-4050 thru DMC-4080), 8 high power optically isolated outputs (16 outputs for DMC­4050 thru DMC-4080), and 8 analog inputs for interface to joysticks, sensors, and pressure transducers. The DMC­40x0 also has an additional 32 I/O at 3.3V logic. Further I/O is available if the auxiliary encoders are not being used (2 inputs / each axis). Dedicated optoisolated inputs are provided for forward and reverse limits, abort, home, and definable input interrupts.
Commands can be sent in either Binary or ASCII. Additional software is available for automatic-tuning, trajectory viewing on a PC screen, CAD translation, and program development using many environments such as Visual Basic, C, C++ etc. Drivers for Windows XP (32 & 64 bit).
Chapter 1 Overview 1 DMC-40x0 User Manual

Overview of Motor Types

The DMC-40x0 can provide the following types of motor control:
1. Standard servo motors with +/- 10 volt command signals
2. Brushless servo motors with sinusoidal commutation
3. Step motors with step and direction signals
4. Other actuators such as hydraulics - For more information, contact Galil.
The user can configure each axis for any combination of motor types, providing maximum flexibility.

Standard Servo Motor with +/- 10 Volt Command Signal

The DMC-40x0 achieves superior precision through use of a 16-Bit motor command output DAC and a sophisticated PID filter that features velocity and acceleration feed-forward, an extra pole filter and integration limits.
The controller is configured by the factory for standard servo motor operation. In this configuration, the controller provides an analog signal (+/- 10 volts) to connect to a servo amplifier. This connection is described in Chapter 2.

Brushless Servo Motor with Sinusoidal Commutation

The DMC-40x0 can provide sinusoidal commutation for brushless motors (BLM). In this configuration, the controller generates two sinusoidal signals for connection with amplifiers specifically designed for this purpose.
Note: The task of generating sinusoidal commutation may be accomplished in the brushless motor amplifier. If the amplifier generates the sinusoidal commutation signals, only a single command signal is required and the controller should be configured for a standard servo motor (described above).
Sinusoidal commutation in the controller can be used with linear and rotary BLMs. However, the motor velocity should be limited such that a magnetic cycle lasts at least 6 milliseconds with a standard update rate of 1 millisecond. For faster motors, please contact the factory.
To simplify the wiring, the controller provides a one-time, automatic set-up procedure. When the controller has been properly configured, the brushless motor parameters may be saved in non-volatile memory.
The DMC-40x0 can control BLMs equipped with Hall sensors as well as without Hall sensors. If Hall sensors are available, once the controller has been setup, the brushless motor parameters may be saved in non-volatile memory. In this case, the controller will automatically estimate the commutation phase upon reset. This allows the motor to function immediately upon power up. The Hall effect sensors also provide a method for setting the precise commutation phase. Chapter 2 describes the proper connection and procedure for using sinusoidal commutation of brushless motors.

Stepper Motor with Step and Direction Signals

The DMC-40x0 can control stepper motors. In this mode, the controller provides two signals to connect to the stepper motor: Step and Direction. For stepper motor operation, the controller does not require an encoder and operates the stepper motor in an open loop fashion. Chapter 2 describes the proper connection and procedure for using stepper motors.
If encoders are available on the stepper motor, Galil’s Stepper Position Maintenance Mode may be used for automatic monitoring and correction of the stepper position. See Stepper Position Maintenance Mode (SPM) in Chapter 6 for more information.
DMC-40x0 User Manual Chapter 1 Overview 2

Overview of External Amplifiers

The amplifiers should be suitable for the motor and may be linear or pulse-width-modulated. An amplifier may have current feedback, voltage feedback or velocity feedback.

Amplifiers in Current Mode

Amplifiers in current mode should accept an analog command signal in the +/-10 volt range. The amplifier gain should be set such that a +10V command will generate the maximum required current. For example, if the motor peak current is 10A, the amplifier gain should be 1 A/V.

Amplifiers in Velocity Mode

For velocity mode amplifiers, a command signal of 10 volts should run the motor at the maximum required speed. The velocity gain should be set such that an input signal of 10V runs the motor at the maximum required speed.

Stepper Motor Amplifiers

For step motors, the amplifiers should accept step and direction signals.

Overview of Galil Amplifiers and Drivers

With the DMC-40x0 Galil offers a variety of Servo Amplifiers and Stepper Drivers that are integrated into the same enclosure as the controller. Using the Galil Amplifiers and Drivers provides a simple straightforward motion control solution in one box.

A1 – AMP-430x0 (-D3040, -D3020)

The AMP-43040 (four-axis) and AMP-43020 (two-axis) are multi-axis brush/brushless amplifiers that are capable of handling 500 watts of continuous power per axis. The AMP-43040/43020 Brushless drive modules are connected to a DMC-40x0. The standard amplifier accepts DC supply voltages from 18-80 VDC.

A2 – AMP-43140 (-D3140)

The AMP-43140 contains four linear drives for operating small brush-type servo motors. The AMP-43140 requires a ± 12–30 DC Volt input. Output power is 20 W per amplifier or 60 W total. The gain of each transconductance linear amplifier is 0.1 A/V at 1 A maximum current. The typical current loop bandwidth is 4 kHz.

A3 – SDM-44040 (-D4040)

The SDM-44040 is a stepper driver module capable of driving up to four bipolar two-phase stepper motors. The current is selectable with options of 0.5, 0.75, 1.0, and 1.4 Amps/Phase. The step resolution is selectable with options of full, half, 1/4 and 1/16.

A4 – SDM-44140 (-D4140)

The SDM-44140 microstepper module drives four bipolar two-phase stepper motors with 1/64 microstep resolution (the SDM-44140 drives two). The current is selectable with options of 0.5, 1.0, 2.0, & 3.0 Amps per axis.
Chapter 1 Overview 3 DMC-40x0 User Manual

DMC-40x0 Functional Elements

WATCHDOG TIMER RISC BASED
MICROCOMPUTER
HIGH-SPEED
MOTOR/ENCODER INTERFACE
FOR
A,B,C,D
I/O INTERFACE
ETHERNET
RS-232 /
RS-422 8 UNCOMMITTED
ANALOG INPUTS
HIGH-SPEED LATCH FOR EACH AXIS
ISOLATED LIMITS AND
HOME INPUTS
MAIN ENCODERS
AUXILIARY ENCODERS
+/- 10 VOLT OUTPUT FOR
SERVO MOTORS
PULSE/DIRECTION OUTPUT
FOR STEP MOTORS
HIGH SPEED ENCODER
COMPARE OUTPUT
8 PROGRAMMABLE,
OPTOISOLATED
INPUTS
8 PROGRAMMABLE HIGH POWER OPTOISOLATED OUTPUTS
32 Configurable I/O
The DMC-40x0 circuitry can be divided into the following functional groups as shown in Figure 1.1 and discussed below.
Figure 1.1 - DMC-40x0 Functional Elements

Microcomputer Section

The main processing unit of the controller is a specialized Microcomputer with RAM and Flash EEPROM. The RAM provides memory for variables, array elements, and application programs. The flash EEPROM provides non­volatile storage of variables, programs, and arrays. The Flash also contains the firmware of the controller, which is field upgradeable.

Motor Interface

Galil’s GL-1800 custom, sub-micron gate array performs quadrature decoding of each encoder at up to 12 MHz. For standard servo operation, the controller generates a +/-10 volt analog signal (16 Bit DAC). For sinusoidal commutation operation, the controller uses two DACs to generate two +/-10 volt analog signals. For stepper motor operation, the controller generates a step and direction signal.

Communication

The communication interface with the DMC-40x0 consists of high speed RS-232 and Ethernet. The Ethernet is 10/100Bt and the two RS-232 channels can generate up to 115K.

General I/O

The DMC-40x0 provides interface circuitry for 8 bi-directional, optoisolated inputs, 8 high power optoisolated outputs and 8 analog inputs with 12-Bit ADC (16-Bit optional). The DMC-40x0 also has an additional 32 I/O (3.3V
DMC-40x0 User Manual Chapter 1 Overview 4
logic) and unused auxiliary encoder inputs may also be used as additional inputs (2 inputs / each axis). The general
4080
inputs can also be used as high speed latches for each axis. A high speed encoder compare output is also provided.
The DMC-4050 through DMC-4080 controller provides an additional 8 optoisolated inputs and 8 high power optoisolated outputs.

System Elements

As shown in Fig. 1.2, the DMC-40x0 is part of a motion control system which includes amplifiers, motors and encoders. These elements are described below.
Power Supply
Com puter DMC-40x0 Controller
Encoder Motor
Figure 1-.2 - Elements of Servo systems

Amplifier (Driver)

Motor

A motor converts current into torque which produces motion. Each axis of motion requires a motor sized properly to move the load at the required speed and acceleration. (Galil’s MotorSizer Web tool can help you with motor sizing: 332Hwww.galilmc.com/support/motorsizer)
The motor may be a step or servo motor and can be brush-type or brushless, rotary or linear. For step motors, the controller can be configured to control full-step, half-step, or microstep drives. An encoder is not required when step motors are used.
Other motors and devices such as Ultrasonic Ceramic motors and voice coils can be controlled with the DMC-40x0.
Amplifier (Driver)
For each axis, the power amplifier converts a +/-10 volt signal from the controller into current to drive the motor. For stepper motors, the amplifier converts step and direction signals into current. The amplifier should be sized properly to meet the power requirements of the motor. For brushless motors, an amplifier that provides electronic commutation is required or the controller must be configured to provide sinusoidal commutation. The amplifiers may be either pulse-width-modulated (PWM) or linear. They may also be configured for operation with or without a tachometer. For current amplifiers, the amplifier gain should be set such that a 10 volt command generates the maximum required current. For example, if the motor peak current is 10A, the amplifier gain should be 1 A/V. For velocity mode amplifiers, 10 volts should run the motor at the maximum speed.
Galil offers amplifiers that are integrated into the same enclosure as the DMC-40x0. See the Integrated section in the Appendices or 334Hhttp://galilmc.com/products/accelera/dmc40x0.html for more information.
Chapter 1 Overview 5 DMC-40x0 User Manual

Encoder

An encoder translates motion into electrical pulses which are fed back into the controller. The DMC-40x0 accepts feedback from either a rotary or linear encoder. Typical encoders provide two channels in quadrature, known as CHA and CHB. This type of encoder is known as a quadrature encoder. Quadrature encoders may be either single­ended (CHA and CHB) or differential (CHA,CHA- and CHB,CHB-). The DMC-40x0 decodes either type into quadrature states or four times the number of cycles. Encoders may also have a third channel (or index) for synchronization.
The DMC-40x0 can be ordered with 120 Ohm termination resistors installed on the encoder inputs. See the Ordering Options for the DMC-40x0 in the Appendix for more information.
The DMC-40x0 can also interface to encoders with pulse and direction signals. Refer to the “CE” command in the command reference for details.
There is no limit on encoder line density; however, the input frequency to the controller must not exceed 5,500,000 full encoder cycles/second (22,000,000 quadrature counts/sec). For example, if the encoder line density is 10,000 cycles per inch, the maximum speed is 300 inches/second. If higher encoder frequency is required, please consult the factory.
The standard encoder voltage level is TTL (0-5v), however, voltage levels up to 12 Volts are acceptable. (If using differential signals, 12 Volts can be input directly to the DMC-40x0. Single-ended 12 Volt signals require a bias voltage input to the complementary inputs).
The DMC-40x0 can accept analog feedback (+/-10v) instead of an encoder for any axis. For more information see the command AF in the command reference.
To interface with other types of position sensors such as absolute encoders, Galil can customize the controller and command set. Please contact Galil to talk to one of our applications engineers about your particular system requirements.
Sinusoidal Encoders
The DMC-40x0 can be ordered with an interconnect module that supports the use of 1Vp-p sinusoidal encoders. This interconnect module is the ICM-42100. See A7 – ICM-42100 (-I100) in the Appendix for more information.

Watch Dog Timer

The DMC-40x0 provides an internal watch dog timer which checks for proper microprocessor operation. The timer toggles the Amplifier Enable Output (AMPEN) which can be used to switch the amplifiers off in the event of a serious DMC-40x0 failure. The AMPEN output is normally high. During power-up and if the microprocessor ceases to function properly, the AMPEN output will go low. The error light will also turn on at this stage. A reset is required to restore the DMC-40x0 to normal operation. Consult the factory for a Return Materials Authorization (RMA) Number if your DMC-40x0 is damaged.
DMC-40x0 User Manual Chapter 1 Overview 6

Chapter 2 Getting Started

DMC-4040 Layout

The following layouts assume either an ICM-42000(I000) or ICM-42100(I100) interconnect modules are installed. For layouts of systems with ICM-42200’s(I200) installed please contact Galil. Overall dimensions and footprint are identical, the only differences are in connector type and location.
Figure 2-1 - Outline of the of the DMC-4040
Chapter 2 Getting Started 7 DMC-40x0 User Manual

DMC-4080 Layout

Figure 2-2 - Outline of the of the DMC-4080
DMC-40x0 User Manual Chapter 2 Getting Started 8

DMC-40x0 Power Connections

Power Connector for Controller without Power Connector for Controller without
Galil Amplifiers or when ISCNTL Galil Amplifiers or when ISCNTL
option is ordered option is orderd*
Power Connectors for Galil integrated Amplifiers*
Figure 2-3 – Connector locations for the DMC-40x0
Figure 2-4 – Power Connector used when controller is ordered without Galil Amplifiers
*See Power connector information for specific amplifiers in the Integrated section of the Appendices.
For more information on Connectors (mfg PN’s and diagrams) see the Power Connector Section in the Appendix.
Chapter 2 Getting Started 9 DMC-40x0 User Manual

DMC-4040 Dimensions

Figure 2-5 – Dimensions of DMC-4040
DMC-40x0 User Manual Chapter 2 Getting Started 10

DMC-4080 Dimensions

Figure 2-6 Dimensions of DMC-4080
Chapter 2 Getting Started 11 DMC-40x0 User Manual

Elements You Need

For a complete system, Galil recommends the following elements:
1. DMC-4010, 4020, 4030, or DMC-4040 Motion Controller
or
DMC-4050, 4060, 4070 or DMC-4080
2. Motor Amplifiers (Integrated when using Galil amplifiers and drivers)
3. Power Supply for Amplifiers and controller
4. Brush or Brushless Servo motors with Optical Encoders or stepper motors.
a. Cables for connecting to the DMC-40x0’s integrated ICM’s.
5. PC (Personal Computer - RS232 or Ethernet for DMC-40x0)
6. GalilTools, or GalilTools-Lite Software package
GalilTools is highly recommended for first time users of the DMC-40x0. It provides step-by-step instructions for system connection, tuning and analysis.
DMC-40x0 User Manual Chapter 2 Getting Started 12

Installing the DMC-40x0

Installation of a complete, operational DMC-40x0 system consists of 9 steps.
Step 1. Determine overall motor configuration.
Step 2. Install Jumpers on the DMC-40x0.
Step 3. Install the communications software.
Step 4. Connect DC power to controller.
Step 5. Establish communications with the Galil Communication Software.
Step 6. Determine the Axes to be used for sinusoidal commutation.
Step 7. Make connections to amplifier and encoder.
Step 8a. Connect standard servo motors.
Step 8b. Connect sinusoidal commutation motors
Step 8c. Connect step motors.
Step 9. Tune the servo system

Step 1. Determine Overall Motor Configuration

Before setting up the motion control system, the user must determine the desired motor configuration. The DMC­40x0 can control any combination of standard servo motors, sinusoidally commutated brushless motors, and stepper motors. Other types of actuators, such as hydraulics can also be controlled, please consult Galil.
The following configuration information is necessary to determine the proper motor configuration:
Standard Servo Motor Operation:
Unless ordered with stepper motor drivers or in a non-standard configuration, the DMC-40x0 has been setup by the factory for standard servo motor operation providing an analog command signal of +/- 10V. No hardware or software configuration is required for standard servo motor operation.
Sinusoidal Commutation:
Sinusoidal commutation is configured through a single software command, BA. This configuration causes the controller to reconfigure the number of available control axes.
Each sinusoidally commutated motor requires two DACs. In standard servo operation, the DMC-40x0 has one DAC per axis. In order to have the additional DAC for sinusoidal commutation, the controller must be designated as having one additional axis for each sinusoidal commutation axis. For example, to control two standard servo axes and one axis of sinusoidal commutation, the controller will require a total of four DACs and the controller must be a DMC-4040.
Sinusoidal commutation is configured with the command, BA. For example, BAA sets the A axis to be sinusoidally commutated. The second DAC for the sinusoidal signal will be the highest available DAC on the controller. For example: Using a DMC-4040, the command BAA will configure the A axis to be the main sinusoidal signal and the 'D' axis to be the second sinusoidal signal.
The BA command also reconfigures the controller to indicate that the controller has one less axis of 'standard' control for each axis of sinusoidal commutation. For example, if the command BAA is given to a DMC-4040 controller, the controller will be re-configured to a DMC-4030 controller. By definition, a DMC-4030 controls 3 axes: A,B and C. The 'D' axis is no longer available since the output DAC is being used for sinusoidal commutation.
Further instruction for sinusoidal commutation connections are discussed in Step 6.
Chapter 2 Getting Started 13 DMC-40x0 User Manual
Stepper Motor Operation
To configure the DMC-40x0 for stepper motor operation, the controller requires that the command, MT, must be given. Further instruction for stepper motor connections are discussed in Step 8c.

Step 2. Install Jumpers on the DMC-40x0

Master Reset and Upgrade Jumpers
JP1 on the main board contains two jumpers, MRST and UPGRD. The MRST jumper is the Master Reset jumper. When MRST is connected, the controller will perform a master reset upon PC power up or upon the reset input going low. Whenever the controller has a master reset, all programs, arrays, variables, and motion control parameters stored in EEPROM will be ERASED.
The UPGRD jumper enables the user to unconditionally update the controller’s firmware. This jumper is not necessary for firmware updates when the controller is operating normally, but may be necessary in cases of corrupted EEPROM. EEPROM corruption should never occur, however, it is possible if there is a power fault during a firmware update. If EEPROM corruption occurs, your controller may not operate properly. In this case, install the UPGRD Jumper and use the update firmware function on the Galil Terminal to re-load the system firmware.
Motor Off Jumpers
The state of the motor upon power up may be selected with the placement of a hardware jumper on the controller. With a jumper installed at the MO location, the controller will be powered up in the “motor off” state. The SH command will need to be issued in order for the motor to be enabled. With no jumper installed, the controller will immediately enable the motor upon power up. The MO command will need to be issued to turn the motor off, unless an error occurs that will turn the motors off. The MO jumper is located on JP1, the same block as the Master Reset and Upgrade jumpers.
Communications Jumpers for DMC-40x0
The baud rate for RS232 communication can be set with jumpers found on JP1 of the communication board (same set of jumpers where MO, MRST and UPGD can be found). To set the baud rate to the desired value, see 703HT 2able- below.
19.2 38.4 BAUD RATE
ON ON 9600
ON OFF 19200
OFF ON 38400
OFF OFF 115200
Table 2-1 : Baud Rate Jumper Settings
Other serial communication protocols, such as RS-485, can be implemented as a special - consult Galil.

Step 3. Install the Communications Software

After applying power to the computer, you should install the Galil software that enables communication between the controller and PC.
Using Windows XP (32 & 64 bit):
Install the Galil Software Products CD-ROM into your CD drive. A Galil .htm page should automatically appear with links to the software products. Select the correct version of GalilTools software for your particular operating system and click “Install…” Follow the installation procedure as outlined.
The most recent copy of the GalilTools software can be downloaded from the Galil website.
DMC-40x0 User Manual Chapter 2 Getting Started 14
http://www.galilmc.com/products/software/galiltools.html
All other Galil software is also available for download at the Galil software downloads page.
33http://www.galilmc.com/support/download.html
Using Linux (32 & 64 bit):
The GalilTools software package is fully compatible with a number of Linux distributions. See the GalilTools webpage and user manual for downloads and installation instructions.
http://www.galilmc.com/products/software/galiltools.html

Step 4. Connect 20-80VDC Power to the Controller

If the controller was ordered with Galil Amplifiers or Drivers, then power to the controller will be supplied through those power connectors. Otherwise the power will come through the connector on the side of the controller. See DMC-40x0 Power Connections.
WARNING: Dangerous voltages, current, temperatures and energy levels exist in this product and the associated amplifiers and servo motor(s). Extreme caution should be exercised in the application of this equipment. Only qualified individuals should attempt to install, set up and operate this equipment. Never open the controller box when DC power is applied to it.
The green power light indicator should go on when power is applied.

Step 5. Establish Communications with Galil Software

Communicating through an Ethernet connection
The DMC-40x0 motion controller is equipped with DHCP. If the controller is connected to a DHCP enabled network, an IP address will automatically be assigned to the controller. See Ethernet Configuration in Chapter 4 for more information.
Using GalilTools Software for Windows
Registering controllers in the Windows registry is no longer required when using the GalilTools software package. A simple connection dialog box appears when the software is opened that shows all available controllers.
Any available controllers with assigned IP addresses can be found under the ‘Available’ tab in the Connections Dialog Box. If the controller is not connected to a DHCP enabled network, or the DH command is set to 0, and the controller has not been assigned an IP address, the controller can be found under the ‘No IP Address’ tab.
For more information on establishing communication to the controller via the GalilTools software, see the GalilTools user manual.
http://www.galilmc.com/support/manuals/galiltools/index.html
Using DMC-SmartTerminal or WSDK Software for Windows
NOTE: For new applications, Galil recommends using the GalilTools software package.
The controller must be registered in the Windows registry for the host computer to communicate with it. The registry may be accessed via Galil software, such as WSDK or GALIL Smart Terminal.
A dedicated network card with a static IP address is recommended. To set your NIC card to a static IP, go to the Control Panel Network Connections Local Area Connection Properties TCP/IP and choose “use the following IP address”. If a “Dynamic” IP address is used, make sure there is a DHCP Server on your network or you will encounter an error.
Chapter 2 Getting Started 15 DMC-40x0 User Manual
Use the “New Controller” button to add a new entry in the registry or alternatively click on the “Find Ethernet Controller” to have the software search for controllers connected to the network. When adding a new controller,
choose DMC-40x0 as the controller type. Enter the IP address obtained from your system administrator. Select the button corresponding to the UDP or TCP protocol in which you wish to communicate with the controller. If the IP address has not been already assigned to the controller, click on ASSIGN IP ADDRESS.
ASSIGN IP ADDRESS will check the controllers that are linked to the network to see which ones do not have an IP address. The program will then ask you whether you would like to assign the IP address you entered to the controller with the specified serial number. Click on YES to assign it, NO to move to next controller, or CANCEL to not save the changes. If there are no controllers on the network that do not have an IP address assigned, the program will state this.
When done registering, click on OK. If you do not wish to save the changes, click on CANCEL.
Once the controller has been registered, select the correct controller from the list and click on OK. If the software successfully established communications with the controller, the registry entry will be displayed at the bottom of the screen in the Status window.
NOTE: The controller must be registered via an Ethernet connection.
Communicating through the Main Serial Communications Port
Connect the DMC-40x0 MAIN serial port to your computer via the Galil CABLE-9PIN-D (RS-232 Cable). This is a straight through serial cable – NOT a NULL modem.
Using GalilTools Software for Windows
Registering controllers in the Windows registry is no longer required when using the GalilTools software package. A simple connection dialog box appears when the software is opened that shows all available controllers.
The serial ports are listed as COMn ‘communication speed’. (ex COM1 115200). The default serial communication speed on the DMC-40x0 is 115200Bps.
For more information on establishing communication to the controller via the GalilTools software, see the GalilTools user manual.
http://www.galilmc.com/support/manuals/galiltools/index.html
Using DMC-SmartTerminal or WSDK Software for Windows
NOTE: For new applications, Galil recommends using the GalilTools software package.
In order for the windows software to communicate with a Galil controller, the controller must be registered in the Windows Registry. To register a controller, you must specify the model of the controller, the communication parameters, and other information. The registry is accessed through the Galil software under the “File” menu in WSDK or under the “Tools” menu in the Galil Smart Terminal.
Use the “New Controller” button to add a new entry to the Registry. You will need to supply the Galil Controller model (eg: DMC-40x0). Pressing the down arrow to the right of this field will reveal a menu of valid controller types. You then need to choose serial or Ethernet connection. The registry information will show a default Comm. Port of 1 and a default Comm. Speed of 115200 appears. This information can be changed as necessary to reflect the computers Comm. Port and the baud rate set by the jumpers found on the communications board. The registry entry also displays timeout and delay information. These are advanced parameters which should only be modified by advanced users (see software documentation for more information).
Once you have set the appropriate Registry information for your controller, Select OK and close the registry window. You will now be able to communicate with the controller.
To establish communication to the controller, open up the Terminal and hit the “Enter” key. You should receive a colon prompt. Communicating with the controller is described in later sections.
DMC-40x0 User Manual Chapter 2 Getting Started 16
If you are not properly communicating with the controller, the program will pause for 3-15 seconds and an error message will be displayed. In this case, there is most likely an incorrect setting of the serial communications port or the serial cable is not connected properly. The user must ensure that the correct communication port and baud rate are specified when attempting to communicate with the controller. Please note that the serial port on the controller must be set for handshake mode for proper communication with Galil software. The user must also insure that a “straight-through” serial cable is being used (NOT a Null Modem cable), see appendix for pin-out of serial cable.
Using Non-Galil Communication Software
The DMC-40x0 main serial port is configured as DATASET. Your computer or terminal must be configured as a DATATERM for full duplex, no parity, 8 data bits, one start bit and one stop bit.
Check to insure that the baud rate jumpers have been set to the desired baud rate as described above.
Your computer needs to be configured as a "dumb" terminal which sends ASCII characters as they are typed to the DMC-40x0.
Sending Test Commands to the Terminal:
After you connect your terminal, press <return> or the <enter> key on your keyboard. In response to carriage return <return>, the controller responds with a colon, :
Now type
TPA <return>
This command directs the controller to return the current position of the A axis. The controller should respond with a number such as
:0

Step 6. Determine the Axes to be Used for Sinusoidal Commutation

* This step is only required when the controller will be used to control a brushless motor(s) with sinusoidal commutation.
The command, BA is used to select the axes of sinusoidal commutation. For example, BAAC sets A and C as axes with sinusoidal commutation.
Notes on Configuring Sinusoidal Commutation:
The command, BA, reconfigures the controller such that it has one less axis of 'standard' control for each axis of sinusoidal commutation. For example, if the command BAA is given to a DMC-4040 controller, the controller will be re-configured to be a DMC-4030 controller. In this case the highest axis is no longer available except to be used for the 2nd phase of the sinusoidal commutation. Note that the highest axis on a controller can never be configured for sinusoidal commutation.
The DAC associated with the selected axis represents the first phase. The second phase uses the highest available DAC. When more than one axis is configured for sinusoidal commutation, the controller will assign the second phases to the DACs which have been made available through the axes reconfiguration. The highest sinusoidal commutation axis will be assigned to the highest available DAC and the lowest sinusoidal commutation axis will be assigned to the lowest available DAC. Note that the lowest axis is the A axis and the highest axis is the highest available axis for which the controller has been configured.
Example: Sinusoidal Commutation Configuration using a DMC-4070
BAAC
This command causes the controller to be reconfigured as a DMC-4050 controller. The A and C axes are configured for sinusoidal commutation. The first phase of the A axis will be the motor command A signal. The second phase
Chapter 2 Getting Started 17 DMC-40x0 User Manual
of the A axis will be F signal. The first phase of the C axis will be the motor command C signal. The second phase of the C axis will be the motor command G signal.

Step 7. Make Connections to Amplifier and Encoder.

If the system is run solely by Galil’s integrated amplifiers or drivers, skip this section, the amplifier is already connected to the controller.
Once you have established communications between the software and the DMC-40x0, you are ready to connect the rest of the motion control system. The motion control system typically consists of the controller with interconnect module, an amplifier for each axis of motion, and a motor to transform the current from the amplifier into torque for motion.
System connection procedures will depend on system components and motor types. Any combination of motor types can be used with the DMC-40x0. There can also be a combination of axes running from Galil integrated amplifiers and drivers and external amplifiers or drivers. If sinusoidal commutation is to be used, special attention must be paid to the reconfiguration of axes (see above section for more information).
Connecting to External Amplifiers
Here are the first steps for connecting a motion control system:
Step A. Connect the motor to the amplifier with no connection to the controller. Consult the amplifier
documentation for instructions regarding proper connections. Connect and turn-on the amplifier power supply. If the amplifiers are operating properly, the motor should stand still even when the amplifiers are powered up.
Step B. Connect the amplifier enable signal.
Before making any connections from the amplifier to the controller, you need to verify that the ground level of the amplifier is either floating or at the same potential as earth.
WARNING: When the amplifier ground is not isolated from the power line or when it has a different potential than that of the computer ground, serious damage may result to the computer controller and amplifier.
If you are not sure about the potential of the ground levels, connect the two ground signals (amplifier
ground and earth) by a 10 kresistor and measure the voltage across the resistor. Only if the voltage is
zero, connect the two ground signals directly.
The amplifier enable signal is used by the controller to disable the motor. When configured with the ICM­42000 or ICM-42100, this signal is labeled AENA for the A axis and is found on the 15 pin Dsub connector associated with the A axis (if configured with the ICM-42200 the AENA signal is located on the 26 pin Dsub associated with the A axis). Note that many amplifiers designate this signal as the INHIBIT signal. Use the command, MO, to disable the motor amplifiers - check to insure that the motor amplifiers have been disabled (often this is indicated by an LED on the amplifier).
This signal changes under the following conditions: the watchdog timer activates, the motor-off command,
MO, is given, or the OE3 command (Enable Off-On-Error) is given and the position error exceeds the error limit. AMPEN can be used to disable the amplifier for these conditions.
The AMPEN signal from the DMC-40x0 is shipped as a default of 5V active high or high amp enable. In other words, the AMPEN signal will be high when the controller expects the amplifier to be enabled.
If your amplifier requires a different configuration it is highly recommended that the DMC-40x0 is ordered with the desired configuration. See the DMC-40x0 ordering information in the catalog
(http://www.galilmc.com/catalog/cat40x0.pdf) or contact Galil for more information on ordering different configurations. If the amplifier enable needs to be changed, see the ICM-42000 and ICM-42100 Amplifier Enable Circuit section in Chapter 3 Connecting Hardware.
DMC-40x0 User Manual Chapter 2 Getting Started 18
4080
When ordered with ICM-42000’s or ICM-42100’s the AEN signal is configurable for axes 1-4 and axes 5-8. Ex – axes 1-4 could be ordered as 5V high amp enable, and axes 5-8 could be ordered as 12V low amp enable. When ordered with ICM-42200’s each axis is individually configurable.
Step C. Connect the encoders
For stepper motor operation, an encoder is optional.
For servo motor operation, if you have a preferred definition of the forward and reverse directions, make sure that the encoder wiring is consistent with that definition.
The DMC-40x0 accepts single-ended or differential encoder feedback with or without an index pulse. The encoder signals are wired to that axis associated 15pin DSub connector found on top of the controller. The signal leads are labeled MA+ (channel A), MB+ (channel B), and MI+. For differential encoders, the complement signals are labeled MA-, MB-, and MI-. For complete pin-out information see in the Appendices.
NOTE: When using pulse and direction encoders, the pulse signal is connected to CHA and the direction signal is connected to CHB. The controller must be configured for pulse and direction with the command CE. See the command summary for further information on the command CE.
Step D. Verify proper encoder operation.
Start with the A encoder first. Once it is connected, turn the motor shaft and interrogate the position with the instruction TPA <return>. The controller response will vary as the motor is turned.
At this point, if TPA does not vary with encoder rotation, there are three possibilities:
1. The encoder connections are incorrect - check the wiring as necessary.
2. The encoder has failed - using an oscilloscope, observe the encoder signals. Verify that both channels A and B have a peak magnitude between 5 and 12 volts. Note that if only one encoder channel fails, the position reporting varies by one count only. If the encoder failed, replace the encoder. If you cannot observe the encoder signals, try a different encoder.
3. There is a hardware failure in the controller - connect the same encoder to a different axis. If the problem disappears, you may have a hardware failure. Consult the factory for help.
Step E. Connect Hall Sensors if available.
Hall sensors are only used with sinusoidal commutation and are not necessary for proper operation. The use of Hall sensors allows the controller to automatically estimate the commutation phase upon reset and also provides the controller the ability to set a more precise commutation phase. Without Hall sensors, the commutation phase must be determined manually.
The Hall Effect sensors are connected to the digital inputs of the controller. These inputs can be used with the general use inputs (bits 1-8), the auxiliary encoder inputs (bits 81-96), or the extended I/O inputs of the DMC-40x0 controller (bits 17-80).
NOTE: The general use inputs are optoisolated and require a voltage connection at the INCOM point - for more information regarding the digital inputs, see Chapter 3, Connecting Hardware.
Each set of sensors must use inputs that are in consecutive order. The input lines are specified with the command, BI. For example, if the Hall sensors of the C axis are connected to inputs 6, 7 and 8, use the instruction:
BI ,, 6 or
BIC = 6

Step 8a. Connect Standard Servo Motors

The following discussion applies to connecting the DMC-40x0 controller to standard servo motors:
Chapter 2 Getting Started 19 DMC-40x0 User Manual
The motor and the amplifier may be configured in the torque or the velocity mode. In the torque mode, the amplifier gain should be such that a 10 volt signal generates the maximum required current. In the velocity mode, a command signal of 10 volts should run the motor at the maximum required speed. For Galil amplifiers, see Integrated .
Step A. Check the Polarity of the Feedback Loop
It is assumed that the motor and amplifier are connected together and that the encoder is operating correct (Step 7). Before connecting the motor amplifiers to the controller, read the following discussion on setting
Error Limits and Torque Limits. Note that this discussion only uses the A axis as an examples.
Step B. Set the Error Limit as a Safety Precaution
Usually, there is uncertainty about the correct polarity of the feedback. The wrong polarity causes the motor to run away from the starting position. Using a terminal program, such as Galil Tools, the following parameters can be given to avoid system damage:
Input the commands:
ER 2000 <return> Sets error limit on the A axis to be 2000 encoder counts
OE 1 <return> Disables A axis amplifier when excess position error exists
If the motor runs away and creates a position error of 2000 counts, the motor amplifier will be disabled.
NOTE: This function requires the AMPEN signal to be connected from the controller to the amplifier.
Step C. Set Torque Limit as a Safety Precaution
To limit the maximum voltage signal to your amplifier, the DMC-40x0 controller has a torque limit command, TL. This command sets the maximum voltage output of the controller and can be used to avoid excessive torque or speed when initially setting up a servo system.
When operating an amplifier in torque mode, the voltage output of the controller will be directly related to the torque output of the motor. The user is responsible for determining this relationship using the documentation of the motor and amplifier. The torque limit can be set to a value that will limit the motors output torque.
When operating an amplifier in velocity or voltage mode, the voltage output of the controller will be directly related to the velocity of the motor. The user is responsible for determining this relationship using the documentation of the motor and amplifier. The torque limit can be set to a value that will limit the speed of the motor.
For example, the following command will limit the output of the controller to 1 volt on the X axis:
TL 1 <return>
NOTE: Once the correct polarity of the feedback loop has been determined, the torque limit should, in general,
be increased to the default value of 9.99. The servo will not operate properly if the torque limit is below the normal operating range. See description of TL in the command reference.
Step D. Connect the Motor
Once the parameters have been set, connect the analog motor command signal (MCMn where n is A-H) to the amplifier input.
To test the polarity of the feedback, command a move with the instruction:
PR 1000 <CR> Position relative 1000 counts
BGA <CR> Begin motion on A axis
When the polarity of the feedback is wrong, the motor will attempt to run away. The controller should disable the motor when the position error exceeds 2000 counts. If the motor runs away, the polarity of the loop must be inverted.
DMC-40x0 User Manual Chapter 2 Getting Started 20
Inverting the Loop Polarity
When the polarity of the feedback is incorrect, the user must invert the loop polarity and this may be accomplished by several methods. If you are driving a brush-type DC motor, the simplest way is to invert the two motor wires (typically red and black). For example, switch the M1 and M2 connections going from your amplifier to the motor. When driving a brushless motor, the polarity reversal may be done with the encoder. If you are using a single-ended encoder, interchange the signal MA+ and MB+. If, on the other hand, you are using a differential encoder, interchange only MA+ and MA-. The loop polarity and encoder polarity can also be affected through software with the MT, and CE commands. For more details on the MT command or the CE command, see the Command Reference section.
To Invert Polarity using Hall-Commutated brushless motors, invert motor phases B & C, exchange Hall A with Hall B, and invert encoder polarity as described above.
Sometimes the feedback polarity is correct (the motor does not attempt to run away) but the direction of motion is reversed with respect to the commanded motion. If this is the case, reverse the motor leads AND the encoder signals.
If the motor moves in the required direction but stops short of the target, it is most likely due to insufficient torque output from the motor command signal MCMn. This can be alleviated by reducing system friction on the motors. The instruction:
TTA <return> Tell torque on A
reports the level of the output signal. It will show a non-zero value that is below the friction level.
Once you have established that you have closed the loop with the correct polarity, you can move on to the compensation phase (servo system tuning) to adjust the PID filter parameters, KP, KD and KI. It is necessary to accurately tune your servo system to ensure fidelity of position and minimize motion oscillation as described in the next section.

Step 8b. Connect Sinusoidal Commutation Motors

When using sinusoidal commutation, the parameters for the commutation must be determined and saved in the controller’s non-volatile memory. The setup for sinusoidal commutation is different when using Hall Sensors. Each step which is affected by Hall Sensor Operation is divided into two parts, part 1 and part 2. After connecting sinusoidal commutation motors, the servos must be tuned as described in Step 9.
Step A. Disable the motor amplifier
Use the command, MO, to disable the motor amplifiers. For example, MOA will turn the A axis motor off.
Step B. Connect the motor amplifier to the controller.
The sinusoidal commutation amplifier requires 2 signals, usually denoted as Phase A & Phase B. These inputs should be connected to the two sinusoidal signals generated by the controller. The first signal is the axis specified with the command, BA (Step 6). The second signal is associated with the highest analog command signal available on the controller - note that this axis was made unavailable for standard servo operation by the command BA.
When more than one axis is configured for sinusoidal commutation, the controller will assign the second phase to the command output which has been made available through the axes reconfiguration. The 2 phase of the highest sinusoidal commutation axis will be the highest command output and the 2nd phase of the lowest sinusoidal commutation axis will be the lowest command output.
It is not necessary to be concerned with cross-wiring the 1st and 2nd signals. If this wiring is incorrect, the setup procedure will alert the user (Step D).
Example: Sinusoidal Commutation Configuration using a DMC-4070
BAAC
nd
Chapter 2 Getting Started 21 DMC-40x0 User Manual
This command causes the controller to be reconfigured as a DMC-4050 controller. The A and C axes are configured for sinusoidal commutation. The first phase of the A axis will be the motor command A signal. The second phase of the A axis will be the motor command F signal. The first phase of the C axis will be the motor command C signal. The second phase of the C axis will be the motor command G signal.
Step C. Specify the Size of the Magnetic Cycle.
Use the command, BM, to specify the size of the brushless motors magnetic cycle in encoder counts. For example, if the X axis is a linear motor where the magnetic cycle length is 62 mm, and the encoder resolution is 1 micron, the cycle equals 62,000 counts. This can be commanded with the command:
BM 62000
On the other hand, if the C axis is a rotary motor with 4000 counts per revolution and 3 magnetic cycles per revolution (three pole pairs) the command is:
BM,, 1333.333
Step D - part 1 (Systems with or without Hall Sensors). Test the Polarity of the DACs
Use the brushless motor setup command, BS, to test the polarity of the output DACs. This command applies a certain voltage, V, to each phase for some time T, and checks to see if the motion is in the correct direction.
The user must specify the value for V and T. For example, the command:
BSA = 2,700
will test the A axis with a voltage of 2 volts, applying it for 700 millisecond for each phase. In response, this test indicates whether the DAC wiring is correct and will indicate an approximate value of BM. If the wiring is correct, the approximate value for BM will agree with the value used in the previous step.
NOTE: In order to properly conduct the brushless setup, the motor must be allowed to move a minimum of one
magnetic cycle in both directions.
NOTE: When using Galil Windows software, the timeout must be set to a minimum of 10 seconds (time-out =
10000) when executing the BS command. This allows the software to retrieve all messages returned from
the controller.
Step D - part 2 (Systems with Hall Sensors Only). Test the Hall Sensor Configuration.
Since the Hall sensors are connected randomly, it is very likely that they are wired in the incorrect order. The brushless setup command indicates the correct wiring of the Hall sensors. The Hall sensor wires should be re-configured to reflect the results of this test.
The setup command also reports the position offset of the Hall transition point and the zero phase of the
motor commutation. The zero transition of the Hall sensors typically occur at 0°, 30° or 90° of the phase
commutation. It is necessary to inform the controller about the offset of the Hall sensor and this is done with the instruction, BB.
Step E. Save Brushless Motor Configuration
It is very important to save the brushless motor configuration in non-volatile memory. After the motor wiring and setup parameters have been properly configured, the burn command, BN, should be given.
NOTE: Without Hall sensors, the controller will not be able to estimate the commutation phase of the
brushless motor. In this case, the controller could become unstable until the commutation phase has been set using the BZ command (see next step). It is highly recommended that the motor off command be given before executing the BN command. In this case, the motor will be disabled upon power up or reset and the commutation phase can be set before enabling the motor.
Step F - part 1 (Systems with or without Hall Sensors). Set Zero Commutation Phase
When an axis has been defined as sinusoidally commutated, the controller must have an estimate for commutation phase. When Hall sensors are used, the controller automatically estimates this value upon
DMC-40x0 User Manual Chapter 2 Getting Started 22
reset of the controller. If no Hall sensors are used, the controller will not be able to make this estimate and the commutation phase must be set before enabling the motor.
To initialize the commutation without Hall effect sensor use the command, BZ. This function drives the motor to a position where the commutation phase is zero, and sets the phase to zero.
The BZ command is followed by real numbers in the fields corresponding to the driven axes. The number represents the voltage to be applied to the amplifier during the initialization. When the voltage is specified by a positive number, the initialization process ends up in the motor off (MO) state. A negative number causes the process to end in the Servo Here (SH) state.
WARNING: This command must move the motor to find the zero commutation phase. This movement is instantaneous and will cause the system to jerk. Larger applied voltages will cause more severe motor jerk. The applied voltage will typically be sufficient for proper operation of the BZ command. For systems with significant friction, this voltage may need to be increased and for systems with very small motors, this value should be decreased. For example:
BZ –2, 0,1
will drive both A and C axes to zero, will apply 2V and 1V respectively to A and C and will end up with A in SH and C in MO.
Step F - part 2 (Systems with Hall Sensors Only). Set Zero Commutation Phase
With Hall sensors, the estimated value of the commutation phase is good to within 30°. This estimate can
be used to drive the motor but a more accurate estimate is needed for efficient motor operation. There are 3 possible methods for commutation phase initialization:
Method 1. Use the BZ command as described above.
Method 2. Drive the motor close to commutation phase of zero and then use BZ command. This method
decreases the amount of system jerk by moving the motor close to zero commutation phase before executing the BZ command. The controller makes an estimate for the number of encoder counts between the current position and the position of zero commutation phase. This value is stored in the operand _BZn. Using this operand the controller can be commanded to move the motor. The BZ command is then issued as described above. For example, to initialize the A axis motor upon power or reset, the following commands may be given:
SHA ;Enable A axis motor PRA=-1*(_BZA) ;Move A motor close to zero commutation phase BGA ;Begin motion on A axis AMA ;Wait for motion to complete on A axis BZA=-1 ;Drive motor to commutation phase zero and leave motor on
Method 3. Use the command, BC. This command uses the Hall transitions to determine the commutation
phase. Ideally, the Hall sensor transitions will be separated by exactly 60° and any deviation from 60° will
affect the accuracy of this method. If the Hall sensors are accurate, this method is recommended. The BC command monitors the Hall sensors during a move and monitors the Hall sensors for a transition point. When that occurs, the controller computes the commutation phase and sets it. For example, to initialize the A axis motor upon power or reset, the following commands may be given:
SHA ;Enable A axis motor BCA ;Enable the brushless calibration command PRA=50000 ;Command a relative position movement on A axis BGA ;Begin motion on A axis. When the Hall sensors detect a
;phase transition, the commutation phase is reset
Chapter 2 Getting Started 23 DMC-40x0 User Manual

Step 8c. Connect Step Motors

In Stepper Motor operation, the pulse output signal has a 50% duty cycle. Step motors operate open loop and do not require encoder feedback. When a stepper is used, the auxiliary encoder for the corresponding axis is unavailable for an external connection. If an encoder is used for position feedback, connect the encoder to the main encoder input corresponding to that axis. The commanded position of the stepper can be interrogated with RP or TD. The encoder position can be interrogated with TP.
If encoders are available on the stepper motor, Galil’s Stepper Position Maintenance Mode may be used for automatic monitoring and correction of the stepper position. See Stepper Position Maintenance Mode (SPM) in Chapter 6 Programming Motion for more information.
The frequency of the step motor pulses can be smoothed with the filter parameter, KS. The KS parameter has a range between 0.25 and 64, where 64 implies the largest amount of smoothing. See Command Reference regarding KS.
The DMC-40x0 profiler commands the step motor amplifier. All DMC-40x0 motion commands apply such as PR, PA, VP, CR and JG. The acceleration, deceleration, slew speed and smoothing are also used. Since step motors run open-loop, the PID filter does not function and the position error is not generated.
To connect step motors with the DMC-40x0 you must follow this procedure – If you have a Galil integrated stepper driver skip Step A, the step and direction lines are already connected to the driver:
Step A. Connect step and direction signals from controller to motor amplifier
From the controller to respective signals on your step motor amplifier. (These signals are labeled STPA and DIRA for the A-axis on the EXTERNAL DRIVER (A-D) D-Sub connector top of the controller). Consult the documentation for connecting these signals to your step motor amplifier.
Step B. Configure DMC-40x0 for motor type using MT command. You can configure the DMC-40x0 for
active high or active low pulses. Use the command MT 2 or 2.5 for active low step motor pulses and MT ­2 or -2.5 for active high step motor pulses. See description of the MT command in the Command
Reference.

Step 9. Tune the Servo System

Adjusting the tuning parameters is required when using servo motors (standard or sinusoidal commutation). The system compensation provides fast and accurate response and the following section suggests a simple and easy way for compensation. More advanced design methods are available with software design tools from Galil, such as the GalilTools.
The filter has three parameters: the damping, KD; the proportional gain, KP; and the integrator, KI. The parameters should be selected in this order.
To start, set the integrator to zero with the instruction
KI 0 <return> Integrator gain
and set the proportional gain to a low value, such as
KP 1 <return> Proportional gain
KD 100 <return> Derivative gain
For more damping, you can increase KD (maximum is 4095.875). Increase gradually and stop after the motor vibrates. A vibration is noticed by audible sound or by interrogation. If you send the command
TE A <return> Tell error
a few times, and get varying responses, especially with reversing polarity, it indicates system vibration. When this happens, simply reduce KD by about 20%.
DMC-40x0 User Manual Chapter 2 Getting Started 24
Next you need to increase the value of KP gradually (maximum allowed is 1023.875). You can monitor the
Instruction
Interpretation
improvement in the response with the Tell Error instruction
KP 10 <return> Proportion gain
TE A <return> Tell error
As the proportional gain is increased, the error decreases.
Again, the system may vibrate if the gain is too high. In this case, reduce KP by about 20%. Typically, KP should not be greater than KD/4 (only when the amplifier is configured in the current mode).
Finally, to select KI, start with zero value and increase it gradually. The integrator eliminates the position error, resulting in improved accuracy. Therefore, the response to the instruction
TE A <return>
becomes zero. As KI is increased, its effect is amplified and it may lead to vibrations. If this occurs, simply reduce KI. Repeat tuning for the B, C and D axes.
Note: For a more detailed description of the operation of the PID filter and/or servo system theory, see Chapter 10 Theory of Operation

Design Examples

Here are a few examples for tuning and using your controller. These examples have remarks next to each command
- these remarks must not be included in the actual program.

Example 1 - System Set-up

This example assigns the system filter parameters, error limits and enables the automatic error shut-off.
Instruction Interpretation
KP10,10,10,10 Set gains for a,b,c,d (or A,B,C,D axes)
KP*=10 Alternate method for setting gain on all axes
KPA=10 Method for setting only A (or X) axis gain
KPX=10 Method for setting only X (or A) axis gain
KP, 20 Set B axis gain only
Instruction Interpretation
OE 1,1,1,1,1,1,1,1 Enable automatic Off on Error function for all axes
ER*=1000 Set error limit for all axes to 1000 counts
KP10,10,10,10,10,10,10,10 Set gains for a,b,c,d,e,f,g,and h axes
KP*=10 Alternate method for setting gain on all axes
KPA=10 Alternate method for setting A axis gain
KP,,10 Set C axis gain only
KPD=10 Alternate method for setting D axis gain
KPH=10 Alternate method for setting H axis gain

Example 2 - Profiled Move

Rotate the A axis a distance of 10,000 counts at a slew speed of 20,000 counts/sec and an acceleration and deceleration rates of 100,000 counts/s2. In this example, the motor turns and stops:
PR1000 Distance
Chapter 2 Getting Started 25 DMC-40x0 User Manual
SP20000 Speed
SP 10000,12000,20000,10000
AC 10000,10000,10000,10000
DC 80000,40000,30000,50000
Instruction
Interpretation
Instruction
Interpretation
Instruction
Interpretation
DC 100000 Deceleration
AC 100000 Acceleration
BG A Start Motion

Example 3 - Multiple Axes

Objective: Move the four axes independently.
Instruction Interpretation
PR 500,1000,600,-400 Distances of A,B,C,D
Slew speeds of A,B,C,D
Accelerations of A,B,C,D
Decelerations of A,B,C,D
BG AC Start A and C motion
BG BD Start B and D motion

Example 4 - Independent Moves

The motion parameters may be specified independently as illustrated below.
PR ,300,-600 Distances of B and C
SP ,2000 Slew speed of B
DC ,80000 Deceleration of B
AC ,100000 Acceleration of B
AC ,,100000 Acceleration of C
DC,,150000 Deceleration of C
BG C Start C motion
BG B Start B motion

Example 5 - Position Interrogation

The position of the four axes may be interrogated with the instruction, TP.
TP Tell position all four axes
TP A Tell position – A axis only
TP B Tell position – B axis only
TP C Tell position – C axis only
TP D Tell position – D axis only
The position error, which is the difference between the commanded position and the actual position can be interrogated with the instruction TE.
TE Tell error – all axes
TE A Tell error – A axis only
TE B Tell error – B axis only
TE C Tell error – C axis only
TE D Tell error – D axis only

Example 6 - Absolute Position

Objective: Command motion by specifying the absolute position.
Instruction Interpretation
DMC-40x0 User Manual Chapter 2 Getting Started 26
DP 0,2000 Define the current positions of A,B as 0 and 2000
PA 7000,4000 Sets the desired absolute positions
BG A Start A motion
BG B Start B motion
After both motions are complete, the A and B axes can be command back to zero:
PA 0,0 Move to 0,0
BG AB Start both motions

Example 7 - Velocity Control

Objective: Drive the A and B motors at specified speeds.
Instruction Interpretation
JG 10000,-20000 Set Jog Speeds and Directions
AC 100000, 40000 Set accelerations
DC 50000,50000 Set decelerations
BG AB Start motion
after a few seconds, command:
JG -40000 New A speed and Direction
TV A Returns A speed
and then
JG ,20000 New B speed
TV B Returns B speed
These cause velocity changes including direction reversal. The motion can be stopped with the instruction
ST Stop

Example 8 - Operation Under Torque Limit

The magnitude of the motor command may be limited independently by the instruction TL.
Instruction Interpretation
TL 0.2 Set output limit of A axis to 0.2 volts
JG 10000 Set A speed
BG A Start A motion
In this example, the A motor will probably not move since the output signal will not be sufficient to overcome the friction. If the motion starts, it can be stopped easily by a touch of a finger.
Increase the torque level gradually by instructions such as
Instruction Interpretation
TL 1.0 Increase torque limit to 1 volt.
TL 9.998 Increase torque limit to maximum, 9.998 volts.
The maximum level of 9.998 volts provides the full output torque.

Example 9 - Interrogation

The values of the parameters may be interrogated. Some examples …
Instruction Interpretation
Chapter 2 Getting Started 27 DMC-40x0 User Manual
KP? Return gain of A axis
KP ,,? Return gain of C axis.
KP ?,?,?,? Return gains of all axes.
Many other parameters such as KI, KD, FA, can also be interrogated. The command reference denotes all commands which can be interrogated.

Example 10 - Operation in the Buffer Mode

The instructions may be buffered before execution as shown below.
Instruction Interpretation
PR 600000 Distance
SP 10000 Speed
WT 10000 Wait 10000 milliseconds before reading the next instruction
BG A Start the motion

Example 11 - Using the On-Board Editor

Motion programs may be edited and stored in the controller’s on-board memory. When the command, ED is given from the Galil DOS terminal (such as DMCTERM), the controllers editor will be started.
The instruction
ED Edit mode
moves the operation to the editor mode where the program may be written and edited. The editor provides the line number. For example, in response to the first ED command, the first line is zero.
Line # Instruction Interpretation
000 #A Define label
001 PR 700 Distance
002 SP 2000 Speed
003 BGA Start A motion
004 EN End program
To exit the editor mode, input <cntrl>Q. The program may be executed with the command.
XQ #A Start the program running
If the ED command is issued from the Galil Windows terminal software (such as SmartTERM), the software will open a Windows based editor. From this editor a program can be entered, edited, downloaded and uploaded to the controller.

Example 12 - Motion Programs with Loops

Motion programs may include conditional jumps as shown below.
Instruction Interpretation
#A Label
DP 0 Define current position as zero
V1=1000 Set initial value of V1
#LOOP Label for loop
PA V1 Move A motor V1 counts
BG A Start A motion
AM A After A motion is complete
DMC-40x0 User Manual Chapter 2 Getting Started 28
WT 500 Wait 500 ms
TP A Tell position A
V1=V1+1000 Increase the value of V1
JP #LOOP,V1<10001 Repeat if V1<10001
EN End
After the above program is entered, quit the Editor Mode, <cntrl>Q. To start the motion, command:
XQ #A Execute Program #A

Example 13 - Motion Programs with Trippoints

The motion programs may include trippoints as shown below.
Instruction Interpretation
#B Label
DP 0,0 Define initial positions
PR 30000,60000 Set targets
SP 5000,5000 Set speeds
BGA Start A motion
AD 4000 Wait until A moved 4000
BGB Start B motion
AP 6000 Wait until position A=6000
SP 2000,50000 Change speeds
AP ,50000 Wait until position B=50000
SP ,10000 Change speed of B
EN End program
To start the program, command:
XQ #B Execute Program #B

Example 14 - Control Variables

Objective: To show how control variables may be utilized.
Instruction Interpretation
#A;DP0 Label; Define current position as zero
PR 4000 Initial position
SP 2000 Set speed
BGA Move A
AMA Wait until move is complete
WT 500 Wait 500 ms
#B
V1 = _TPA Determine distance to zero
PR -V1/2 Command A move 1/2 the distance
BGA Start A motion
AMA After A moved
WT 500 Wait 500 ms
V1= Report the value of V1
JP #C, V1=0 Exit if position=0
JP #B Repeat otherwise
#C Label #C
Chapter 2 Getting Started 29 DMC-40x0 User Manual
EN End of Program
To start the program, command
XQ #A Execute Program #A
This program moves A to an initial position of 1000 and returns it to zero on increments of half the distance. Note, _TPA is an internal variable which returns the value of the A position. Internal variables may be created by preceding a DMC-40x0 instruction with an underscore, _.

Example 15 - Linear Interpolation

Objective: Move A,B,C motors distance of 7000,3000,6000, respectively, along linear trajectory. Namely, motors start and stop together.
Instruction Interpretation
LM ABC Specify linear interpolation axes
LI 7000,3000,6000 Relative distances for linear interpolation
LE Linear End
VS 6000 Vector speed
VA 20000 Vector acceleration
VD 20000 Vector deceleration
BGS Start motion

Example 16 - Circular Interpolation

Objective: Move the AB axes in circular mode to form the path shown on Fig. 2-8. Note that the vector motion starts at a local position (0,0) which is defined at the beginning of any vector motion sequence. See application programming for further information.
Instruction Interpretation
VM AB Select AB axes for circular interpolation
VP -4000,0 Linear segment
CR 2000,270,-180 Circular segment
VP 0,4000 Linear segment
CR 2000,90,-180 Circular segment
VS 1000 Vector speed
VA 50000 Vector acceleration
VD 50000 Vector deceleration
VE End vector sequence
BGS Start motion
DMC-40x0 User Manual Chapter 2 Getting Started 30
(0,0) local zero
(0,4000)
(-4000,4000)
(-4000,0)
A
B
R=2000
Figure 2-7 Motion Path for Circular Interpolation Example
Chapter 2 Getting Started 31 DMC-40x0 User Manual

Chapter 3 Connecting Hardware

4080

Overview

The DMC-40x0 provides opto-isolated digital inputs for forward limit, reverse limit, home, and abort signals. The controller also has 8 opto-isolated, uncommitted inputs (for general use) as well as 8 high power opto- isolated outputs and 8 analog inputs configured for voltages between +/- 10 volts.
Controllers with 5 or more axes have an additional 8 opto-isolated inputs and an additional 8 high power opto-isolated outputs.
This chapter describes the inputs and outputs and their proper connection.

Using Optoisolated Inputs

Limit Switch Input

The forward limit switch (FLSx) inhibits motion in the forward direction immediately upon activation of the switch. The reverse limit switch (RLSx) inhibits motion in the reverse direction immediately upon activation of the switch. If a limit switch is activated during motion, the controller will make a decelerated stop using the deceleration rate previously set with the SD command. The motor will remain on (in a servo state) after the limit switch has been activated and will hold motor position.
When a forward or reverse limit switch is activated, the current application program that is running in thread zero will be interrupted and the controller will automatically jump to the #LIMSWI subroutine if one exists. This is a subroutine which the user can include in any motion control program and is useful for executing specific instructions upon activation of a limit switch. Automatic Subroutines for Monitoring Conditions are discussed in Chapter 7 Application Programming.
After a limit switch has been activated, further motion in the direction of the limit switch will not be possible until the logic state of the switch returns back to an inactive state. This usually involves physically opening the tripped switch. Any attempt at further motion before the logic state has been reset will result in the following error: “022 ­Begin not possible due to limit switch” error.
The operands, _LFx and _LRx, contain the state of the forward and reverse limit switches, respectively (x represents the axis, X, Y, Z, W etc.). The value of the operand is either a ‘0’ or ‘1’ corresponding to the logic state of the limit switch. Using a terminal program, the state of a limit switch can be printed to the screen with the command, MG_LFx or MG_LRx. This prints the value of the limit switch operands for the ‘x’ axis. The logic state of the limit switches can also be interrogated with the TS command. For more details on TS see the Command Reference.
DMC-40x0 User Manual Chapter 3 Connecting Hardware 32

Home Switch Input

Homing inputs are designed to provide mechanical reference points for a motion control application. A transition in the state of a Home input alerts the controller that a particular reference point has been reached by a moving part in the motion control system. A reference point can be a point in space or an encoder index pulse.
The Home input detects any transition in the state of the switch and toggles between logic states 0 and 1 at every transition. A transition in the logic state of the Home input will cause the controller to execute a homing routine specified by the user.
There are three homing routines supported by the DMC-40x0: Find Edge (FE), Find Index (FI), and Standard Home (HM).
The Find Edge routine is initiated by the command sequence: FEX <return>, BGX <return>. The Find Edge routine will cause the motor to accelerate, and then slew at constant speed until a transition is detected in the logic state of the Home input. The direction of the FE motion is dependent on the state of the home switch. High level causes forward motion. The motor will then decelerate to a stop. The acceleration rate, deceleration rate and slew speed are specified by the user, prior to the movement, using the commands AC, DC, and SP. When using the FE
command, it is recommended that a high deceleration value be used so the motor will decelerate rapidly after sensing the Home switch.
The Find Index routine is initiated by the command sequence: FIX <return>, BGX <return>. Find Index will cause the motor to accelerate to the user-defined slew speed (SP) at a rate specified by the user with the AC command and slew until the controller senses a change in the index pulse signal from low to high. The motor then decelerates to a stop at the rate previously specified by the user with the DC command and then moves back to the index pulse and speed HV. Although Find Index is an option for homing, it is not dependent upon a transition in the logic state of the Home input, but instead is dependent upon a transition in the level of the index pulse signal.
The Standard Homing routine is initiated by the sequence of commands HMX <return>, BGX <return>. Standard Homing is a combination of Find Edge and Find Index homing. Initiating the standard homing routine will cause the motor to slew until a transition is detected in the logic state of the Home input. The motor will accelerate at the rate specified by the command, AC, up to the slew speed. After detecting the transition in the logic state on the Home Input, the motor will decelerate to a stop at the rate specified by the command, DC. After the motor has decelerated to a stop, it switches direction and approaches the transition point at the speed of HV counts/sec. When the logic state changes again, the motor moves forward (in the direction of increasing encoder count) at the same speed, until the controller senses the index pulse. After detection, it decelerates to a stop, moves back to the index, and defines this position as 0. The logic state of the Home input can be interrogated with the command MG_HMX. This command returns a 0 or 1 if the logic state is low or high, respectively. The state of the Home input can also be interrogated indirectly with the TS command.
For examples and further information about Homing, see command HM, FI, FE of the Command Reference and the section entitled Homing in the Programming Motion Section of this manual.

Abort Input

The function of the Abort input is to immediately stop the controller upon transition of the logic state.
NOTE: The response of the abort input is significantly different from the response of an activated limit switch. When the abort input is activated, the controller stops generating motion commands immediately, whereas the limit switch response causes the controller to make a decelerated stop.
NOTE: The effect of an Abort input is dependent on the state of the off-on-error function for each axis. If the Off­On-Error function is enabled for any given axis, the motor for that axis will be turned off when the abort signal is generated. This could cause the motor to ‘coast’ to a stop since it is no longer under servo control. If the Off-On­Error function is disabled, the motor will decelerate to a stop as fast as mechanically possible and the motor will remain in a servo state.
All motion programs that are currently running are terminated when a transition in the Abort input is detected. This can be configured with the CN command. For information see the Command Reference, OE and CN.
Chapter 3 Connecting Hardware 33 DMC-40x0 User Manual

ELO (Electronic Lock-Out) Input

4080
Used in conjunction with Galil amplifiers, this input allows the user the shutdown the amplifier at a hardware level. For more detailed information on how specific Galil amplifiers behave when the ELO is triggered, see Integrated in the Appendices.

Reset Input

When this input is driven low, the controller will reset. This is the same as pressing the “RESET” button on the controller.

Uncommitted Digital Inputs

The DMC-40x0 has 8 opto-isolated inputs. These inputs can be read individually using the function @ IN[x] where x specifies the input number (1 thru 8). These inputs are uncommitted and can allow the user to create conditional statements related to events external to the controller. For example, the user may wish to have the x-axis motor move 1000 counts in the positive direction when the logic state of DI1 goes high.
This can be accomplished by connecting a voltage in the range of +5V to +28V into INCOM of the input circuitry from a separate power supply.
Controllers with more than 4 axes have an additional 8 general opto-isolated inputs (inputs 9-16). The INCOM for these inputs is found on the I/O (E-H) D-Sub connector.
An additional 32 I/O are provided at 3.3V (5V option) through the extended I/O. These are not opto­isolated.
NOTE: INCOM and LSCOM for Inputs 9-16 and Limit and Home Switches for axes 5-8 are found on the connectors for the E-H axes. These are NOT the same INCOM and LSCOM for axes 1-4.
DI9-DI16 INCOM (I/O (E-H) D-Sub connectors)
FLSE,RLSE,HOME FLSF,RLSF,HOMF FLSG,RLSG,HOMG FLSH,RLSH,HOMH
LSCOM (I/O (E-H) D-Sub connector)

Wiring the Optoisolated Inputs

Electrical Specifications

Input Common (INCOM) Max Voltage 28 VDC
Limit Common (LSCOM) Max Voltage 28 VDC
Minimum Current to turn on Inputs 1 mA

Bi-Directional Capability

All inputs can be used as active high or low - If you are using an isolated power supply you can connect the positive voltage of the supply (+Vs) to INCOM or supply the isolated ground to INCOM. Connecting +Vs to INCOM will configure the inputs for active low. Connecting the isolated ground to INCOM will configure the inputs for active high. If there is not an isolated available, the Galil 5V or 12V and GND may be used. It is recommended to use an isolated supply for the optoisolated inputs.
The optoisolated inputs are configured into groups. For example, the general inputs, DI1-DI8 (inputs 1-8), the ABRT (abort) input and RST (reset) and ELO (electronic lock-out) inputs are one group. Figure 3.1 illustrates the internal circuitry. The INCOM signal is a common connection for all of the inputs in each group.
DMC-40x0 User Manual Chapter 3 Connecting Hardware 34
4080
The ELO, ABRT and RST pins are found on the I/O (A-D) D-Sub and are duplicated on the I/O (E-H) D-Sub. I.e. There is only one ELO, ABRT and RST input for an 8 axis controller. The common is the INCOM found on the I/O (A-D) D-Sub connector.
The optoisolated inputs are connected in the following groups:
Group (Controllers with 1- 4 Axes) Common Signal
DI1-DI8, ABRT, RST, ELO INCOM (I/O (A-D) D-Sub Connectors)
FLSA,RLSA,HOMA FLSB,RLSB,HOMB FLSC,RLSC,HOMC FLSD,RLSD,HOMD
Group (Controllers with 5-8 Axes)
DI1-DI8, ABRT, RST, ELO INCOM (I/O (A-D) D-Sub Connectors)
FLSA,RLSA,HOMA FLSB,RLSB,HOMB FLSC,RLSC,HOMC FLSD,RLSD,HOMD
DI9-DI16 INCOM (I/O (E-H) D-Sub Connectors)
FLSE,RLSE,HOME FLSF,RLSF,HOMF FLSG,RLSG,HOMG FLSH,RLSH,HOMH
Table 3-1: INCOM and LSCOM information
LSCOM (I/O (A-D) D-Sub Connectors)
LSCOM (I/O (A-D) D-Sub Connectors)
LSCOM (I/O (E-H) D-Sub Connectors)
Chapter 3 Connecting Hardware 35 DMC-40x0 User Manual
LSCOM
INCOM
2.2k
RPACK
Additional Limit
Switches (Dependent on
Number of Axes)
FLSX RLSX HOMEX FLSY RLSY HOMY
2.2k
RPACK
DI1 DI2 DI3 DI4 DI5 DI6 DI7 DI8 ABRT
(XLATCH)
(YLATCH) (ZLATCH) (WLATCH)
Figure 3-1: The Optoisolated Inputs.

Using an Isolated Power Supply

To take full advantage of opto-isolation, an isolated power supply should be used to provide the voltage at the input common connection. When using an isolated power supply, do not connect the ground of the isolated power to the ground of the controller. A power supply in the voltage range between 5 to 28 Volts may be applied directly (see Figure 3-2). For voltages greater than 28 Volts, a resistor, R, is needed in series with the input such that:
1 mA < V supply/(R + 2.2K) < 11 mA
DMC-40x0 User Manual Chapter 3 Connecting Hardware 36
External Resistor Needed for
Voltages > 28V
LSCOM
External Resistor Needed for
Voltages > 28V
LSCOM
2.2K
FLSX
Configuration to source current at the
LSCOM terminal and sink current at
switch inputs
Figure 3-2. Connecting a single Limit or Home Switch to an Isolated Supply. This diagram only shows the connection for the
forward limit switch of the X axis.
Configuration to sink current at the
LSCOM terminal and source current at
switch inputs
2.2K
FLSX

Bypassing the Opto-Isolation:

If no isolation is needed, the internal 5 Volt supply may be used to power the switches. This can be done by connecting LSCOM or INCOM to 5V.
To close the circuit, wire the desired input to any ground (GND) pin on the controller.

TTL Inputs

The Auxiliary Encoder Inputs

The auxiliary encoder inputs can be used for general use. For each axis, the controller has one auxiliary encoder and each auxiliary encoder consists of two inputs, channel A and channel B. The auxiliary encoder inputs are mapped to the inputs 81-96.
Each input from the auxiliary encoder is a differential line receiver and can accept voltage levels between +/- 12 volts. The inputs have been configured to accept TTL level signals. To connect TTL signals, simply connect the signal to the + input and leave the - input disconnected. For other signal levels, the - input should be connected to a voltage that is ½ of the full voltage range (for example, connect the - input to 6 volts if the signal is a 0 - 12 volt logic).
Example:
A DMC-4010 has one auxiliary encoder. This encoder has two inputs (channel A and channel B). Channel A input is mapped to input 81 and Channel B input is mapped to input 82. To use this input for 2 TTL signals, the first signal will be connected to AA+ and the second to AB+. AA- and AB- will be left unconnected. To access this input, use the function @IN[81] and @IN[82].
NOTE: The auxiliary encoder inputs are not available for any axis that is configured for stepper motor.
Chapter 3 Connecting Hardware 37 DMC-40x0 User Manual

High Power Opto-Isolated Outputs

4080
The DMC-40x0 has different interconnect module options, this section will describe the 500mA optically isolated outputs that are used on the ICM-42x00.

Electrical Specifications

Output Common Max Voltage 30 VDC
Output Common Min Voltage 12 VDC
Max Drive Current per Output 0.5 A (not to exceed 3A for all 8 outputs)

Wiring the Opto-Isolated Outputs

The ICM-42x00 module allows for opto-isolation on all of the digital inputs and outputs. The digital outputs are optically isolated and are capable of sourcing up to 0.5 A per pin with a 3 A limit for the group of 8 outputs. The outputs are configured for hi-side drive only. The supply voltage must be connected to output supply voltage (OPWR), and the supply return must be connected to output return (ORET).
Figure 3-3 shows the manner in which the load should be connected. The output will be at the voltage that is supplied to the OPWR pin. Up to 30 VDC may be supplied to OPWR.
Figure 3-3 ICM-42x00 General-Purpose Digital Output Opto-Isolation
For controllers with 5-8 axes, outputs 9-16 are located on the I/O (E-H) D-Sub connector. The OPWR and ORET for these outputs are also found on the I/O (E-H) D-Sub connector. Connections to the OPWR and ORET on the I/O (E-H) as described above are required for operation of outputs 9-16.
DMC-40x0 User Manual Chapter 3 Connecting Hardware 38

Analog Inputs

4080
4080
The DMC-40x0 has eight analog inputs configured for the range between -10V and 10V. The inputs are decoded by a 12-bit A/D decoder giving a voltage resolution of approximately .005V. A 16-bit ADC is available as an option (Ex. DMC-4020(-16bit)-C012-I000). The analog inputs are specified as AN[x] where x is a number 1 thru 8.

AQ settings

The analog inputs can be set to a range of +/-10V, +/-5V, 0-5V or 0-10V. The inputs can also be set into a differential mode where analog inputs 2,4,6 and 8 can be set to the negative differential inputs for analog inputs 1,3,5 and 7 respectivally. See the AQ command in the command reference for more information.

Electrical Specifications

Input Impedance (12 and 16 bit) –
Single Ended (Unipolar) 42k Differential (Bipolar) 31k

TTL Outputs

Output Compare

The output compare signal is TTL and is available on the I/O (A-D) D-Sub connector as CMP. Output compare is controlled by the position of any of the main encoders on the controller. The output can be programmed to produce an active low pulse (250 nsec) based on an incremental encoder value or to activate once when an axis position has been passed. For further information, see the command OC in the Command Reference.
For controllers with 5-8 axes, a second output compare signal is available on the I/O (E-H) D-Sub connector.

Error Output

The controller provides a TTL signal, ERR, to indicate a controller error condition. When an error condition occurs, the ERR signal will go low and the controller LED will go on. An error occurs because of one of the following conditions:
1. At least one axis has a position error greater than the error limit. The error limit is set by using the command ER.
2. The reset line on the controller is held low or is being affected by noise.
3. There is a failure on the controller and the processor is resetting itself.
4. There is a failure with the output IC which drives the error signal.
The ERR signal is found on the I/O (A-D) D-Sub connector.
For controllers with 5-8 axes, the ERR signal is duplicated on the I/O (E-H) D-Sub connector.
Chapter 3 Connecting Hardware 39 DMC-40x0 User Manual

Extended I/O of the DMC-40x0 Controller

The DMC-40x0 controller offers 32 extended TTL I/O points which can be configured as inputs or outputs in 8 bit increments. Configuration is accomplished with command CO – see Extended I/O of the DMC-40x0 Controller. The I/O points are accessed through the 44 pin D-Sub connector labeled EXTENDED I/O. See the A5 – CMB­41012 (-C012) section in the Appendix for a complete pin out of the Extended I/O.

Electrical Specifications (3.3V – Standard)

Inputs
Max Input Voltage 3.4 VDC
Guarantee High Voltage 2.0 VDC
Guarantee Low Voltage 0.8 VDC
Inputs are internally pulled up to 3.3V through a 4.7kresistor
Outputs
Sink/Source 4mA per output

Electrical Specifications (5V – Option)

Inputs
Max Input Voltage 5.25 VDC
Guarantee High Voltage 2.0 VDC
Guarantee Low Voltage 0.8 VDC
Inputs are internally pulled up to 5V through a 4.7kresistor
Outputs
Sink/Source 20mA
DMC-40x0 User Manual Chapter 3 Connecting Hardware 40

Amplifier Interface

Electrical Specifications

Max Amplifier Enable Voltage 24V
Max Amplifier Enable Current @24V sink/source 25 mA
Motor Command Output Impedance 500

Overview

The DMC-40x0 command voltage ranges between +/-10V and is output on the motor command line - MCMn (where n is A-H). This signal, along with GND, provides the input to the motor amplifiers. The amplifiers must be sized to drive the motors and load. For best performance, the amplifiers should be configured for a torque (current) mode of operation with no additional compensation. The gain should be set such that a 10 volt input results in the maximum required current.
Note: The DMC-40x0 controller has an option for differential motor command outputs. For more information contact Galil.
The DMC-40x0 also provides an amplifier enable signal - AENn (where n is A-H). This signal changes under the following conditions: the motor-off command, MO, is given, the watchdog timer activates, or the OE command (Enable Off-On-Error) is set and the position error exceeds the error limit or a limit switch is reached (see OE command in the Command Reference for more information).
For all versions of the ICM-42x00, the standard configuration of the amplifier enable signal is 5V active high amp enable (HAEN) sinking. In other words, the AEN signal will be high when the controller expects the amplifier to be enabled. The polarity and the amplitude can be changed by configuring the Amplifier Enable Circuit on the ICM­42x00.
If your amplifier requires a different configuration than the default 5V HAEN sinking it is highly recommended that the DMC-40x0 is ordered with the desired configuration. See the DMC-40x0 ordering
information in the catalog (http://www.galilmc.com/catalog/cat40x0.pdf) or contact Galil for more information on ordering different configurations.
Note1: Many amplifiers designate the enable input as ‘inhibit’.

ICM-42000 and ICM-42100 Amplifier Enable Circuit

This section describes how to configure the ICM-42000 and ICM-42100 for different Amplifier Enable configurations. It is advised that the user order the DMC-40x0 with the proper Amplifier enable configuration.
The ICM-42000 and ICM-42100 gives the user a broad range of options with regards to the voltage levels present on the enable signal. The user can choose between High-Amp-Enable (HAEN), Low-Amp-Enable (LAEN), 5V logic, 12V logic, external voltage supplies up to 24V, sinking, or sourcing. Tables 3-2 and 3-3 found below illustrate the settings for jumpers, resistor packs, and the socketed optocoupler IC. Refer to Figures 3-4 and 3-5 for precise physical locations of all components. Note that the resistor pack located at RP2 may be reversed to change the active state of the amplifier enable output. However, the polarity of RP6 must not be changed; a different resistor value may be needed to limit the current to 6 mA. The default value for RP6 is 820 ohms, which works at 5V.
When using 24 V, RP6 should be replaced with a 4.7 k resistor pack.
NOTE: For detailed step-by-step instructions on changing the Amplifier Enable configuration on the ICM-42000 or ICM-42100 see the Configuring the Amplifier Enable Circuit section in the Appendices.
Chapter 3 Connecting Hardware 41 DMC-40x0 User Manual
Amplifier Enable Circuit
Sinking Output Configuration
(Pin 1 of LTV8441 in Pin 2 of Socket U4)
TTL level Amp
Enable signal
from controller
(SH = 5V, MO = 0V)
TTL level Amp
Enable signal
from controller
(SH = 5V, MO = 0V)
PIN 1
RP2 (470 Ohm)
Pin 1
LTV8441
Pin 1
of socket
Socket U4
RP6 (820 Ohm)
+5 V
GND
AEC2
+12 V
+5 V
GND
AEC2
+12 V
AECOM2
JP2
Amp Enable Output to Drive (AENn)
AECOM2
+12 V
AEC1
+5 V
GND
JP2
AECOM1
JP1
Figure 3-4: Amplifier Enable Circuit Sinking Output Configuration
Sinking Configuration (pin1 of LTV8441 chip in pin2 of socket U4)
RP2
Logic State JP1 JP2
5V, HAEN (Default Configuration) 5V - AECOM1 GND – AECOM2 Dot on R-pack next to RP2 label
5V, LAEN 5V – AECOM1 GND – AECOM2 Dot on R-pack opposite RP2 label
12V, HAEN +12V – AECOM1 GND – AECOM2 Dot on R-pack next to RP2 label
12V, LAEN +12V – AECOM1 GND – AECOM2 Dot on R-pack opposite RP2 label
Isolated 24V, HAEN AEC1 – AECOM1 AEC2 – AECOM2 Dot on R-pack next to RP2 label
Isolated 24V, LAEN AEC1 - AECOM1 AEC2 - AECOM2 Dot on R-pack opposite RP2 label
For 24V isolated enable, tie +24V of external power supply to AEC1 at the D-sub, tie common return to AEC2. Replace
RP6 with a 4.7 kΩ resistor pack. For Axes A-D, AEC1 and AEC2 are located on the EXTERNAL DRIVER (A-D) D-Sub connector. For Axes E-H, AEC1 and AEC2 are located on the EXTERNAL DRIVER (E-H) D-Sub connector. Note: AEC1 and AEC2 for axes A-D are NOT connected to AEC1 and AEC2 for axes E-H.
Table 3-2: Sinking Configuration
(square pin next to RP2 label is 5V)
DMC-40x0 User Manual Chapter 3 Connecting Hardware 42
Amplifier Enable Circuit
Sourcing Output Configuration
(Pin 1 of LTV8441 in Pin 1 of Socket U4)
TTL level Amp
Enable signal
from controller
(SH = 5V, MO = 0V)
TTL level Amp
Enable signal
from controller
(SH = 5V, MO = 0V)
5V or GND
PIN 1
RP2 (470 Ohm)
Pin 1
of socket
Pin 1
LTV8441
Socket U4
RP6 (820 Ohm)
+5 V
GND
AEC2
+12 V
+5 V
GND
AEC2
+12 V
Amp Enable Output to Drive (AENn)
AECOM1
AECOM2
JP2
AECOM2
+12 V
AEC1
+5 V
GND
JP2
JP1
Figure 3-5: Amplifier Enable Circuit Sourcing Output Configuration
Sourcing Configuration (pin1 of LTV8441 chip in pin1 of socket U4)
RP2
Logic State JP1 JP2
5V, HAEN GND – AECOM1 5V – AECOM2 Dot on R-pack opposite RP2 label
5V, LAEN GND – AECOM1 5V – AECOM2 Dot on R-pack next to RP2 label
12V, HAEN GND – AECOM1 +12V – AECOM2 Dot on R-pack opposite RP2 label
12V, LAEN GND – AECOM1 +12V – AECOM2 Dot on R-pack next to RP2 label
Isolated 24V, HAEN AEC1 – AECOM1 AEC2 - AECOM2 Dot on R-pack opposite RP2 label
Isolated 24V, LAEN AEC1 - AECOM1 AEC2 – AECOM2 Dot on R-pack next to RP2 label
For 24V isolated enable, tie +24V of external power supply to AEC2 at the D-sub, tie common return to AEC1. Replace RP6 with a 4.7 kΩ resistor pack. For Axes A-D, AEC1 and AEC2 are located on the EXTERNAL DRIVER (A-D) D-Sub connector. For Axes E-H, AEC1 and AEC2 are located on the EXTERNAL DRIVER (E-H) D-Sub connector. Note: AEC1 and AEC2 for axes A-D are NOT connected to AEC1 and AEC2 for axes E-H.
Table3-3: Sourcing Configuration
(square pin next to RP2 label is 5V)
Chapter 3 Connecting Hardware 43 DMC-40x0 User Manual

ICM-42200 Amplifier Enable Circuit

This section describes how to configure the ICM-42200 for different Amplifier Enable outputs. The ICM-42200 is designed to be used with external amplifiers. As a result, the amplifier enable circuit for each axis is individually configurable through jumper settings. The user can choose between High-Amp-Enable (HAEN), Low-Amp-Enable (LAEN), 5V logic, 12V logic, external voltage supplies up to 24V, sinking, or sourcing. Every different configuration is described below with jumper settings and a schematic of the circuit.
DMC-40x0 User Manual Chapter 3 Connecting Hardware 44
Chapter 3 Connecting Hardware 45 DMC-40x0 User Manual
DMC-40x0 User Manual Chapter 3 Connecting Hardware 46
Chapter 3 Connecting Hardware 47 DMC-40x0 User Manual
Chapter 4 Software Tools and
Communication

Introduction

The default configuration DMC-40x0 has two RS232 ports and 1 Ethernet port. The main RS-232 port is the data set and can be configured through the jumpers on the top of the controller. The auxiliary RS-232 port is the data term and can be configured with the software command CC. The auxiliary RS-232 port can be configured either for daisy chain operation or as a general port. This configuration can be saved using the Burn (BN) instruction. The RS232 ports also have a clock synchronizing line that allows synchronization of motion on more than one controller.
Galil software is available for PC computers running Microsoft Windows® to communicate with the DMC-40x0 controller. Standard Galil communications software utilities are available for Windows operating systems, which includes GalilTools. This software package has been developed to operate under Windows and Linix, and include all the necessary drivers to communicate to the controller. In addition, GalilTools includes a software development communication library which allows users to create their own application interfaces using programming environments such as C, C++, Visual Basic, and LabVIEW.
The following sections in this chapter are a description of the communications protocol, and a brief introduction to the software tools and communication techniques used by Galil. At the application level, GalilTools is the basic programs that the majority of users will need to communicate with the controller, to perform basic setup, and to develop application code (.DMC programs) that is downloaded to the controller. At the Galil API level, the GalilTools Communication Library is available for users, who wish to develop their own custom application programs to communicate to the controller. Custom application programs can utilize API function calls directly to our DLL’s. At the driver level, we provide fundamental hardware interface information for users who desire to create their own drivers.

RS232 and RS422 Ports

The RS232 pin-out description for the main and auxiliary port is given below. Note that the auxiliary port is essentially the same as the main port except inputs and outputs are reversed. The DMC-40x0 may also be configured by the factory for RS422. These pin-outs are also listed below.

RS-232 Configuration

NOTE: If you are connecting the RS232 auxiliary port to a terminal or any device which is a DATASET, it is
necessary to use a connector adapter, which changes a dataset to a dataterm. This cable is also known as a 'null' modem cable.

DMC-40x0 User Manual Chapter 4 Software Tools and Communication 48

RS232 - Main Port {P1} DATATERM
1 No Connect 6 No Connect
2 Transmit Data - output 7 Clear To Send - input
3 Receive Data - input 8 Request To Send - output
4 No Connect 9 No connect
5 Ground
RS232 - Auxiliary Port {P2} DATASET
1 No Connect 6 No Connect
2 Receive Data - input 7 Request To Send - output
3 Transmit Data - output 8 Clear To Send - input
4 No Connect 9 No Connect (Can be connected to 5V with APWR jumper)
5 Ground
Configuration
Configure your PC for 8-bit data, one start-bit, one stop-bit, full duplex and no parity. The baud rate for the RS232 communication can be selected by setting the proper switch configuration on the front panel according to the table below.
Baud Rate Selection
SWITCH SETTINGS
19.2 38.4 BAUD RATE
ON ON 9600
ON OFF 19200
OFF ON 38400
OFF OFF 115200
Handshaking
The RS232 main port is set for hardware handshaking. Hardware Handshaking uses the RTS and CTS lines. The CTS line will go high whenever the DMC-40x0 is not ready to receive additional characters. The RTS line will inhibit the DMC-40x0 from sending additional characters. Note, the RTS line goes high for inhibit.
The auxiliary port of the DMC-40x0 can be configured either as a general port or for the daisy-chain. When configured as a general port, the port can be commanded to send ASCII messages to another DMC-40x0 controller or to a display terminal or panel.
CC Command: (Configure Communication) at port 2. The command is in the format of (See CC in the Command Reference for more information):
CC m,n,r,p
where ‘m’ sets the baud rate, ‘n’ sets for either handshake or non-handshake mode, ‘r’ sets for general port or the auxiliary port, and ‘p’ turns echo on or off.
m - Baud Rate – 9600,19200,38400,115200 n - Handshake - 0=No; 1=Yes r - Mode - 0=Disabled; 1=enabled p - Echo - 0=Off; 1=On; Valid only if r=0
NOTE: for the handshake of the auxiliary port, the roles for the RTS and CTS lines are reversed.
Chapter 4 Software Tools and Communication 49 DMC-40x0 User Manual
Example:
CC 19200,0,1,1
Configure auxiliary communication port for 19200 baud, no handshake, general port mode and echo turned on.

RS-422 Configuration

The DMC-40x0 can be ordered with the main and/or auxiliary port configured for RS-422 communication. RS-422 communication is a differentially driven serial communication protocol that should be used when long distance serial communication is required in an application.
RS-422-Main Port (Non-Standard Option)
Standard connector and cable when DMC-40x0 is ordered with RS-422 Option.
Pin Signal
1 RTS-
2 TXD-
3 RXD-
4 CTS-
5 GND
6 RTS+
7 TXD+
8 RXD+
9 CTS+
RS-422-Auxiliary Port (Non-Standard Option)
Standard connector and cable when DMC-40x0 is ordered with RS-422 Option.
Pin Signal
1 CTS-
2 RXD-
3 TXD-
4 RTS-
5 GND
6 CTS+
7 RXD+
8 TXD+
9 RTS+

Ethernet Configuration

Communication Protocols

The Ethernet is a local area network through which information is transferred in units known as packets. Communication protocols are necessary to dictate how these packets are sent and received. The DMC-40x0 supports two industry standard protocols, TCP/IP and UDP/IP. The controller will automatically respond in the format in which it is contacted.
DMC-40x0 User Manual Chapter 4 Software Tools and Communication 50
TCP/IP is a "connection" protocol. The master must be connected to the slave in order to begin communicating. Each packet sent is acknowledged when received. If no acknowledgement is received, the information is assumed lost and is resent.
Unlike TCP/IP, UDP/IP does not require a "connection". This protocol is similar to communicating via RS232. If information is lost, the controller does not return a colon or question mark. Because the protocol does not provide for lost information, the sender must re-send the packet.
Although UDP/IP is more efficient and simple, Galil recommends using the TCP/IP protocol. TCP/IP insures that if a packet is lost or destroyed while in transit, it will be resent.
Ethernet communication transfers information in ‘packets’. The packets must be limited to 512 data bytes (including UDP/TCP IP Header) or less. Larger packets could cause the controller to lose communication.
NOTE: In order not to lose information in transit, Galil recommends that the user wait for an acknowledgement of receipt of a packet before sending the next packet.

Addressing

There are three levels of addresses that define Ethernet devices. The first is the MAC or hardware address. This is a unique and permanent 6 byte number. No other device will have the same MAC address. The DMC-40x0 MAC address is set by the factory and the last two bytes of the address are the serial number of the board. To find the Ethernet MAC address for a DMC-40x0 unit, use the TH command. A sample is shown here with a unit that has a serial number of 3:
Sample MAC Ethernet Address: 00-50-4C-20-04-AF
The second level of addressing is the IP address. This is a 32-bit (or 4 byte) number that usually looks like this:
192.168.15.1. The IP address is constrained by each local network and must be assigned locally. Assigning an IP address to the DMC-40x0 controller can be done in a number of ways.
The first method for setting the IP address is using a DHCP server. The DH command controls whether the DMC­40x0 controller will get an IP address from the DHCP server. If the unit is set to DH1 (default) and there is a DHCP server on the network, the controller will be dynamically assigned an IP address from the server. Setting the board to DH0 will prevent the controller from being assigned an IP address from the server.
The second method to assign an IP address is to use the BOOT-P utility via the Ethernet connection. The BOOT-P functionality is only enabled when DH is set to 0. Either a BOOT-P server on the internal network or the Galil software may be used. When opening the Galil Software, it will respond with a list of all DMC-40x0’s and other controllers on the network that do not currently have IP addresses. The user must select the board and the software will assign the specified IP address to it. This address will be burned into the controller (BN) internally to save the IP address to the non-volatile memory.
NOTE: if multiple boards are on the network – use the serial numbers to differentiate them.
CAUTION: Be sure that there is only one BOOT-P or DHCP server running. If your network has DHCP or BOOT-P running, it may automatically assign an IP address to the DMC-40x0 controller upon linking it to the network. In order to ensure that the IP address is correct, please contact your system administrator before connecting the I/O board to the Ethernet network.
The third method for setting an IP address is to send the IA command through the RS-232 port. (Note: The IA command is only valid if DH0 is set). The IP address may be entered as a 4 byte number delimited by commas (industry standard uses periods) or a signed 32 bit number (e.g. IA 124,51,29,31 or IA 2083724575). Type in BN to save the IP address to the DMC-40x0 non-volatile memory.
NOTE: Galil strongly recommends that the IP address selected is not one that can be accessed across the Gateway. The Gateway is an application that controls communication between an internal network and the outside world.
Chapter 4 Software Tools and Communication 51 DMC-40x0 User Manual
The third level of Ethernet addressing is the UDP or TCP port number. The Galil board does not require a specific port number. The port number is established by the client or master each time it connects to the DMC-40x0 board. Typical port numbers for applications are:
Port 23: Telnet Port 502: Modbus

Communicating with Multiple Devices

The DMC-40x0 is capable of supporting multiple masters and slaves. The masters may be multiple PC's that send commands to the controller. The slaves are typically peripheral I/O devices that receive commands from the controller.
NOTE: The term "Master" is equivalent to the internet "client". The term "Slave" is equivalent to the internet "server".
An Ethernet handle is a communication resource within a device. The DMC-40x0 can have a maximum of 8 Ethernet handles open at any time. When using TCP/IP, each master or slave uses an individual Ethernet handle. In UDP/IP, one handle may be used for all the masters, but each slave uses one. (Pings and ARPs do not occupy handles.) If all 8 handles are in use and a 9th master tries to connect, it will be sent a "reset packet" that generates the appropriate error in its windows application.
NOTE: There are a number of ways to reset the controller. Hardware reset (push reset button or power down controller) and software resets (through Ethernet or RS232 by entering RS). The only reset that will not cause the controller to disconnect is a software reset via the Ethernet.
When the Galil controller acts as the master, the IH command is used to assign handles and connect to its slaves. The IP address may be entered as a 4 byte number separated with commas (industry standard uses periods) or as a signed 32 bit number. A port number may also be specified, but if it is not, it will default to 1000. The protocol (TCP/IP or UDP/IP) to use must also be designated at this time. Otherwise, the controller will not connect to the slave. (Ex. IHB=151,25,255,9<179>2 This will open handle #2 and connect to the IP address 151.25.255.9, port 179, using TCP/IP)
Which devices receive what information from the controller depends on a number of things. If a device queries the controller, it will receive the response unless it explicitly tells the controller to send it to another device. If the command that generates a response is part of a downloaded program, the response will route to whichever port is specified as the default (unless explicitly told to go to another port with the CF command). To designate a specific destination for the information, add {Eh} to the end of the command. (Ex. MG{EC}"Hello" will send the message "Hello" to handle #3. TP,,?{EF} will send the z axis position to handle #6.)

Multicasting

A multicast may only be used in UDP/IP and is similar to a broadcast (where everyone on the network gets the information) but specific to a group. In other words, all devices within a specified group will receive the information that is sent in a multicast. There can be many multicast groups on a network and are differentiated by their multicast IP address. To communicate with all the devices in a specific multicast group, the information can be sent to the multicast IP address rather than to each individual device IP address. All Galil controllers belong to a default multicast address of 239.255.19.56. The controller's multicast IP address can be changed by using the IA> u command.

Using Third Party Software

Galil supports DHCP, ARP, BOOT-P, and Ping which are utilities for establishing Ethernet connections. DHCP is a protocol used by networked devices (clients) to obtain the parameters necessary for operation in an Internet Protocol network. ARP is an application that determines the Ethernet (hardware) address of a device at a specific IP address. BOOT-P is an application that determines which devices on the network do not have an IP address and assigns the IP address you have chosen to it. Ping is used to check the communication between the device at a specific IP address and the host computer.
DMC-40x0 User Manual Chapter 4 Software Tools and Communication 52
The DMC-40x0 can communicate with a host computer through any application that can send TCP/IP or UDP/IP packets. A good example of this is Telnet, a utility that comes with most Windows systems.

Modbus

An additional protocol layer is available for speaking to I/O devices. Modbus is an RS-485 protocol that packages information in binary packets that are sent as part of a TCP/IP packet. In this protocol, each slave has a 1 byte slave address. The DMC-40x0 can use a specific slave address or default to the handle number. The port number for Modbus is 502.
The Modbus protocol has a set of commands called function codes. The DMC-40x0 supports the 10 major function codes:
Function Code Definition
01 Read Coil Status (Read Bits)
02 Read Input Status (Read Bits)
03 Read Holding Registers (Read Words)
04 Read Input Registers (Read Words)
05 Force Single Coil (Write One Bit)
06 Preset Single Register (Write One Word)
07 Read Exception Status (Read Error Code)
15 Force Multiple Coils (Write Multiple Bits)
16 Preset Multiple Registers (Write Words)
17 Report Slave ID
The DMC-40x0 provides three levels of Modbus communication. The first level allows the user to create a raw packet and receive raw data. It uses the MBh command with a function code of –1. The format of the command is
MBh = -1,len,array[] where len is the number of bytes
array[] is the array with the data
The second level incorporates the Modbus structure. This is necessary for sending configuration and special commands to an I/O device. The formats vary depending on the function code that is called. For more information refer to the Command Reference.
The third level of Modbus communication uses standard Galil commands. Once the slave has been configured, the commands that may be used are @IN[], @AN[], SB, CB, OB, and AO. For example, AO 2020,8.2 would tell I/O number 2020 to output 8.2 volts.
If a specific slave address is not necessary, the I/O number to be used can be calculated with the following:
I/O Number = (HandleNum*1000) + ((Module-1)*4) + (BitNum-1)
Where HandleNum is the handle number from 1 (A) to 6 (F). Module is the position of the module in the rack from 1 to 16. BitNum is the I/O point in the module from 1 to 4.
If an explicit slave address is to be used, the equation becomes:
I/O Number = (SlaveAddress*10000) + (HandleNum*1000) +((Module-1)*4) + (Bitnum-1)
Chapter 4 Software Tools and Communication 53 DMC-40x0 User Manual

Modbus Examples

Example #1
DMC-4040 connected as a Modbus master to a RIO-47120 via Modbus. The DMC-4040 will set or clear all 16 of the RIO’s digital outputs
1. Begin by opening a connection to the RIO which in our example has IP address 192.168.1.120
IHB=192,168,1,120<502 (Issued to DMC-4040)
2. Dimension an array to store the commanded values. Set array element 0 equal to 170 and array element 1 equal to 85. (array element 1 configures digital outputs 15-8 and array element 0 configures digital outputs 7-0)
DM myarray[2] myarray[0] = 170 (which is 10101010 in binary) myarray[1] = 85 (which is 01010101in binary)
3. a) Send the appropriate MB command. Use function code 15. Start at output 0 and set/clear all 16 outputs based on the data in myarray[]
MBB=,15,0,16,myarray[]
3. b) Set the outputs using the SB command.
SB2001;SB2003;SB2005;SB2007;SB2008;SB2010;SB2012;SB2014;
Results:
Both steps 3a and 3b will result in outputs being activated as below. The only difference being that step 3a will set and clear all 16 bits where as step 3b will only set the specified bits and will have no affect on the others.
Bit Number Status Bit Number Status
0 0 8 1
1 1 9 0
2 0 10 1
3 1 11 0
4 0 12 1
5 1 13 0
6 0 14 1
7 1 15 0
Example #2
DMC-4040 connected as a Modbus master to a 3rd party PLC. The DMC-4040 will read the value of analog inputs 3 and 4 on the PLC located at addresses 40006 and 40008 respectively. The PLC stores values as 32-bit floating point numbers which is common.
1. Begin by opening a connection to the PLC which has an IP address of 192.168.1.10 in our example
IHB=192,168,1,10<502
2. Dimension an array to store the results
DMC-40x0 User Manual Chapter 4 Software Tools and Communication 54
DM myanalog[4]
3. Send the appropriate MB command. Use function code 4 (as specified per the PLC). Start at address 40006. Retrieve 4 modbus registers (2 modbus registers per 1 analog input, as specified by the PLC)
MBB=,4,40006,4,myanalog[]
Results:
Array elements 0 and 1 will make up the 32 bit floating point value for analog input 3 on the PLC and array elements 2 and 3 will combine for the value of analog input 4.
myanalog[0]=16412=0x401C
myanalog[1]=52429=0xCCCD
myanalog[2]=49347=0xC0C3
myanalog[3]=13107=0x3333
Analog input 3 = 0x401CCCCD = 2.45V
Analog input 4 = 0xC0C33333 = -6.1V
Example #3
DMC-4040 connected as a Modbus master to a hydraulic pump. The DMC-4040 will set the pump pressure by writing to an analog output on the pump located at Modbus address 30000 and consisting of 2 Modbus registers forming a 32 bit floating point value.
1. Begin by opening a connection to the pump which has an IP address of 192.168.1.100 in our example
IHB=192,168,1,100<502
2. Dimension and fill an array with values that will be written to the PLC
DM pump[2]
pump[0]=16531=0x4093
pump[1]=13107=0x3333
3. Send the appropriate MB command. Use function code 16. Start at address 30000 and write to 2 registers using the data in the array pump[]
MBB=,16,30000,2,pump[]
Results:
Analog output will be set to 0x40933333 which is 4.6V
To view an example procedure for communicating with an OPTO-22 rack, refer to Example- Communicating with OPTO-22 SNAP-B3000-ENET in the Appendices.

Data Record

The DMC-40x0 can provide a block of status information with the use of a single command, QR. This command, along with the QZ command can be very useful for accessing complete controller status. The QR command will return 4 bytes of header information and specific blocks of information as specified by the command arguments:
QR ABCDEFGHST
Each argument corresponds to a block of information according to the Data Record Map below. If no argument is given, the entire data record map will be returned. Note that the data record size will depend on the number of axes.
Chapter 4 Software Tools and Communication 55 DMC-40x0 User Manual
Note: UB = Unsigned Byte (1), UW = Unsigned Word (2), SW = Signed Word (2), SL = Signed Long Word (4), UL = Unsigned Long Word (4)
ADDR TYPE ITEM
00 UB 1st Byte of Header
01 UB 2nd Byte of Header
02 UB 3rd Byte of Header
03 UB 4th Byte of Header
04-05 UW sample number
06 UB general input block 0 (inputs 1-8)
07 UB general input block 1 (inputs 9-16)
08 UB general input block 2 (inputs 17-24)
09 UB general input block 3 (inputs 25-32)
10 UB general input block 4 (inputs 33-40)
11 UB general input block 5 (inputs 41-48)
12 UB general input block 6 (inputs 49-56)
13 UB general input block 7 (inputs 57-64)
14 UB general input block 8 (inputs 65-72)
15 UB general input block 9 (inputs 73-80)
16 UB general output block 0 (outputs 1-8)
17 UB general output block 1 (outputs 9-16)
18 UB general output block 2 (outputs 17-24)
19 UB general output block 3 (outputs 25-32)
20 UB general output block 4 (outputs 33-40)
21 UB general output block 5 (outputs 41-48)
22 UB general output block 6 (outputs 49-56)
23 UB general output block 7 (outputs 57-64)
24 UB general output block 8 (outputs 65-72)
25 UB general output block 9 (outputs 73-80)
26-27 SW (new) Reserved
28-29 SW (new) Reserved
30-31 SW (new) Reserved
32-33 SW (new) Reserved
34-35 SW (new) Reserved
36-37 SW (new) Reserved
38-39 SW (new) Reserved
40-41 SW (new) Reserved
42 UB Ethernet Handle A Status
43 UB Ethernet Handle B Status
44 UB Ethernet Handle C Status
45 UB Ethernet Handle D Status
46 UB Ethernet Handle E Status
47 UB Ethernet Handle F Status
48 UB Ethernet Handle G Status
49 UB Ethernet Handle H Status
DMC-40x0 User Manual Chapter 4 Software Tools and Communication 56
50 UB error code
51 UB thread status – see bit field map below
52-55 UL (new) Amplifier Status
56-59 UL (new) Segment Count for Contour Mode
60-61 UW (new) Buffer space remaining – Contour Mode
62-63 UW segment count of coordinated move for S plane
64-65 UW coordinated move status for S plane – see bit field map below
66-69 SL distance traveled in coordinated move for S plane
70-71 UW (new) Buffer space remaining – S Plane
72-73 UW segment count of coordinated move for T plane
74-75 UW Coordinated move status for T plane – see bit field map below
76-79 SL distance traveled in coordinated move for T plane
80-81 UW (new) Buffer space remaining – T Plane
Axis information:
82-83 UW A axis status – see bit field map below
84 UB A axis switches – see bit field map below
85 UB A axis stop code
86-89 SL A axis reference position
90-93 SL A axis motor position
94-97 SL A axis position error
98-101 SL A axis auxiliary position
102-105 SL A axis velocity
106-109 SL (new size) A axis torque
110-111 SW or UW
112 UB(new) A Hall Input Status
113 UB Reserved
114-117 SL (new) A User defined variable (ZA)
118-119 UW B axis status – see bit field map below
120 UB B axis switches – see bit field map below
121 UB B axis stop code
122-125 SL B axis reference position
126-129 SL B axis motor position
130-133 SL B axis position error
134-137 SL B axis auxiliary position
138-141 SL B axis velocity
142-145 SL (new size) B axis torque
146-147 SW or UW
148 UB (new) B Hall Input Status
149 UB Reserved
150-153 SL (new) B User defined variable (ZA)
154-155 UW C axis status – see bit field map below
156 UB C axis switches – see bit field map below
157 UB C axis stop code
158-161 SL C axis reference position
162-165 SL C axis motor position
1
A axis analog input
1
B axis analog input
Chapter 4 Software Tools and Communication 57 DMC-40x0 User Manual
166-169 SL C axis position error
170-173 SL C axis auxiliary position
174-177 SL C axis velocity
178-181 SL (new size) C axis torque
182-183 SW or UW
1
C axis analog input
184 UB (new) C Hall Input Status
185 UB Reserved
186-189 SL (new) C User defined variable (ZA)
190-191 UW D axis status – see bit field map below
192 UB D axis switches – see bit field map below
193 UB D axis stop code
194-197 SL D axis reference position
198-201 SL D axis motor position
202-205 SL D axis position error
206-209 SL D axis auxiliary position
210-213 SL D axis velocity
214-217 SL (new size) D axis torque
218-219 SW or UW
1
D axis analog input
220 UB (new) D Hall Input Status
221 UB Reserved
222-225 SL (new) D User defined variable (ZA)
226-227 UW E axis status – see bit field map below
228 UB E axis switches – see bit field map below
229 UB E axis stop code
230-233 SL E axis reference position
234-237 SL E axis motor position
238-241 SL E axis position error
242-245 SL E axis auxiliary position
246-249 SL E axis velocity
250-253 SL (new size) E axis torque
254-255 SW or UW
1
E axis analog input
256 UB (new) E Hall Input Status
257 UB Reserved
258-261 SL (new) E User defined variable (ZA)
262-263 UW F axis status – see bit field map below
264 UB F axis switches – see bit field map below
265 UB F axis stop code
266-269 SL F axis reference position
270-273 SL F axis motor position
274-277 SL F axis position error
278-281 SL F axis auxiliary position
282-285 SL F axis velocity
286-289 SL (new size) F axis torque
290-291 SW or UW
1
F axis analog input
DMC-40x0 User Manual Chapter 4 Software Tools and Communication 58
292 UB (new) F Hall Input Status
293 UB Reserved
294-297 SL (new) F User defined variable (ZA)
298-299 UW G axis status – see bit field map below
300 UB G axis switches – see bit field map below
301 UB G axis stop code
302-305 SL G axis reference position
306-309 SL G axis motor position
310-313 SL G axis position error
314-317 SL G axis auxiliary position
318-321 SL G axis velocity
322-325 SL (new size) G axis torque
326-327 SW or UW
1
G axis analog input
328 UB (new) G Hall Input Status
329 UB Reserved
330-333 SL (new) G User defined variable (ZA)
334-335 UW H axis status – see bit field map below
336 UB H axis switches – see bit field map below
337 UB H axis stop code
338-341 SL H axis reference position
342-345 SL H axis motor position
346-349 SL H axis position error
350-353 SL H axis auxiliary position
354-357 SL H axis velocity
358-361 SL (new size) H axis torque
362-363 SW or UW
1
H axis analog input
364 UB (new) H Hall Input Status
365 UB Reserved
366-369 SL (new) H User defined variable (ZA)
1 Will be either a Signed Word or Unsigned Word depending upon AQ setting. See AQ in the
Command Reference for more information.
Chapter 4 Software Tools and Communication 59 DMC-40x0 User Manual

Explanation Data Record Bit Fields

Header Information - Byte 0, 1 of Header:
BIT 15 BIT 14 BIT 13 BIT 12 BIT 11 BIT 10 BIT 9 BIT 8
1 N/A N/A N/A N/A I Block
Present in Data Record
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
H Block Present in Data Record
G Block Present in Data Record
F Block Present in Data Record
E Block Present in Data Record
D Block Present in Data Record
C Block Present in Data Record
Bytes 2, 3 of Header:
Bytes 2 and 3 make a word which represents the Number of bytes in the data record, including the header.
Byte 2 is the low byte and byte 3 is the high byte
NOTE: The header information of the data records is formatted in little endian.
Thread Status (1 Byte)
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
Thread 7 Running
Thread 6 Running
Thread 5 Running
Thread 4 Running
Thread 3 Running
T Block Present in Data Record
B Block Present in Data Record
Thread 2 Running
S Block Present in Data Record
A Block Present in Data Record
Thread 1 Running
Thread 0 Running
Coordinated Motion Status for S or T Plane (2 Byte)
BIT 15 BIT 14 BIT 13 BIT 12 BIT 11 BIT 10 BIT 9 BIT 8
Move in Progress
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
N/A N/A Motion
N/A N/A N/A N/A N/A N/A N/A
is slewing
Motion is stopping due to ST or Limit Switch
Motion is making final decel.
N/A N/A N/A
DMC-40x0 User Manual Chapter 4 Software Tools and Communication 60
Axis Status (1 Word)
BIT 15 BIT 14 BIT 13 BIT 12 BIT 11 BIT 10 BIT 9 BIT 8
Move in Progress
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
Negative Direction Move
Mode of Motion PA or PR
Mode of Motion
Contour
Mode of Motion PA only
Motion is slewing
(FE) Find Edge in Progress
Motion is stopping due to ST of Limit Switch
Home (HM) in Progress
Motion is making final decel.
1st Phase of HM complete
Latch is armed
2nd Phase of HM complete or FI command issued
3rd Phase of HM in Progress
Mode of Motion Coord. Motion
Motor Off
Axis Switches (1 Byte)
BIT 7 BIT 6 BIT 5 BIT 4 BIT 3 BIT 2 BIT 1 BIT 0
Latch Occurred
State of Latch Input
N/A N/A State of
Forward Limit
State of Reverse Limit
State of Home Input
Stepper Mode

Notes Regarding Velocity and Torque Information

The velocity information that is returned in the data record is 64 times larger than the value returned when using the command TV (Tell Velocity). See command reference for more information about TV.
The Torque information is represented as a number in the range of +/-32767. Maximum negative torque is -32767. Maximum positive torque is 32767. Zero torque is 0.

QZ Command

The QZ command can be very useful when using the QR command, since it provides information about the controller and the data record. The QZ command returns the following 4 bytes of information.
BYTE # INFORMATION
0 Number of axes present
1 number of bytes in general block of data record
2 number of bytes in coordinate plane block of data record
3 Number of Bytes in each axis block of data record

Controller Response to Commands

Most DMC-40x0 instructions are represented by two characters followed by the appropriate parameters. Each instruction must be terminated by a carriage return or semicolon.
Chapter 4 Software Tools and Communication 61 DMC-40x0 User Manual
Instructions are sent in ASCII, and the DMC-40x0 decodes each ASCII character (one byte) one at a time. It takes approximately 0.05 msec for the controller to decode each command.
After the instruction is decoded, the DMC-40x0 returns a response to the port from which the command was generated. If the instruction was valid, the controller returns a colon (:) or a question mark (?) if the instruction was not valid. For example, the controller will respond to commands which are sent via the main RS-232 port back through the RS-232 port, and to commands which are sent via the Ethernet port back through the Ethernet port.
For instructions that return data, such as Tell Position (TP), the DMC-40x0 will return the data followed by a carriage return, line feed and : .
It is good practice to check for : after each command is sent to prevent errors. An echo function is provided to enable associating the DMC-40x0 response with the data sent. The echo is enabled by sending the command EO 1 to the controller.

Unsolicited Messages Generated by Controller

When the controller is executing a program, it may generate responses which will be sent via the main RS-232 port or Ethernet ports. This response could be generated as a result of messages using the MG command OR as a result of a command error. These responses are known as unsolicited messages since they are not generated as the direct response to a command.
Messages can be directed to a specific port using the specific Port arguments – see the MG and CF commands in the Command Reference. If the port is not explicitly given or the default is not changed with the CF command, unsolicited messages will be sent to the default port. The default port is the main serial port.
The controller has a special command, CW, which can affect the format of unsolicited messages. This command is used by Galil Software to differentiate response from the command line and unsolicited messages. The command, CW1 causes the controller to set the high bit of ASCII characters to 1 of all unsolicited characters. This may cause characters to appear garbled to some terminals. This function can be disabled by issuing the command, CW2. For more information, see the CW command in the Command Reference.
When handshaking is used (hardware and/or software handshaking) characters which are generated by the controller are placed in a FIFO buffer before they are sent out of the controller. The size of the RS-232 buffer is 512 bytes. When this buffer becomes full, the controller must either stop executing commands or ignore additional characters generated for output. The command CW,1 causes the controller to ignore all output from the controller while the FIFO is full. The command, CW ,0 causes the controller to stop executing new commands until more room is made available in the FIFO. This command can be very useful when hardware handshaking is being used and the communication line between controller and terminal will be disconnected. In this case, characters will continue to build up in the controller until the FIFO is full. For more information, see the CW command in the Command Reference.
DMC-40x0 User Manual Chapter 4 Software Tools and Communication 62

GalilTools (Windows and Linux)

GalilTools is Galil's set of software tools for current Galil controllers. It is highly recommended for all first-time purchases of Galil controllers as it provides easy set-up, tuning and analysis. GalilTools replaces the WSDK Tuning software with an improved user-interface, real-time scopes and communications utilities.
The Galil Tools set contains the following tools: Scope, Editor, Terminal, Watch and Tuner, and a Communication Library for development with Galil Controllers.
The powerful Scope Tool is ideal for system analysis as it captures numerous types of data for each axis in real-time. Up to eight channels of data can be displayed at once, and additional real-time data can be viewed by changing the scope settings. This allows literally hundreds of parameters to be analyzed during a single data capture sequence. A rising or falling edge trigger feature is also included for precise synchronization of data.
The Program Editor Tool allows for easy writing of application programs and multiple editors to be open simultaneously.
The Terminal Tool provides a window for sending and receiving Galil commands and responses.
The Watch Tool displays controller parameters in a tabular format and includes units and scale factors for easy viewing.
The Tuning Tool helps select PID parameters for optimal servo performance.
The Communication Library provides function calls for communicating to Galil Controllers with C++ (Windows and Linux) and COM enabled languages such as VB C#, and Labview (Windows only).
GalilTools runs on Windows and Linux platforms as standard with other platforms available on request.
GalilTools-Lite is available at no charge and contains the Editor, Terminal, Watch and Communcition Library tools only.
The latest version of GalilTools can be downloaded from the Galil website at:
http://www.galilmc.com/products/software/galiltools.html
For information on using GalilTools see the help menu in GalilTools, or the GalilTools user manual.
http://www.galilmc.com/support/manuals/galiltools/index.html
Chapter 4 Software Tools and Communication 63 DMC-40x0 User Manual
Figure 4.1 - GalilTools
DMC-40x0 User Manual Chapter 4 Software Tools and Communication 64

Creating Custom Software Interfaces

Galil provides programming tools so that users can develop their own custom software interfaces to a Galil controller. These tools include the GalilTools Communication Library, ActiveX Toolkit, .NET API and DMCWin.
For new applications, Galil recommends the GalilTools Communication Libraries.

HelloGalil – Quick Start to PC programming

For programmers developing Windows applications that communicate with a Galil controller, the HelloGalil library of quick start projects immediately gets you communicating with the controller from the programming language of your choice. In the "Hello World" tradition, each project contains the bare minimum code to demonstrate communication to the controller and simply prints the controller's model and serial numbers to the screen:
Figure 4.2. Sample program output
http://www.galilmc.com/support/hello_galil.html

GalilTools Communication Libraries

The GalilTools Communication Library (Galil class) provides methods for communication with a Galil motion controller over Ethernet, RS-232 or PCI buses. It consists of a native C++ Library and a similar COM interface which extends compatibility to Windows programming languages (e.g. VB, C#, etc).
A Galil object (usually referred to in sample code as "g") represents a single connection to a Galil controller.
For Ethernet controllers, which support more than one connection, multiple objects may be used to communicate with the controller. An example of multiple objects is one Galil object containing a TCP handle to a DMC-40x0 for commands and responses, and one Galil object containing a UDP handle for unsolicited messages from the controller. If recordsStart() is used to begin the automatic data record function, the library will open an additional UDP handle to the controller (transparent to the user).
The library is conceptually divided into six categories:
1. Connecting and Disconnecting - functions to establish and discontinue communication with a controller.
2. Basic Communication - The most heavily used functions for command-and-response and unsolicited messages.
3. Programs - Downloading and uploading embedded programs.
4. Arrays - Downloading and uploading array data.
5. Advanced - Lesser-used calls.
6. Data Record - Access to the data record in both synchronous and asynchronous modes.
C++ Library (Windows and Linux)
Both Full and Lite versions of GalilTools ship with a native C++ communication library. The Linux version (libGalil.so) is compatible with g++ and the Windows version (Galil1.dll) with Visual C++ 2008. Contact Galil if another version of the C++ library is required. See the getting started guide and the hello.cpp example in /lib.
Chapter 4 Software Tools and Communication 65 DMC-40x0 User Manual
COM (Windows)
To further extend the language compatibility on Windows, a COM (Component Object Model) class built on top of the C++ library is also provided with Windows releases. This COM wrapper can be used in any language and IDE supporting COM (Visual Studio 2005, 2008, etc). The COM wrapper includes all of the functionality of the base C+ + class. See the getting started guide and the hello.* examples in \lib for more info.
For more information on the GalilTools Communications Library, see the online user manual.
http://www.galilmc.com/support/manuals/galiltools/library.html

ActiveX Toolkit

Galil recommends the GalilTools Communication Library for all new applications.
Galil's ActiveX Toolkit is useful for the programmer who wants to easily create a custom operator interface to a Galil controller. The ActiveX Toolkit includes a collection of ready-made ActiveX COM controls for use with Visual Basic, Visual C++, Delphi, LabVIEW and other ActiveX compatible programming tools. The most common environment is Visual Basic 6, but Visual Basic.NET, Visual C++, Wonderware, LabVIEW and HPVEE have all been tested by Galil to work with the .OCX controls.
The ActiveX Toolkit can be purchased from Galil at:
350Hhttp://www.galilmc.com/buy/index.html
The ActiveX toolkit can save many hours of programming time. Built-in dialog boxes are provided for quick parameter setup, selection of color, size, location and text. The toolkit controls are easy to use and provide context sensitive help, making it ideal for even the novice programmer.
ActiveX Toolkit Includes:
a terminal control for sending commands and editing programs
a polling window for displaying responses from the controller such as position and speed
a storage scope control for plotting real time trajectories such as position versus time or X versus Y
a send file control for sending contour data or vector DMC files
a continuous array capture control for data collection, and for teach and playback
a graphical display control for monitoring a 2-D motion path
a diagnostics control for capturing current configurations
a display control for input and output status
a vector motion control for tool offsets and corner speed control
For more detailed information on the ActiveX Toolkit, please refer to the user manual at
351Hhttp://www.galilmc.com/support/manuals/activex.pdf.

DMCWin Programmers Toolkit

Galil recommends the GalilTools Communication Library for all new applications.
DMCWin is a programmer's toolkit for C/C++ and Visual Basic users. The toolkit includes header files for the Galil communications API, as well as source code and examples for developing Windows® programs that communicate to Galil Controllers. The Galil communications API includes functions to send commands, download programs, download/upload arrays, access the data record, etc. For a complete list of all the functions, refer to the DMCWin user manual at:
352Hhttp://www.galilmc.com/support/manuals/dmcwin.pdf.
This software package is free for download and is available at:
353Hhttp://www.galilmc.com/support/download.html
DMC-40x0 User Manual Chapter 4 Software Tools and Communication 66

Galil Communications API with C/C++

Galil recommends the GalilTools Communication Library for all new applications.
When programming in C/C++, the communications API can be used as included functions or through a class library. All Galil communications programs written in C must include the DMCCOM.H file and access the API functions through the declared routine calls. C++ programs can use the DMCCOM.H routines or use the class library defined in DMCWIN.H.
After installing DMCWin into the default directory, the DMCCOM.H header file is located in C:\Program Files\Galil\DMCWIN\INCLUDE. C++ programs that use the class library need the files DMCWIN.H and DMCWIN.CPP, which contain the class definitions and implementations respectively. These can be found in the C:\ ProgramFiles\Galil\DMCWIN\CPP directory.
To link the application with the DLL’s, the DMC32.lib file must be included in the project and is located at C:\Program Files\Galil\DMCWIN\LIB
Example: A simple console application that sends commands to the controller
To initiate communication, declare a variable of type HANDLEDMC (a long integer) and pass the address of that variable in the DMCOpen() function. If the DMCOpen() function is successful, the variable will contain the handle to the Galil controller, which is required for all subsequent function calls. The following simple example program written as a Visual C console application tells the controller to move the X axis 1000 encoder counts. Remember to add DMC32.LIB to your project prior to compiling.
#include <windows.h>
#include <dmccom.h> long lRetCode; HANDLEDMC hDmc; HWND hWnd; int main(void) {
// Connect to controller number 1 lRetCode= DMCOpen(1, hWnd, &hDmc); if (rc == DMCNOERROR) { char szBuffer[64]; // Move the X axis 1000 counts lRetCode = DMCCommand(hDmc, "PR1000;BGX;", szBuffer, sizeof(szBuffer)); // Disconnect from controller number 1 as the last action lRetCode = DMCClose(hDmc); }
return 0;
}

Galil Communications API with Visual Basic

Declare Functions
Galil recommends the GalilTools Communication Library for all new applications.
To use the Galil communications API functions, add the module file included in the C:\ProgramFiles\Galil\DMCWIN\VB directory named DMCCOM40.BAS. This module declares the routines making them available for the VB project. To add this file, select ‘Add Module’ from the ‘Project’ menu in VB5/6.
Chapter 4 Software Tools and Communication 67 DMC-40x0 User Manual
Sending Commands in VB
Most commands are sent to the controller with the DMCCommand() function. This function allows any Galil command to be sent from VB to the controller. The DMCCommand() function will return the response from the controller as a string. Before sending any commands the DMCOpen() function must be called. This function establishes communication with the controller and is called only once.
This example code illustrates the use of DMCOpen() and DMCCommand(). A connection is made to controller #1 in the Galil registry upon launching the application. Then, the controller is sent the command ‘TPX’ whenever a command button is pressed. The response is then placed in a text box. When the application is closed, the controller is disconnected.
To use this example, start a new Visual Basic project, place a Text Box and a Command Button on a Form, add the DMCCOM40.BAS module, and type the following code:
Dim m_nController As Integer Dim m_hDmc As Long Dim m_nRetCode As Long Dim m_nResponseLength As Long Dim m_sResponse As String * 256
Private Sub Command1_Click()
m_nRetCode = DMCCommand(m_hDmc, "TPX", m_sResponse, m_nResponseLength) Text1.Text = Val(m_sResponse)
End Sub
Private Sub Form_Load()
m_nResponseLength = 256 m_nController = 1 m_nRetCode = DMCOpen(m_nController, 0, m_hDmc)
End Sub
Private Sub Form_Unload(Cancel As Integer)
m_nRetCode = DMCClose(m_hDmc)
End Sub
Where: ‘m_nController’ is the number for the controller in the Galil registry. ‘m_hDmc’ is the DMC handle used to identify the controller. It is returned by DMCOpen. ‘m_nRetCode’ is the return code for the routine. ‘m_nResponseLength’ is the response string length which must be set to the size of the response string. ‘m_sResponse’ is the string containing the controller response to the command.
DMC-40x0 User Manual Chapter 4 Software Tools and Communication 68

DOS, and QNX tools

Galil offers unsupported code examples that demonstrate communications to the controller using the following operating systems.
DOS
DOS based utilities & Programming Libraries for Galil controllers, which includes a terminal, utilities to upload and download programs, and source code for BASIC and C programs. Download DMCDOS at :
354Hhttp://www.galilmc.com/support/download.html#dos.
QNX
Galil offers sample drivers for ISA and PCI cards for the QNX 4.24 operating system. We also offer drivers and utilities for QNX 6.2 for PCI only. Download at:
356Hhttp://www.galilmc.com/support/download.html#linux.

Linux

Galil now offers full support to Linux users through the GalilTools software package. For more information see the previous section on GalilTools, or visit the Galil website.
http://www.galilmc.com/products/software/galiltools.html
Chapter 4 Software Tools and Communication 69 DMC-40x0 User Manual

Chapter 5 Command Basics

Introduction

The DMC-40x0 provides over 100 commands for specifying motion and machine parameters. Commands are included to initiate action, interrogate status and configure the digital filter. These commands can be sent in ASCII or binary.
In ASCII, the DMC-40x0 instruction set is BASIC-like and easy to use. Instructions consist of two uppercase letters that correspond phonetically with the appropriate function. For example, the instruction BG begins motion, and ST stops the motion. In binary, commands are represented by a binary code ranging from 80 to FF.
ASCII commands can be sent "live" over the communications port for immediate execution by the DMC-40x0, or an entire group of commands can be downloaded into the DMC-40x0 memory for execution at a later time. Combining commands into groups for later execution is referred to as Applications Programming and is discussed in the following chapter. Binary commands cannot be used in Applications programming.
This section describes the DMC-40x0 instruction set and syntax. A summary of commands as well as a complete listing of all DMC-40x0 instructions is included in the Command Reference.

Command Syntax - ASCII

DMC-40x0 instructions are represented by two ASCII upper case characters followed by applicable arguments. A space may be inserted between the instruction and arguments. A semicolon or <return> is used to terminate the instruction for processing by the DMC-40x0 command interpreter.
NOTE: If you are using a Galil terminal program, commands will not be processed until an <return> command is given. This allows the user to separate many commands on a single line and not begin execution until the user gives the <return> command.
IMPORTANT: All DMC-40x0 commands are sent in upper case.
For example, the command
PR 4000 <return> Position relative
PR is the two character instruction for position relative. 4000 is the argument which represents the required position value in counts. The <return> terminates the instruction. The space between PR and 4000 is optional.
For specifying data for the A,B,C and D axes, commas are used to separate the axes. If no data is specified for an axis, a comma is still needed as shown in the examples below. If no data is specified for an axis, the previous value is maintained.
To view the current values for each command, type the command followed by a ? for each axis requested.
DMC-40x0 User Manual Chapter 5 Command Basics 70
PR 1000 Specify A only as 1000
4080
PR ,2000 Specify B only as 2000
PR ,,3000 Specify C only as 3000
PR ,,,4000 Specify D only as 4000
PR 2000, 4000,6000, 8000 Specify A,B,C and D
PR ,8000,,9000 Specify B and D only
PR ?,?,?,? Request A,B,C,D values
PR ,? Request B value only
The DMC-40x0 provides an alternative method for specifying data. Here data is specified individually using a single axis specifier such as A, B, C or D. An equals sign is used to assign data to that axis. For example:
PRA=1000 Specify a position relative movement for the A axis of
ACB=200000 Specify acceleration for the B axis as 200000
1000
Instead of data, some commands request action to occur on an axis or group of axes. For example, ST AB stops motion on both the A and B axes. Commas are not required in this case since the particular axis is specified by the appropriate letter A, B, C or D. If no parameters follow the instruction, action will take place on all axes. Here are some examples of syntax for requesting action:
BG A Begin A only
BG B Begin B only
BG ABCD Begin all axes
BG BD Begin B and D only
BG Begin all axes
For controllers with 5 or more axes, the axes are referred to as A,B,C,D,E,F,G,H. The specifiers X,Y,Z,W and A,B,C,D may be used interchangeably.
BG ABCDEFGH Begin all axes
BG D Begin D only

Coordinated Motion with more than 1 axis

When requesting action for coordinated motion, the letter S or T is used to specify the coordinated motion. This allows for coordinated motion to be setup for two separate coordinate systems. Refer to the CA command in the Command Reference for more information on specifying a coordinate system. For example:
BG S Begin coordinated sequence, S
BG TW Begin coordinated sequence, T, and D axis
Chapter 5 Command Basics 71 DMC-40x0 User Manual

Command Syntax – Binary (advanced)

Some commands have an equivalent binary value. Binary communication mode can be executed about 20% faster than ASCII commands. Binary format can only be used when commands are sent from the PC and cannot be embedded in an application program.

Binary Command Format

All binary commands have a 4 byte header and is followed by data fields. The 4 bytes are specified in hexadecimal format.
Header Format:
Byte 1 specifies the command number between 80 to FF. The complete binary command number table is listed
below.
Byte 2 specifies the # of bytes in each field as 0,1,2,4 or 6 as follows:
00 No data fields (i.e. SH or BG)
01 One byte per field
02 One word (2 bytes per field)
04 One long word (4 bytes) per field
06 Galil real format (4 bytes integer and 2 bytes fraction)
Byte 3 specifies whether the command applies to a coordinated move as follows:
00 No coordinated motion movement
01 Coordinated motion movement
For example, the command STS designates motion to stop on a vector move, S coordinate system. The third byte for the equivalent binary command would be 01.
Byte 4 specifies the axis # or data field as follows
Bit 7 = H axis or 8th data field
Bit 6 = G axis or 7th data field
Bit 5 = F axis or 6th data field
Bit 4 = E axis or 5th data field
Bit 3 = D axis or 4th data field
Bit 2 = C axis or 3rd data field
Bit 1 = B axis or 2nd data field
Bit 0 = A axis or 1st data field
Data fields Format
Data fields must be consistent with the format byte and the axes byte. For example, the command PR 1000,, -500 would be :
A7 02 00 05 03 E8 FE 0C
where A7 is the command number for PR
02 specifies 2 bytes for each data field
DMC-40x0 User Manual Chapter 5 Command Basics 72
00 S is not active for PR
05 specifies bit 0 is active for A axis and bit 2 is active for C axis (20 + 22=5)
03 E8 represents 1000
FE OC represents -500
Example
The command ST XYZS would be :
A1 00 01 07
where A1 is the command number for ST
00 specifies 0 data fields
01 specifies stop the coordinated axes S
07 specifies stop X (bit 0), Y (bit 1) and Z (bit 2) 20+21+23 =7

Binary command table

Command No. Command No. Command No.
reserved 80 reserved ab reserved d6
KP 81 reserved ac reserved d7
KI 82 reserved ad RP d8
KD 83 reserved ae TP d9
DV 84 reserved af TE da
AF 85 LM b0 TD db
KS 86 LI b1 TV dc
PL 87 VP b2 RL dd
ER 88 CR b3 TT de
IL 89 TN b4 TS df
TL 8a LE, VE b5 TI e0
MT 8b reserved b6 SC e1
CE 8c VA b7 reserved e2
OE 8d VD b8 reserved e3
FL 8e VS b9 reserved e4
BL 8f VR ba TM e5
AC 90 reserved bb CN e6
DC 91 reserved bc LZ e7
SP 92 CM bd OP e8
IT 93 CD be OB e9
FA 94 DT bf SB ea
FV 95 ET c0 CB eb
GR 96 EM c1 II ec
DP 97 EP c2 EI ed
DE 98 EG c3 AL ee
Chapter 5 Command Basics 73 DMC-40x0 User Manual
OF 99 EB c4 reserved ef
:bg <return>
invalid command, lower case
?
DMC-40x0 returns a ?
?TC1 <return>
Tell Code command
1 Unrecognized
Returned response
GM 9a EQ c5 reserved f0
reserved 9b EC c6 reserved f1
reserved 9c reserved c7 reserved f2
reserved 9d AM c8 reserved f3
reserved 9e MC c9 reserved f4
reserved 9f TW ca reserved f5
BG a0 MF cb reserved f6
ST a1 MR cc reserved f7
AB a2 AD cd reserved f8
HM a3 AP ce reserved f9
FE a4 AR cf reserved fa
FI a5 AS d0 reserved fb
PA a6 AI d1 reserved fc
PR a7 AT d2 reserved fd
JG a8 WT d3 reserved fe
MO a9 reserved d4 reserved ff
SH aa reserved d5

Controller Response to DATA

The DMC-40x0 returns a : for valid commands and a ? for invalid commands.
For example, if the command BG is sent in lower case, the DMC-40x0 will return a ?.
When the controller receives an invalid command the user can request the error code. The error code will specify the reason for the invalid command response. To request the error code type the command TC1. For example:
There are many reasons for receiving an invalid command response. The most common reasons are: unrecognized command (such as typographical entry or lower case), command given at improper time (such as during motion), or a command out of range (such as exceeding maximum speed). A complete listing of all codes is listed in the TC command in the Command Reference section.

Interrogating the Controller

Interrogation Commands

The DMC-40x0 has a set of commands that directly interrogate the controller. When the command is entered, the requested data is returned in decimal format on the next line followed by a carriage return and line feed. The format of the returned data can be changed using the Position Format (PF), Variable Format (VF) and Leading Zeros (LZ) command. See 357HChapter 7 and the Command Reference.
DMC-40x0 User Manual Chapter 5 Command Basics 74

Summary of Interrogation Commands

RP Report Command Position
RL Report Latch
∧R ∧
V
SC Stop Code
TB Tell Status
TC Tell Error Code
TD Tell Dual Encoder
TE Tell Error
TI Tell Input
TP Tell Position
TR Trace
TS Tell Switches
TT Tell Torque
TV Tell Velocity
For example, the following example illustrates how to display the current position of the X axis:
TP A <return> Tell position A
0 Controllers Response
TP AB <return> Tell position A and B
0,0 Controllers Response
Firmware Revision Information

Interrogating Current Commanded Values.

Most commands can be interrogated by using a question mark (?) as the axis specifier. Type the command followed by a ? for each axis requested.
PR ?,?,?,? Request A,B,C,D values
PR ,? Request B value only
The controller can also be interrogated with operands.

Operands

Most DMC-40x0 commands have corresponding operands that can be used for interrogation. Operands must be used inside of valid DMC expressions. For example, to display the value of an operand, the user could use the command:
MG ‘operand’ where ‘operand’ is a valid DMC operand
All of the command operands begin with the underscore character (_). For example, the value of the current position on the A axis can be assigned to the variable ‘V’ with the command:
V=_TPA
The Command Reference denotes all commands which have an equivalent operand as "Used as an Operand". Also, see description of operands in 358HChapter 7.

Command Summary

For a complete command summary, see Command Reference manual.
Chapter 5 Command Basics 75 DMC-40x0 User Manual

Chapter 6 Programming Motion

4080

Overview

The DMC-40x0 provides several modes of motion, including independent positioning and jogging, coordinated motion, electronic cam motion, and electronic gearing. Each one of these modes is discussed in the following sections.
The DMC-4010 are single axis controllers and use X-axis motion only. Likewise, the DMC-4020 use X and Y, the DMC-4030 use X,Y, and Z, and the DMC-4040 use X,Y,Z, and W. The DMC-4050 use A,B,C,D, and E. The DMC-4060 use A,B,C,D,E, and F. The DMC-4070 use A,B,C,D,E,F, and G. The DMC-4080 use the axes A,B,C,D,E,F,G, and H.
The example applications described below will help guide you to the appropriate mode of motion.
For controllers with 5 or more axes, the specifiers, ABCDEFGH, are used. XYZ and W may be interchanged with ABCD.
EXAMPLE APPLICATION MODE OF MOTION COMMANDS
Absolute or relative positioning where each axis is independent and follows prescribed velocity profile.
Velocity control where no final endpoint is prescribed. Motion stops on Stop command.
Absolute positioning mode where absolute position targets may be sent to the controller while the axis is in motion.
Motion Path described as incremental position points versus time.
2,3 or 4 axis coordinated motion where path is described by linear segments.
Independent Axis Positioning PA,PR
SP,AC,DC
Independent Jogging JG
AC,DC ST
Position Tracking PA,
PT SP AC, DC
Contour Mode CM
CD DT
Linear Interpolation LM
LI, LE VS,VR VA,VD
DMC-40x0 User Manual Chapter 6 Programming Motion 76
2-D motion path consisting of arc segments and linear segments, such as engraving or quilting.
Third axis must remain tangent to 2-D motion path, such as knife cutting.
Electronic gearing where slave axes are scaled to master axis which can move in both directions.
Master/slave where slave axes must follow a master such as conveyer speed.
Moving along arbitrary profiles or mathematically prescribed profiles such as sine or cosine trajectories.
Teaching or Record and Play Back Contour Mode with Automatic Array Capture CM
Backlash Correction Dual Loop DV
Following a trajectory based on a master encoder position Electronic Cam EA
Smooth motion while operating in independent axis positioning
Smooth motion while operating in vector or linear interpolation positioning
Smooth motion while operating with stepper motors Stepper Motor Smoothing KS
Gantry - two axes are coupled by gantry Gantry Mode GR
Coordinated Motion VM
VP CR VS,VR VA,VD VE
Coordinated motion with tangent axis specified VM
VP CR VS,VA,VD TN VE
Electronic Gearing GA
GD _GP GR GM (if gantry)
Electronic Gearing GA
GD _GP GR
Contour Mode CM
CD DT
CD DT RA RD RC
EM EP ET EB EG EQ
Independent Motion Smoothing IT
Vector Smoothing IT
GM
Chapter 6 Programming Motion 77 DMC-40x0 User Manual

Independent Axis Positioning

In this mode, motion between the specified axes is independent, and each axis follows its own profile. The user specifies the desired absolute position (PA) or relative position (PR), slew speed (SP), acceleration ramp (AC), and deceleration ramp (DC), for each axis. On begin (BG), the DMC-40x0 profiler generates the corresponding trapezoidal or triangular velocity profile and position trajectory. The controller determines a new command position along the trajectory every sample period until the specified profile is complete. Motion is complete when the last position command is sent by the DMC-40x0 profiler. Note: The actual motor motion may not be complete when the profile has been completed, however, the next motion command may be specified.
The Begin (BG) command can be issued for all axes either simultaneously or independently. XYZ or W axis specifiers are required to select the axes for motion. When no axes are specified, this causes motion to begin on all axes.
The speed (SP) and the acceleration (AC) can be changed at any time during motion, however, the deceleration (DC) and position (PR or PA) cannot be changed until motion is complete. Remember, motion is complete when the profiler is finished, not when the actual motor is in position. The Stop command (ST) can be issued at any time to decelerate the motor to a stop before it reaches its final position.
An incremental position movement (IP) may be specified during motion as long as the additional move is in the same direction. Here, the user specifies the desired position increment, n. The new target is equal to the old target plus the increment, n. Upon receiving the IP command, a revised profile will be generated for motion towards the new end position. The IP command does not require a begin. Note: If the motor is not moving, the IP command is equivalent to the PR and BG command combination.

Command Summary - Independent Axis

COMMAND DESCRIPTION
PR x,y,z,w Specifies relative distance
PA x,y,z,w Specifies absolute position
SP x,y,z,w Specifies slew speed
AC x,y,z,w Specifies acceleration rate
DC x,y,z,w Specifies deceleration rate
BG XYZW Starts motion
ST XYZW Stops motion before end of move
IP x,y,z,w Changes position target
IT x,y,z,w Time constant for independent motion smoothing
AM XYZW Trippoint for profiler complete
MC XYZW Trippoint for “in position”
The lower case specifiers (x,y,z,w) represent position values for each axis.
The DMC-40x0 also allows use of single axis specifiers such as PRY=2000

Operand Summary - Independent Axis

OPERAND DESCRIPTION
_ACx Return acceleration rate for the axis specified by ‘x’
_DCx Return deceleration rate for the axis specified by ‘x’
DMC-40x0 User Manual Chapter 6 Programming Motion 78
_SPx Returns the speed for the axis specified by ‘x’
_PAx Returns current destination if ‘x’ axis is moving, otherwise returns the current commanded
_PRx Returns current incremental distance specified for the ‘x’ axis
Example - Absolute Position Movement
PA 10000,20000 Specify absolute X,Y position
AC 1000000,1000000 Acceleration for X,Y
DC 1000000,1000000 Deceleration for X,Y
SP 50000,30000 Speeds for X,Y
BG XY Begin motion
Example - Multiple Move Sequence
Required Motion Profiles:
X-Axis 500 counts Position
20000 count/sec Speed
500000 counts/sec
Y-Axis 1000 counts Position
10000 count/sec Speed
500000 counts/sec
Z-Axis 100 counts Position
position if in a move.
2
Acceleration
2
Acceleration
5000 counts/sec Speed
500000 counts/sec Acceleration
This example will specify a relative position movement on X, Y and Z axes. The movement on each axis will be separated by 20 msec. Fig. 6.0 shows the velocity profiles for the X,Y and Z axis.
#A Begin Program
PR 2000,500,100 Specify relative position movement of 1000, 500 and 100 counts for X,Y and Z axes.
SP 20000,10000,5000 Specify speed of 20000, 10000, and 5000 counts / sec
AC 500000,500000,500000 Specify acceleration of 500000 counts / sec2 for all axes
DC 500000,500000,500000 Specify deceleration of 500000 counts / sec2 for all axes
BG X Begin motion on the X axis
WT 20 Wait 20 msec
BG Y Begin motion on the Y axis
WT 20 Wait 20 msec
BG Z Begin motion on Z axis
EN End Program
Chapter 6 Programming Motion 79 DMC-40x0 User Manual
Figure 6.1: Velocity Profiles of XYZ
VELOCITY (COUNTS/SEC)
20000
10000
5000
15000
20
40 60
80
TIME (ms)
100
X axis velocity profile
Y axis velocity profile
Z axis velocity profile
0
Notes on Figure 6.1: The X and Y axis have a ‘trapezoidal’ velocity profile, while the Z axis has a ‘triangular’ velocity profile. The X and Y axes accelerate to the specified speed, move at this constant speed, and then decelerate such that the final position agrees with the command position, PR. The Z axis accelerates, but before the specified speed is achieved, must begin deceleration such that the axis will stop at the commanded position. All 3 axes have the same acceleration and deceleration rate, hence, the slope of the rising and falling edges of all 3 velocity profiles are the same.

Independent Jogging

The jog mode of motion is very flexible because speed, direction and acceleration can be changed during motion. The user specifies the jog speed (JG), acceleration (AC), and the deceleration (DC) rate for each axis. The direction of motion is specified by the sign of the JG parameters. When the begin command is given (BG), the motor accelerates up to speed and continues to jog at that speed until a new speed or stop (ST) command is issued. If the jog speed is changed during motion, the controller will make a accelerated (or decelerated) change to the new speed.
An instant change to the motor position can be made with the use of the IP command. Upon receiving this command, the controller commands the motor to a position which is equal to the specified increment plus the current position. This command is useful when trying to synchronize the position of two motors while they are moving.
Note that the controller operates as a closed-loop position controller while in the jog mode. The DMC-40x0 converts the velocity profile into a position trajectory and a new position target is generated every sample period. This method of control results in precise speed regulation with phase lock accuracy.

Command Summary - Jogging

COMMAND DESCRIPTION
Parameters can be set with individual axes specifiers such as JGY=2000 (set jog speed for Y axis to 2000).
DMC-40x0 User Manual Chapter 6 Programming Motion 80
AC x,y,z,w Specifies acceleration rate
BG XYZW Begins motion
DC x,y,z,w Specifies deceleration rate
IP x,y,z,w Increments position instantly
IT x,y,z,w Time constant for independent motion smoothing
JG +/-x,y,z,w Specifies jog speed and direction
ST XYZW Stops motion

Operand Summary - Independent Axis

OPERAND DESCRIPTION
_ACx Return acceleration rate for the axis specified by ‘x’
_DCx Return deceleration rate for the axis specified by ‘x’
_SPx Returns the jog speed for the axis specified by ‘x’
_TVx Returns the actual velocity of the axis specified by ‘x’ (averaged over 0.25 sec)
Example - Jog in X only
Jog X motor at 50000 count/s. After X motor is at its jog speed, begin jogging Z in reverse direction at 25000 count/ s.
#A
AC 20000,,20000 Specify X,Z acceleration of 20000 cts / sec
DC 20000,,20000 Specify X,Z deceleration of 20000 cts / sec
JG 50000,,-25000 Specify jog speed and direction for X and Z axis
BG X Begin X motion
AS X Wait until X is at speed
BG Z Begin Z motion
EN
Example - Joystick Jogging
The jog speed can also be changed using an analog input such as a joystick. Assume that for a 10 Volt input the speed must be 50000 counts/sec.
#JOY Label
JG0 Set in Jog Mode
BGX Begin motion
#B Label for loop
V1 =@AN[1] Read analog input
VEL=V1*50000/10 Compute speed
JG VEL Change JG speed
JP #B Loop

Position Tracking

The Galil controller may be placed in the position tracking mode to support changing the target of an absolute position move on the fly. New targets may be given in the same direction or the opposite direction of the current position target. The controller will then calculate a new trajectory based upon the new target and the acceleration, deceleration, and speed parameters that have been set. The motion profile in this mode is trapezoidal. There is not a set limit governing the rate at which the end point may be changed, however at the standard TM rate, the controller updates the position information at the rate of 1msec. The controller generates a profiled point every other sample, and linearly interpolates one sample between each profiled point. Some examples of applications that may use this mode are satellite tracking, missile tracking, random pattern polishing of mirrors or lenses, or any application that requires the ability to change the endpoint without completing the previous move.
The PA command is typically used to command an axis or multiple axes to a specific absolute position. For some applications such as tracking an object, the controller must proceed towards a target and have the ability to change
Chapter 6 Programming Motion 81 DMC-40x0 User Manual
the target during the move. In a tracking application, this could occur at any time during the move or at regularly scheduled intervals. For example if a robot was designed to follow a moving object at a specified distance and the path of the object wasn’t known the robot would be required to constantly monitor the motion of the object that it was following. To remain within a specified distance it would also need to constantly update the position target it is moving towards. Galil motion controllers support this type of motion with the position tracking mode. This mode will allow scheduled or random updates to the current position target on the fly. Based on the new target the controller will either continue in the direction it is heading, change the direction it is moving, or decelerate to a stop.
The position tracking mode shouldn’t be confused with the contour mode. The contour mode allows the user to generate custom profiles by updating the reference position at a specific time rate. In this mode, the position can be updated randomly or at a fixed time rate, but the velocity profile will always be trapezoidal with the parameters specified by AC, DC, and SP. Updating the position target at a specific rate will not allow the user to create a custom profile.
The following example will demonstrate the possible different motions that may be commanded by the controller in the position tracking mode. In this example, there is a host program that will generate the absolute position targets. The absolute target is determined based on the current information the host program has gathered on the object that it is tracking. The position tracking mode does allow for all of the axes on the controller to be in this mode, but for the sake of discussion, it is assumed that the robot is tracking only in the X dimension.
The controller must be placed in the position tracking mode to allow on the fly absolute position changes. This is performed with the PT command. To place the X axis in this mode, the host would issue PT1 to the controller if both X and Y axes were desired the command would be PT 1,1. The next step is to begin issuing PA command to the controller. The BG command isn’t required in this mode, the SP, AC, and DC commands determine the shape of the trapezoidal velocity profile that the controller will use.
Example Motion 1: The host program determines that the first target for the controller to move to is located at 5000 encoder counts. The acceleration and deceleration should be set to 150,000 cts/sec2 and the velocity is set to 50,000 cts/sec. The command sequence to perform this is listed below.
Command Description
PT1 Place the X axis in Position tracking mode
AC150000
DC150000
SP50000 Set the X axis speed to 50000 cts/sec
PA5000 Command the X axis to absolute position 5000 encoder counts
Set the X axis acceleration to 150000 cts/sec
Set the X axis deceleration to 150000 cts/sec
2
2
DMC-40x0 User Manual Chapter 6 Programming Motion 82
Figure 6.2: Position vs. Time (msec) Motion 1

Example - Motion 2:

The previous step showed the plot if the motion continued all the way to 5000, however partway through the motion, the object that was being tracked changed direction, so the host program determined that the actual target position should be 2000 cts at that time. Figure 6.2 shows what the position profile would look like if the move was allowed to complete to 5000 cts. The position was modified when the robot was at a position of 4200 cts. Note that the robot actually travels to a distance of almost 5000 cts before it turns around. This is a function of the deceleration rate set by the DC command. When a direction change is commanded, the controller decelerates at the rate specified by the DC command. The controller then ramps the velocity in up to the value set with SP in the opposite direction traveling to the new specified absolute position. In Figure 6.3 the velocity profile is triangular because the controller doesn’t have sufficient time to reach the set speed of 50000 cts/sec before it is commanded to change direction.
Figure 6.3: Position vs. Time (msec) Motion 2
Chapter 6 Programming Motion 83 DMC-40x0 User Manual
Figure 6.4: Velocity vs. Time (msec) Motion 2

Example Motion 4

In this motion, the host program commands the controller to begin motion towards position 5000, changes the target to -2000, and then changes it again to 8000. Figure 6.5 shows the plot of position vs. time, Figure 6.6 plots velocity vs. time, and Figure 6.7 demonstrates the use of motion smoothing (IT) on the velocity profile in this mode. The jerk in the system is also affected by the values set for AC and DC.
Figure 6.5: Position vs. Time (msec) Motion 4
DMC-40x0 User Manual Chapter 6 Programming Motion 84
Figure 6.6: Velocity vs. Time Motion 4
Figure 6.7: Velocity cts/sec vs. Time (msec) with IT
Note the controller treats the point where the velocity passes through zero as the end of one move, and the beginning of another move. IT is allowed, however it will introduce some time delay.

Trip Points

Most trip points are valid for use while in the position tracking mode. There are a few exceptions to this; the AM and MC commands may not be used while in this mode. It is recommended that MF, MR, or AP be used, as they involve motion in a specified direction, or the passing of a specific absolute position.
Chapter 6 Programming Motion 85 DMC-40x0 User Manual

Command Summary – Position Tracking Mode

COMMAND DESCRIPTION
AC n,n,n,n,n,n,n,n Acceleration settings for the specified axes
AP n,n,n,n,n,n,n,n Trip point that holds up program execution until an absolute position has been reached
DC n,n,n,n,n,n,n,n Deceleration settings for the specified axes
MF n,n,n,n,n,n,n,n Trip point to hold up program execution until n number of counts have passed in the
forward direction. Only one axis at a time may be specified.
MR n,n,n,n,n,n,n,n Trip point to hold up program execution until n number of counts have passed in the
reverse direction. Only one axis at a time may be specified.
PT n,n,n,n,n,n,n,n Command used to enter and exit the Trajectory Modification Mode
PA n,n,n,n,n,n,n,n Command Used to specify the absolute position target
SP n,n,n,n,n,n,n,n Speed settings for the specified axes

Linear Interpolation Mode

The DMC-40x0 provides a linear interpolation mode for 2 or more axes. In linear interpolation mode, motion between the axes is coordinated to maintain the prescribed vector speed, acceleration, and deceleration along the specified path. The motion path is described in terms of incremental distances for each axis. An unlimited number of incremental segments may be given in a continuous move sequence, making the linear interpolation mode ideal for following a piece-wise linear path. There is no limit to the total move length.
The LM command selects the Linear Interpolation mode and axes for interpolation. For example, LM YZ selects only the Y and Z axes for linear interpolation.
When using the linear interpolation mode, the LM command only needs to be specified once unless the axes for linear interpolation change.

Specifying Linear Segments

The command LI x,y,z,w or LI a,b,c,d,e,f,g,h specifies the incremental move distance for each axis. This means motion is prescribed with respect to the current axis position. Up to 511 incremental move segments may be given prior to the Begin Sequence (BGS) command. Once motion has begun, additional LI segments may be sent to the controller.
The clear sequence (CS) command can be used to remove LI segments stored in the buffer prior to the start of the motion. To stop the motion, use the instructions STS or AB. The command, ST, causes a decelerated stop. The command, AB, causes an instantaneous stop and aborts the program, and the command AB1 aborts the motion only.
The Linear End (LE) command must be used to specify the end of a linear move sequence. This command tells the controller to decelerate to a stop following the last LI command. If an LE command is not given, an Abort AB1 must be used to abort the motion sequence.
It is the responsibility of the user to keep enough LI segments in the DMC-40x0 sequence buffer to ensure continuous motion. If the controller receives no additional LI segments and no LE command, the controller will stop motion instantly at the last vector. There will be no controlled deceleration. LM? or _LM returns the available spaces for LI segments that can be sent to the buffer. 511 returned means the buffer is empty and 511 LI segments can be sent. A zero means the buffer is full and no additional segments can be sent. As long as the buffer is not full, additional LI segments can be sent at PC bus speeds.
The instruction _CS returns the segment counter. As the segments are processed, _CS increases, starting at zero. This function allows the host computer to determine which segment is being processed.
DMC-40x0 User Manual Chapter 6 Programming Motion 86
Additional Commands
The commands VS n, VA n, and VD n are used to specify the vector speed, acceleration and deceleration. The DMC-40x0 computes the vector speed based on the axes specified in the LM mode. For example, LM XYZ designates linear interpolation for the X,Y and Z axes. The vector speed for this example would be computed using the equation:
VS2=XS2+YS2+ZS2, where XS, YS and ZS are the speed of the X,Y and Z axes.
The controller always uses the axis specifications from LM, not LI, to compute the speed.
IT is used to set the S-curve smoothing constant for coordinated moves. The command AV n is the ‘After Vector’ trippoint, which halts program execution until the vector distance of n has been reached.
An Example of Linear Interpolation Motion:
#LMOVE label
DP 0,0 Define position of X and Y axes to be 0
LMXY Define linear mode between X and Y axes.
LI 5000,0 Specify first linear segment
LI 0,5000 Specify second linear segment
LE End linear segments
VS 4000 Specify vector speed
BGS Begin motion sequence
AV 4000 Set trippoint to wait until vector distance of 4000 is reached
VS 1000 Change vector speed
AV 5000 Set trippoint to wait until vector distance of 5000 is reached
VS 4000 Change vector speed
EN Program end
In this example, the XY system is required to perform a 90° turn. In order to slow the speed around the corner, we
use the AV 4000 trippoint, which slows the speed to 1000 count/s. Once the motors reach the corner, the speed is increased back to 4000 cts / s.
Specifying Vector Speed for Each Segment
The instruction VS has an immediate effect and, therefore, must be given at the required time. In some applications, such as CNC, it is necessary to attach various speeds to different motion segments. This can be done by two functions: < n and > m
For example:LI x,y,z,w < n >m
The first command, < n, is equivalent to commanding VSn at the start of the given segment and will cause an acceleration toward the new commanded speeds, subjects to the other constraints.
The second function, > m, requires the vector speed to reach the value m at the end of the segment. Note that the function > m may start the deceleration within the given segment or during previous segments, as needed to meet the final speed requirement, under the given values of VA and VD.
Note, however, that the controller works with one > m command at a time. As a consequence, one function may be masked by another. For example, if the function >100000 is followed by >5000, and the distance for deceleration is not sufficient, the second condition will not be met. The controller will attempt to lower the speed to 5000, but will reach that at a different point.
As an example, consider the following program.
#ALT Label for alternative program
DP 0,0 Define Position of X and Y axis to be 0
LMXY Define linear mode between X and Y axes.
LI 4000,0 <4000 >1000 Specify first linear segment with a vector speed of 4000 and end speed 1000
Chapter 6 Programming Motion 87 DMC-40x0 User Manual
LI 1000,1000 < 4000 >1000
LI 0,5000 < 4000 >1000
LE End linear segments
BGS Begin motion sequence
EN Program end
Specify second linear segment with a vector speed of 4000 and end speed 1000
Specify third linear segment with a vector speed of 4000 and end speed 1000
Changing Feed Rate:
The command VR n allows the feed rate, VS, to be scaled between 0 and 10 with a resolution of .0001. This command takes effect immediately and causes VS to be scaled. VR also applies when the vector speed is specified with the ‘<’ operator. This is a useful feature for feed rate override. VR does not ratio the accelerations. For example, VR .5 results in the specification VS 2000 to be divided in half.

Command Summary - Linear Interpolation

COMMAND DESCRIPTION
LM xyzw LM abcdefgh
LM? Returns number of available spaces for linear segments in DMC-40x0 sequence buffer.
LI x,y,z,w < n LI a,b,c,d,e,f,g,h <
n
VS n Specify vector speed
VA n Specify vector acceleration
VD n Specify vector deceleration
VR n Specify the vector speed ratio
BGS Begin Linear Sequence
CS Clear sequence
LE Linear End- Required at end of LI command sequence
LE? Returns the length of the vector (resets after 2147483647)
AMS Trippoint for After Sequence complete
AV n Trippoint for After Relative Vector distance, n
IT S curve smoothing constant for vector moves
Specify axes for linear interpolation (same) controllers with 5 or more axes
Zero means buffer full. 511 means buffer empty.
Specify incremental distances relative to current position, and assign vector speed n.

Operand Summary - Linear Interpolation

OPERAND DESCRIPTION
_AV Return distance traveled
_CS Segment counter - returns number of the segment in the sequence, starting at zero.
_LE Returns length of vector (resets after 2147483647)
_LM Returns number of available spaces for linear segments in DMC-40x0 sequence buffer.
Zero means buffer full. 511 means buffer empty.
_VPm Return the absolute coordinate of the last data point along the trajectory.
(m=X,Y,Z or W or A,B,C,D,E,F,G or H)
DMC-40x0 User Manual Chapter 6 Programming Motion 88
To illustrate the ability to interrogate the motion status, consider the first motion segment of our example,
VS VZ VW
= +
2 2
#LMOVE, where the X axis moves toward the point X=5000. Suppose that when X=3000, the controller is interrogated using the command ‘MG _AV’. The returned value will be 3000. The value of _CS, _VPX and _VPY will be zero.
Now suppose that the interrogation is repeated at the second segment when Y=2000. The value of _AV at this point is 7000, _CS equals 1, _VPX=5000 and _VPY=0.

Example - Linear Move

Make a coordinated linear move in the ZW plane. Move to coordinates 40000,30000 counts at a vector speed of 100000 counts/sec and vector acceleration of 1000000 counts/sec2.
LM ZW Specify axes for linear interpolation
LI,,40000,30000 Specify ZW distances
LE Specify end move
VS 100000 Specify vector speed
VA 1000000 Specify vector acceleration
VD 1000000 Specify vector deceleration
BGS Begin sequence
Note that the above program specifies the vector speed, VS, and not the actual axis speeds VZ and VW. The axis speeds are determined by the controller from:
The result is shown in Figure 6.8: Linear Interpolation.
Chapter 6 Programming Motion 89 DMC-40x0 User Manual
POSITION Z
0
0
40000
FEEDRATE
0
0.1
0.5
0.6
4000
36000
30000
27000
3000
VELOCITY
Z-AXIS
VELOCITY
W-AXIS
POSITION W
TIME (sec)
TIME (sec)
TIME (sec)
Figure 6.8: Linear Interpolation

Example - Multiple Moves

This example makes a coordinated linear move in the XY plane. The Arrays VX and VY are used to store 750 incremental distances which are filled by the program #LOAD.
#LOAD Load Program
DM VX [750],VY [750] Define Array
COUNT=0 Initialize Counter
DMC-40x0 User Manual Chapter 6 Programming Motion 90
N=0 Initialize position increment
#LOOP LOOP
VX [COUNT]=N Fill Array VX
VY [COUNT]=N Fill Array VY
N=N+10 Increment position
COUNT=COUNT+1 Increment counter
JP #LOOP,COUNT<750 Loop if array not full
#A Label
LM XY Specify linear mode for XY
COUNT=0 Initialize array counter
#LOOP2;JP#LOOP2,_LM=0 If sequence buffer full, wait
JS#C,COUNT=500 Begin motion on 500th segment
LI VX[COUNT],VY[COUNT] Specify linear segment
COUNT=COUNT+1 Increment array counter
JP #LOOP2,COUNT<750 Repeat until array done
LE End Linear Move
AMS After Move sequence done
MG “DONE” Send Message
EN End program
#C;BGS;EN Begin Motion Subroutine

Vector Mode: Linear and Circular Interpolation Motion

The DMC-40x0 allows a long 2-D path consisting of linear and arc segments to be prescribed. Motion along the path is continuous at the prescribed vector speed even at transitions between linear and circular segments. The DMC-40x0 performs all the complex computations of linear and circular interpolation, freeing the host PC from this time intensive task.
The coordinated motion mode is similar to the linear interpolation mode. Any pair of two axes may be selected for coordinated motion consisting of linear and circular segments. In addition, a third axis can be controlled such that it remains tangent to the motion of the selected pair of axes. Note that only one pair of axes can be specified for coordinated motion at any given time.
The command VM m,n,p where ‘m’ and ‘n’ are the coordinated pair and p is the tangent axis (Note: the commas which separate m,n and p are not necessary). For example, VM XWZ selects the XW axes for coordinated motion and the Z-axis as the tangent.

Specifying the Coordinate Plane

The DMC-40x0 allows for 2 separate sets of coordinate axes for linear interpolation mode or vector mode. These two sets are identified by the letters S and T.
To specify vector commands the coordinate plane must first be identified. This is done by issuing the command CAS to identify the S plane or CAT to identify the T plane. All vector commands will be applied to the active coordinate system until changed with the CA command.

Specifying Vector Segments

The motion segments are described by two commands; VP for linear segments and CR for circular segments. Once a set of linear segments and/or circular segments have been specified, the sequence is ended with the command VE. This defines a sequence of commands for coordinated motion. Immediately prior to the execution of the first coordinated movement, the controller defines the current position to be zero for all movements in a sequence. Note:
Chapter 6 Programming Motion 91 DMC-40x0 User Manual
Loading...