2. About the Company
Established Reputation and Long History of Success
• Founded in 1983 by Jacob Tal and Wayne Baron
• Introduced 1st microprocessor-based servo controller
• Profitable for over 100 consecutive quarters
• Delivered over 500,000 controllers world-wide
Excellent Technical Support and Service
• World-wide network of factory-trained reps & distributors
• Technical support team with over 100 man-years of motion
control experience
• On-line support tools at www.galilmc.com
& Serviced By:
2
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
3. The Galil Support Team
• Live, prompt technical
support
• Over 100 years of combined
motion control experience
• Degreed MEs and EEs
“The mission of Galil’s experienced Applications Department is to provide
prompt and accurate technical assistance to help OEMs successfully deliver
their products to market ”
& Serviced By:
3
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
4. We Are Here to Help!
• LIVE Tech Support Provided at Galil headquarters:
Address: 270 Technology Way, Rocklin, CA 95765
Email: support@galilmc.com
Toll Free: 800-377-6329
Phone: 916-626-0101
Fax: 916-626-0102
Hours: 8am to 5pm PST, Monday through Friday
• Please provide:
– Name
– Company
– Address
– Phone/Email
– Galil Products and revisions
– Problem
– Error messages
& Serviced By:
4
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
5. Many On-Line Tools at www.galilmc.com
Galil’s free online support tools include:
• White Papers & application notes
http://www.galilmc.com/support/application-notes.php
• On-Line tutorials on motion control
http://www.galilmc.com/learning/tutorials.php
• MotionCodetm Toolkit with downloadable programs and code
http://www.galilmc.com/learning/motioncode.php
• MotorSizertm Software for easy sizing of motion systems
http://www.galilmc.com/learning/motorsizer.php
• HelloGaliltm Quick start for PC programming languages
http://www.galilmc.com/learning/hellogalil.php
• Bulletin Board with subject search
http://www.galilmc.com/forums/ubbthreads.php
• ServoTrends Newsletter Archives
http://www.galilmc.com/support/servotrends.php
• Product catalog with specs and pricing
http://www.galilmc.com/support/catalog.php
• Customer applications and videos
http://www.galilmc.com/support/smartmoves.php
& Serviced By:
5
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
6. About the Products
• Leading Edge
– 32 bit microcomputer with high-speed processing
– On-board program memory with multitasking
• Easy to Use
– 2 letter, English-like instructions
– Software tools for servo tuning
• Cost Effective
– 100 qty price guarantee; as low as $100/axis
• Flexible
– Available in 1 through 8-axis configurations
– Configurable for steppers and servos on any axis
– Box-level or card-level; PCI, RS232, and Ethernet
• Easy to Customize
– Firmware & hardware customized to specifications
& Serviced By:
6
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
7. Features- Handles any Mode of Motion
• Point-to-Point Positioning
• Position Tracking
• Jogging
• Linear and Circular Interpolation
• Tangential Following
• Helical
• Electronic Gearing
• Electronic Cam
• PVT Mode
• Teach and Playback
& Serviced By:
7
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
8. Features – High Speed
• Encoder frequencies up to 22 MHz for servos
• Outputs pulses for steppers up to 6 MHz
• Servo loop updates as low as 31 µsec/axis
• 40 µsec command processing for application programs
& Serviced By:
8
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
9. Features – Intelligent Programming
• On-board, non-volatile memory for storing application
programs, variables and arrays frees host
• Programmable event triggers including At time,
At position, At input, At speed
• Multitasking for simultaneous execution of up to eight
application programs
• Conditional JUMPS and IF/THEN/ELSE/Constructs
• Arithmetic and trigonometric functions
& Serviced By:
9
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
10. Features – Multiple Inputs/Outputs
• Accepts both main and auxiliary encoders for each axis
• SSI and sinusoidal encoder interface options
• Uncommitted digital inputs and outputs
• Uncommitted analog inputs on most controllers
• Expandable I/O
• Forward and reverse limits and home input for each axis
• High speed position capture
• High speed position compare
& Serviced By:
10
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
11. Features – Variety of Formats
• Available in 1-through 8-axis formats
• Box-level or card-level; Bus-based or stand-alone
• Ethernet/RS232 or PCI cards
• “Mix-n-Match” motor types: User-configurable for
steppers, servos and piezo ceramic motors on any
combination of axes
• Variety of plug-in amplifier options
• Custom solutions available
& Serviced By:
11
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
17. Key Benefit – Daisy Chain Ethernet
Multiple DMC-300xx can be daisy chained
over Ethernet without the use of a hub
& Serviced By:
17
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
19. RIO-47xxx Pocket PLC
Analog and Digital I/O with intelligence
in a cost-effective, compact unit
& Serviced By:
19
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
20. Smart. Compact. Low Cost. Lots of I/O.
Smart – RISC processor, memory, counters, timers,
PID process loops, web interface, data logging, email
alerts, Ethernet, Power-over-Ethernet, Modbus
Master/Slave, Ladder Interface Software
Compact – 3.9” x 4.3” x 1.3”
Low Cost – $295 in single quantity; $195 in 100 qty
Lots of I/O – 32 digital I/O & 16 analog I/O
& Serviced By:
20
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
22. Position Control Systems
BLOCK DIAGRAM
HOST MOTION MOTOR
DRIVER
COMPUTER CONTROLLER AND LOAD
POSITION
SENSOR
& Serviced By:
22
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
23. System Elements
Host Computer
Motion Controller
Amplifier/Motor
Mechanical System
& Serviced By:
23
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
24. System Elements Using AMP-19540
COMPUTER
DMC-1846
Controller
Building Earth 100 Pin Cable
AMP-19540 Vs
Brushless PSR-6-48
GND
Amplifier
Hall/Encoder Feedback
Phase C
Phase A
Phase B
Shield
BLM MOTOR
& Serviced By:
24
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
25. System Elements with Built-in Amplifiers
COMPUTER
Building Earth 100 Base-T
Vs
DMC-4000 GND
PSR-6-48
Hall/Encoder Feedback
Phase C
Phase A
Phase B
Shield
BLM MOTOR
& Serviced By:
25
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
26. Motion Controller Functions
COMMAND R X V
PROFILE
GENERATOR +
Σ FILTER
-
C
POSITION
DECODER
FUNCTIONS
Decode Position Feedback
Generate Desired Position R( t )
Close the Position Loop
P
Stability Compensation
& Serviced By:
26
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
27. Filter Operation
Proportional P(k) = KP · X(k)
Derivative D(k) = KD · [X(k) - X(k-1)]
Integral I(k) = KI · X(k) + I(k-1)
Functions:
Proportional For speed of response
Derivative For stability and damping
Integral For accuracy - slow response
& Serviced By:
27
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
28. System Elements
FILTER
DESIRED R X Y
POSITION
+
Σ G DAC AMP
GENERATOR -
C
POSITION
DECODER
P M
& Serviced By:
28
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
30. System Connection and Compensation
Connecting the system elements is done in three steps:
1. Test each function separately.
2. Close the position loop with low gain.
3. Tune the controller for fast and accurate response.
Potential problems and their effects:
1. Ground loops -- instability and noise sensitivity.
2. Connection with wrong polarity (positive feedback) -
- causes motor to run away.
3. Too high gain -- causes instability and oscillations.
& Serviced By:
30
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
31. System Compensation
Set PID filter to
KI = 0
KP, KD low values
Step I -- KD
Increase the derivative constant, KD, until system
vibrates, then back off.
Step II - KP
Increase the proportional constant, KP, until system
vibrates, then back off.
Step III -- KI
Increase the integral constant, KI, until system vibrates,
then back off.
& Serviced By:
31
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
32. Controller Features for High Precision Linear
Motors
• Update Rates as low as 32.25us
• Sine / Cosine encoder
– interpolation from x32 to x1024
• PID with Feed-forward Acceleration and Velocity.
• Dual PID and frictional bias
• Integration Limit
• Pole and Notch Filters to assist with mechanical
vibrations
• Profile filter to eliminate high-frequency, or select low-
frequency resonances
• New PVT mode provides motion profiles that don’t
have velocity discontinuities.
& Serviced By:
32
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
33. Amplifier Features for High Precision Linear
Motors
• New AMP-43540 600W Sinusoidal Amplifier
• Current loop update of 33 kHz –
– Capable of providing a closed loop current loop bandwidth
greater than 3 kHz
• 16 bits of current resolution
– Critical for small adjustments and reducing settling times.
– Linear Zero-Crossing, no dead-band or hysteresis around
zero.
• Settable current loop gains allows for support of a
wide variety of motors using standard product
• Enhanced PWM control to deliver space vector PWM
with sine commutation
& Serviced By:
33
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
34. GalilTools
Software package that enables easy set-up, tuning and
analysis of Galil’s latest control systems
• Designed for use on Galil’s current generation of products
Ethernet/RS232: DMC-40x0, DMC-21x3 and RIO-47100
PCI: DMC-18x6 and DMC-18x2
• Cross-platform compatible
• Communication drivers new from the ground-up, designed for
quick and efficient controller communication
• GalilTools Lite (no charge) also available
• Details, demos at http://www.galilmc.com
& Serviced By:
34
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
40. Programming: Two Methods
• Local (Stand-alone) • Host (Communication Bus)
PC PC DMC
TPXr
. dmc bus DMC C
bus
Controller
DMC
file Controller Program
Download File
123rn:
- PC not required at runtime - Bus can be Ethernet, Serial, PCI,
- BP – Burn Program ISA…
- #AUTO – Automatic Start Routine - Host can be Terminal, C, PLC,
LabView, Visual Basic, QNX
Linux, Touch Screen…
& Serviced By:
40
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
41. Programming: Sending Commands
• Install terminal emulator software:
• GalilTools
• Just type commands from keyboard
• USE UPPERCASE!
• <enter> key completes command
• Controller returns
: For valid commands
? For invalid commands (TC1 tell error)
& Serviced By:
41
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
42. Programming: Instructional Format
• Two-letter commands (mostly). Two kinds:
• Axis arguments: A (X), B (Y), C (Z), D (W), E, F, G, H
‘comment
BGX Begin X axis only
BGXW Begin X and W axes
BG Begin motion on all axes
• Numerical arguments
PR=1000
PRX = 4000 Set distance for X axis
PR 4000,,,4000 Set distance for X and W axes
PR *= 4000 Set distance on all axes
PRX=? Query distance for X axis (MG _PRX)
PR?,,,? Query distance for X and W axes
PR *= ? Query distance on all axes
& Serviced By:
42
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
43. Programming: Interrogating Status
TP Tell Position
RP Report commanded position
TE Tell Error
TT Tell Torque
TV Tell Velocity (Average velocity)
TA Tell Amplifier Error
TC1 Tell error code (Reason for ?)
SC Stop Code. Reason for premature stop.
KPX=? Print value of parameter (MG _KPX)
MG _HMX Print state of the X axis HOME switch (“operand”)
var = _HMX Assign state of the X axis HOME switch to variable
MG var Displays value of variable
& Serviced By:
43
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
44. Programming: Configuration Commands
CE Configure Encoders (Quadrature vs. Pulse/Direction)
MT Motor Type (Servo vs. Stepper; Motor Polarity)
BR Brushed Motor (for use with internal amplifiers)
KD Derivative Gain
KP Proportional Gain
KI Integral Gain
BN Burn (Store above settings in EEPROM)
BP Burn Program
BV Burn Variables and Arrays
& Serviced By:
44
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
45. Programming: Safety Commands
Position Error
OE Turn on Off on Error functionality (can be turned off
due to position error, limit switch, and/or abort input)
ER Position Error Limit TE > ER, turn off motor
#POSERR Automatic subroutine that will run with position error
occurs
Encoder Failure Detection – Standard on Accelera
Will trip when encoder has not registered > 1 count of change for OT
ms and the torque is > OV.
KI should be used when Encoder Failure detection is enabled
OA Turn on Off on Encoder Failure
OT Time for encoder failure
OV Voltage for encoder failure
& Serviced By:
45
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
46. Motion Programming
• Many modes of motion including:
Point-to-Point Positioning
Independent
Jogging
Vector Mode
Multi-axis
Linear Interpolation
Gearing
Following
Electronic CAM
Contouring
& Serviced By:
46
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
47. Point to Point Positioning
• Motion between specified axes is independent
• PR or PA Relative or Absolute Position [counts]
• Can change SP and AC during motion
• Example:
PR 1000, 4000 Specify relative position
SP 2500, 2500 Specify slew speed
AC 100000, 100000 Specify acceleration
DC 50000, 50000 Specify deceleration
BG XY Begin motion
AM XY Wait until motion complete
& Serviced By:
47
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
48. Jogging
• User specifies:
JG Jog speed and direction [counts/sec]
ST Stop motion
• Can change JG, AC, DC during motion
• Example:
JG -1000 Specify jog speed
AC 200000 Specify acceleration rate
DC 200000 Specify deceleration rate
BG X Begin motion
& Serviced By:
48
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
49. Vector Mode
• Linear and circular interpolation on two axes
• VM Specify axes
VP Linear segment [counts]
CR Circle arc segment [counts]
VS Vector speed [counts/sec]
VA Vector acceleration [counts/sec2]
VD Vector deceleration [counts/sec2]
VE End sequence
BGS Begin sequence
• Up to 511 segments can be given prior to motion
• Can send additional segments during motion
• Can change VS and VA during motion
• Can specify start and end speed with each segment using
VP <n
& Serviced By:
49
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
50. Specifying Linear Segments
6000 C
4000 B
A
2000
• Specify linear segments as destination coordinate with respect to start
of move sequence (absolute coordinate system)
Segment AB VP 2000, 4000
Segment BC VP 2000, 6000
& Serviced By:
50
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
51. Specifying Arc Segments
B
90
180 0 A
270
• Specify circular segment as radius, starting angle and travel angle.
Clockwise rotation is negative travel.
Segment AB CR 1000, 0, 90
& Serviced By:
51
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
52. Coordinated Motion
C (-4000,3000) D (0,3000)
R = 1500
• Example: B (-4000,0) A (0,0)
#MOVE
VM XY Specify axes
VS 5000 Specify speed
VP - 4000, 0 Linear Segment AB
CR 1500, 270, -180 Circular Segment BC
VP 0, 3000 Linear Segment CD
CR 1500, 90, -180 Circular segment DA
VE End of sequence
BGS Begin sequence
AMS Wait for sequence complete
EN
& Serviced By:
52
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
53. Linear Interpolation Mode
• Coordinated motion of up to 8 axes
• VS, VA, VD also apply
• Incremental distances (unlike Vector Mode)
• Example:
#MOVE
LM XYZ Linear Interpolation Mode-use XYZ axes
LI 5000, 2000, 0 Specify incremental moves for each axis
LI 2000, 1000, 2000
LI 0, 1000, 2000
LE End Linear Interpolation Mode
BGS Begin Motion
AMS Wait for profiled motion to complete
EN
& Serviced By:
53
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
54. Gearing
• Up to 8 axes electronically geared to master
• Eliminates mechanical gears
GA n n = X main encoder as master
n = CX command position as master
n = DX auxiliary encoder as master
n=S vector path as master
GR Gear Ratio ( + 127.9999 range)
• Can change Gear Ratio during motion
• Optima and Accelera Series support multiple masters
& Serviced By:
54
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
55. Gearing (cont.)
• Example:
GA Y,,Y Y is master of X and Z
GR 5,, -2.5 X ratio = 5, Z ratio = -2.5
PRY=1000 Master position
BGY Begin motion
& Serviced By:
55
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
56. Electronic Cam
• Can be used to simulate the motion of a mechanical cam
• Non-linear, periodic motion
• Up to 7 axes can be synchronized with an independent master
• The master can be either a controlled axis or an outside encoder
• An ECAM table is used to specify the position(s) of the slave(s)
with respect to the master throughout the motion cycle
& Serviced By:
56
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
57. ECam Example
EAY Y axis is master
EM 0, 4000 X (slave) change is 0 counts. Y (master) change is 4000
EP 2000 Master interval is 2000 counts between entries
ET[0] = 0 ECAM table defines positions of slaves
ET[1] = 1000 3 points, 2 intervals
ET[2] = 0
EB1 Enable ECam mode
EG -1 Engage slave immediately
JGY = 500 Jog master at 500 counts per second
BGY Begin master motion
X Slave Position (counts)
Cam Table
1000
500
& Serviced By:
0 1000 2000 3000 4000
57
ELECTROMATE Y Master Position (counts)
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
58. Contour Mode
• Bypasses the motion profiler
• Allows any time based function
• Incremental distances
• CM Enter contour mode, specify contoured axes
DT Specify time interval for each contour segment
CD Specify incremental distances for each axis
WC Wait for contour move to complete (similar to
AM command) - Not valid for Accelera Controllers
• Record (RA, RD, RC) and playback motion using Contour Mode and
arrays
& Serviced By:
58
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
59. Contour Mode (cont.)
Example – Accelera Example – Non Accelera
CM XY; ‘Setup Contour Mode
CM XY; ‘Setup Contour Mode
DT4; ‘Interval Time
DT4; ‘Interval Time CD50,100; ‘Contour Data
CD50,100; ‘Contour Data WC; ‘Wait for Contour
CD10,30; ‘Contour Data CD10,30; ‘Contour Data
CD100,50; ‘Contour Data WC; ‘Wait for Contour
CD 0,0=0; ‘End Segment CD100,50; ‘Contour Data
‘wait for buffer to empty WC; ‘Wait for Contour
MG “MOVE DONE”
#WAIT;JP#WAIT,_CM<511
EN; ‘End Program
MG “MOVE DONE“
EN; ‘End Program
& Serviced By:
59
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
60. PVT (Position Velocity Time) Mode
• Standard on Accelera products, available as a standard special for
other products
• Allows arbitrary motion profiles defined by position, velocity and time
• Advantage over Contour mode is there are no velocity discontinuities
• PVa=p,v,t PV command (position, velocity, time)
_PVa Contains number of segments available in buffer
BT Begin PVT Mode
_BTa Contains number of PV segments that have
executed
• Buffer is “per axis” and is 255 segments.
& Serviced By:
60
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
63. PVT Mode vs Contour Mode
Contour Mode Solution PVT Mode Solution
Point 3 Point 3
Y-Axis
Y-Axis
Point 1 Point 1
Finish Finish
Point 2 Point 2
Start Start
X-Axis X-Axis
& Serviced By:
63
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
64. Application Programming
• A DMC program allows motion commands to be combined with
other commands such as I/O handling to solve a complete
machine application.
& Serviced By:
64
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
65. Entering Programs
•Use Editor window for entering programs
•Use Upload and Download on GalilTools, Smart Term or WSDK to
modify existing programs and download changes to the controller
•SmartTerm: Turn on Syntax – Help for ease of programming and
press F1 to see more information
•GalilTools: double tap “Tab” in Terminal to get info on a command
•DMC Code Helper on line
• http://www.galilmc.com/support/code-helper/dmc-code-help.php
& Serviced By:
65
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
66. Program Structure
• Programs begin with #Label and end with EN instruction
• Labels designated by # followed by up to 7 characters
First character must be a letter
Other characters can be numbers
Spaces are not permitted
• Examples:
#AUTO Automatically starts on power-up
#BEGIN
#Pos1
& Serviced By:
66
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
67. Entering Commands
• Some commands return a value, some do not
• TPX returns a value
• STX does not
• Explicit Notation vs Implicit Notation
• PAX=1000 or PA 1000 either method is okay
• Don’t do: PA=1000 that will set a variable named PA
• XYZW or ABCD
• PAA=1000 or PAX=1000 both formats will move axis 1
& Serviced By:
67
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
68. Example Program
#BEGIN; ‘Begin program
PAX= 10000; ‘Position absolute
SPX= 50000; ‘Slew speed
ACX= 500000; ‘Acceleration rate
DCX= 500000; ‘Deceleration rate
BGX; ‘Begin motion
AMX; ‘After motion
EN; ‘End program
XQ #BEGIN Execute program from terminal
& Serviced By:
68
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
69. Program Flow
• Galil controllers offer many instructions to control program flow
such as halting until an event occurs, jumping to a location,
looping or executing a subroutine.
& Serviced By:
69
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
70. Trippoints
• Special commands that pause execution of a program until a
specified event occurs.
• Only valid inside a .dmc program.
AD After distance (profiled)
AI After input
AM After motion complete (profiled)
MC After motion complete (actual)
WT After time elapsed (wait)
& Serviced By:
70
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
71. Conditional Statements
• Special commands that cause program to branch on specified conditions.
• JP is a “blind” jump. JS jumps to a subroutine and then returns.
• Format: JP #LABEL, condition(s)
• Conditions: < less than
> greater than
= equal to
<= less than or equal to
>= greater than or equal to
<> not equal
• Examples:
JP #STOP, (error>100) Jump to #STOP if error is
greater than 100
JS #B, ((v1<0) & (v2>0)) Jump to subroutine #B if v1 is less than
zero and v2 is greater than zero
(JS statements can be nested up to 16 deep)
& Serviced By:
71
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
72. Conditional Statements
• IF statements can be nested up to 255 deep
• Use parentheses to surround each statement
• Example:
IF ((_TPX <= 5000) & (_TPX >=4000))
MG “In Position”
ELSE
IF (_TPX < 4000)
MG “UNDERSHOOT”
ELSE
MG “OVERSHOOT”
ENDIF
ENDIF
& Serviced By:
72
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
73. Creating Loops
#A Main program
n=5 Loop counter
#LOOP Loop program
PRX= 1000 Move distance 1000
BGX Begin Motion
AMX Wait for motion done
WT 500 Wait 500 msec
PRX=-1000 Move distance-1000
BGX Begin motion
AMX Wait for motion done
WT 500 Wait 500 msec
n=n-1 Decrement loop counter
JP#LOOP, n>0 Repeat 5 cycles
EN End program
& Serviced By:
73
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
74. Automatic Subroutines
• Controller can monitor certain conditions in the background
(“Event Driven” programming)
• Automatic monitoring is enabled by using the following
special labels:
#LIMSWI Limit switch active
#ININT Designated input changes state
#POSERR Position error exceeds ER limit
#CMDERR Bad command given
#MCTIME Timeout on motion complete trippoint
#TCPERR Communication error (Ethernet only)
#COMINT Communication interrupt subroutine
(RS-232 only)
#AMPERR Amplifier Error (Galil Amps)
• An application program must be running in Thread 0
for automatic monitoring for Optima/Econo controllers
& Serviced By:
74
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
75. Multitasking
• Multiple independent programs called “threads” can run
simultaneously
• All threads have equal priority
• One thread can execute or halt another thread
• All trippoints are available in every thread
• Variables are global - common to all threads
• Useful for background PLC; truly independent motions
• Use semicolons to execute a group of commands together
Commands:
XQ #Label,n Execute Program in thread ‘n’, where n=0
through 7 is thread number. 0 is main thread.
HXn Halt Execution of Thread ‘n’
& Serviced By:
75
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
76. Multitasking -- Example
• Example to Download:
#X X-Thread
PR 1000;BGX;AMX Move 1000
PR-1000;BGX;AMX Move-1000
JP #X Repeat Motion
#Y Y-Thread
PR,500;BGY;AMY Move 500
PR,-500;BGY;AMY Move -500
JP#Y Repeat Motion
#TIME I/O Thread
AT-50;SB1;AT-10;CB1 Every 50 msec Set Bit 1
JP#TIME Repeat
#MAIN Main Thread
JP#EXIT,@IN[1]=0 If input 1 low, exit
JP#MAIN Loop if input 1 high
#EXIT
AB Abort Motion and Program
EN End Program
• To execute from host/terminal:
XQ#MAIN,0
XQ#X,1
XQ#Y,2
XQ#TIME,3
& Serviced By:
76
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
77. Special Features
• Galil controllers use comments, variables, arrays, and
mathematical functions to make programming easier
and free your host PC for other tasks.
& Serviced By:
77
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
78. Commenting Programs
• Code with comments is far easier to understand
• Use NO or ‘ (single quote) to cause the processor to ignore
the following text. Not valid on Legacy controllers.
• Use “REM” to save space by having Galil software strip out
those lines before downloading to the controller
• Example:
REM – JOG motor 5000 cts/sec
JGX= 5000
‘set accel
ACX=100000
NO set decel
DCX= 100000
BGX; ‘ Begin Motion
& Serviced By:
78
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
79. Variables
• For inputting or changing parameters in a program
• Each variable is defined by a name, up to 8 characters long.
Variables are case sensitive. Lower case recommended.
• Range: +/- 2,147,483,647.9999 for numeric
variables
Six characters for string variables
• Examples:
posx=500 Assigns 500 to the variable posx
PR posx*2 Multiply variable by 2 and increment X axis
by result
var = “cat” Assign string cat to variable named var
& Serviced By:
79
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
80. Axis Designator
• Axis Designator ~a to ~h can be used like a variable axis
• Example
~a=0; ‘Axis A
#L
PR~a=1000;BG~a;AM~a;
~a=~a+1
JP#L,~a<4; ‘move axes 0-3
EN
& Serviced By:
80
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
81. Arrays
• For storing and collecting data (ideal for contour mode, teach,
and playback)
• One dimensional
• Each entry has same numerical range as variable
• Arrays defined by a name and number of entries
DM posx[7] Defines an array named posx with
seven entries
• Can automatically capture certain types of data, such as position,
error and commanded torque, into arrays over specified time
intervals
& Serviced By:
81
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
82. Record Data Mode
Instruction Interpretation
#RECORD; ‘Label
DM yerr[100]; ‘Dimension array
RA yerr[ ]; ‘Specify record mode
RD _TEY; ‘Data type for record
RC 4, 100; ‘Actual recording
EN; ‘End program
& Serviced By:
82
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
83. Mathematical and Functional Expressions
Mathematical Operators Logical Operators
&
+ - * /
|
@SIN[n] @COS[n] @COM[n]
@ABS[n] @FRAC[n]
@INT[n] @RND[n]
@TAN[n] @ATAN[n]
@ASIN[n] @ACOS[n]
@SQR[n]
Note: Math order of operations is left to right. Use
( ) parenthesis for correct order of operations
& Serviced By:
83
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
85. Input of Data
• Input data using variables
#INIT
Speedx=1000
#GO
JGX=Speedx
WT250
JP#GO
• From Host PC or HMI, send Speedx=2000 to double the speed
• Can use arrays instead of variables to enter a lot of data
& Serviced By:
85
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
86. Output of Data
• MG command used to send a message or return a value
• MG _KPX to show the value of KPX
• MG posx to display the variable POSX
• Output to specific communication port:
MG "HELLO THERE" Displays message out default port (CF command)
MG {P2} "HELLO THERE" Displays message to auxiliary RS-232 port
LU0; MG {L1} “ERROR” Displays message to Line1 of DMC-40x0 LCD
MG {EA}"POSITION=",_TPX Displays message via Ethernet (Handle A)
MG "Variable=",v1{F6.1} Displays message and value of
variable v1 with format 6
integers and one decimal
& Serviced By:
86
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
87. Uncommitted Inputs
• Available commands:
AI +/- n Wait for input n high/low
II n Interrupt if input n occurs
TI n Return state of all inputs in block n
MG@IN[1] Return state of input 1
TZ Returns all status of all i/o points
• After Input Example:
#JOG Jog program
JGX=1000 Jog speed
AI 1 After Input 1 high
BG X Begin motion
AI - 1 After Input 1 low
ST X Stop motion
& Serviced By:
87
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
88. Uncommitted Outputs
• Defined by:
SB n Set Bit n
CB n Clear Bit n
OP n Define all 8 bits
• Example:
#POS Label
PRX=1000 Position
BG X Begin motion
AM X After motion
SB1 Set bit 1
WT 1000 Wait
OP 0 Clear all outputs
EN End program
& Serviced By:
88
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
89. Analog Inputs
• + 10 Volts with 12 bit resolution (16-bits optional)
• AQ to adjust input range 0-10V, 0-5V, +/-5, differential
(AQ not available on all controllers)
• Available commands:
a1 = @AN[n] set variable a1 to analog input (in volts)
• Analog Input Example
#JOYSTK Joystick
JG0 Jog mode
BGX
#LOOP Loop
a1 = @AN[1] Read analog input
JGX= a1*1000 Change jog speed
JP #LOOP Repeat
EN End program
& Serviced By:
89
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
90. Homing
• Special moves to initialize the system:
FE Find Edge - Look for a transition on the home switch input
FI Find index - Look for an index (Z channel) pulse
HM Home - Includes:
High speed FE
Reverse and low speed FE
Low speed FI
HV Home Velocity – Velocity for 2nd stage for Accelera
& Serviced By:
90
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
91. Homing Sequence
HOME SENSOR
H O M E S W IT C H
_H M A=1 _H M A=0
P O S IT IO N
V E L O C IT Y
(1 ) M O T IO N B E G IN S
TO W AR D H O M E
D IR E C T IO N
P O S IT IO N
V E L O C IT Y
M O T IO N R E V E R S E
(2 )
TO W AR D H O M E
P O S IT IO N
D IR E C T IO N
V E L O C IT Y
M O T IO N TO W AR D
(3 )
IN D E X
D IR E C T IO N
P O S IT IO N
IN D E X P U L S E S
P O S IT IO N
& Serviced By:
91
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
92. Limit Switches
• Define the physical forward and reverse limits of your system.
• When a limit switch is triggered during a commanded move,
motion is stopped and further motion in the direction of the
triggered switch is not possible.
• Use the TS command or the _LF and _LR operands to monitor the
state of the limit switches.
• Use the #LIMSWI subroutine to respond to limit switches.
• SD – Switch Deceleration for new controllers
• Use the FL and BL commands to set travel limits in software.
• #LIMSWI example:
#LIMSWI;
~c=0
#Lim
IF (_LF~c=0);MG ~c," LIMIT HIT";ENDIF
IF (_LR~c=0);MG ~c," LIMIT HIT";ENDIF
~c=~c+1;JP#Lim,~c<4
& Serviced By:
92
RE
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
93. Dual Encoders
• Every axis has two encoder ports: Main and Auxiliary.
• The main encoder is used to close the primary control loop.
• The auxiliary encoder can be used to:
• Read the load position (linear encoder) for backlash
compensation. (Dual Loop mode – DVX=1)
• Provide position feedback for external device.
Applications: hand-wheel input, synchronizing with an
open loop motor (ie: a conveyor belt).
& Serviced By:
93
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
94. Program Troubleshooting
TC1 Tell Error Code (Why was a command rejected?)
SC Stop Code (Why did the motor stop?)
TI Tell Inputs (Is controller reading inputs correctly?)
TR1 Trace Program (Display each line as it executes)
TS Tell Switches (Home, Limit Switch status)
TA Tell Amplifier Status (Galil Amps)
& Serviced By:
94
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
95. More Information
• DMC Code Helper for 40x0 and RIO
• http://www.galilmc.com/support/code-helper/dmc-code-help.php
• Sample DMC Code Programming Library
• http://www.galilmc.com/support/sample-dmc-code.php
• User Manuals and Command References
• http://www.galilmc.com/support/manuals.php
& Serviced By:
95
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
98. Optically Isolated Inputs
• Two Primary benefits of Opto
• Electrical Isolation between systems
• Voltage level conditioning
• Grounding issues: the ground of an isolated power supply should not be
connected to the controller gnd for true isolation.
• Non-opto inputs: inputs are TTL with pull-up to 5V/3.3v. Close to ground for
activation. Take extra precautions to prevent noise.
(examples DMC-21x3-ICM-20100, DMC-18x2, DMC-40x0 extended I/O)
& Serviced By:
98
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
99. Optically Isolated Inputs (Cont)
Bi-directional Optos
External R needed External R needed
LSCOM if V > +28V LSCOM if V < -28V
+ 2.2K
2.2K
Isolated Isolated
I Supply I Supply
+
FLS FLS
Example Hardware:
DMC-40x0-I000
DMC-41x3
DMC-18x6
DMC-18x0
DMC-21x3-ICM-20105
& Serviced By:
99
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com
100. Encoder Synchronization
• High Speed Latch – Save encoder position when input occurs
• Use inputs 1-4 for latch inputs. IN[1] for X, IN[2] for Y, etc.
• ALx arms latch and _RLx stores the position once the position is captured.
• Captures position on state transition of specified input.
• Latch speed on TTL input is less than 1µs, low-going opto-isolated input is
12µs, 35 µs for high-going.
• Output Compare – Pulse output at encoder position
• One-Shot and circular/modular compare possible
• OC command sets up all behavior
• Powerful for position based external hardware synch
(e.g. laser marking, raster scans)
& Serviced By:
100
ELECTROMATE
Toll Free Phone (877) SERVO98
Toll Free Fax (877) SERV099
www.electromate.com
sales@electromate.com