Welding Electrode Making Machine By Deccan Dynamics
Galil Motion Control Product Workshop January 2012 Presentation
1. Galil Product Workshop
January 2012
Sold & Serviced By:
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
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
Sold & Serviced By: 2
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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 ”
Sold & Serviced By: 3
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 4
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 5
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 6
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 7
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 8
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 9
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 10
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 11
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
13. DMC-40x0 and DMC-41x3 Motor Drives
Sold & Serviced By: 13 * Released April 2011
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
14. Servo Drives with Sine Commutation
• AMP-43540 4-axis 600 Watt
• AMP-43640 4-axis 20 Watt
• Sinusoidal commutation minimizes
torque ripple. Ideal for linear motors
• Initialize with halls or encoders
• Available for DMC-40x0, DMC-41x3,and
DMC-30012 (800 Watt)
Sold & Serviced By: 14
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
17. Key Benefit – Daisy Chain Ethernet
Multiple DMC-300xx can be daisy chained
over Ethernet without the use of a hub
Sold & Serviced By: 17
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
19. RIO-47xxx Pocket PLC
Analog and Digital I/O with intelligence
in a cost-effective, compact unit
Sold & Serviced By: 19
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 20
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
21. System Operation
Sold & Serviced By: 21
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
22. Position Control Systems
BLOCK DIAGRAM
HOST MOTION MOTOR
DRIVER
COMPUTER CONTROLLER AND LOAD
POSITION
SENSOR
Sold & Serviced By: 22
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
23. System Elements
Host Computer
Motion Controller
Amplifier/Motor
Mechanical System
Sold & Serviced By: 23
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 24
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 25
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 26
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 27
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
28. System Elements
FILTER
DESIRED R X Y
POSITION
+
Σ G DAC AMP
GENERATOR -
C
POSITION
DECODER
P M
Sold & Serviced By: 28
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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.
Sold & Serviced By: 30
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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.
Sold & Serviced By: 31
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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.
Sold & Serviced By: 32
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 33
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 34
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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…
Sold & Serviced By: 40
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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)
Sold & Serviced By: 41
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 42
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 43
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 44
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 45
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 46
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 47
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 48
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 49
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 50
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 51
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 52
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 53
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 54
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 55
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 56
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
0 1000 2000 3000 4000
Sold & Serviced By: 57
Y Master Position (counts)
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 58
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 59
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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.
Sold & Serviced By: 60
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 63
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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.
Sold & Serviced By: 64
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 65
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 66
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 67
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 68
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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.
Sold & Serviced By: 69
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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)
Sold & Serviced By: 70
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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)
Sold & Serviced By: 71
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 72
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 73
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 74
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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’
Sold & Serviced By: 75
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 76
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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.
Sold & Serviced By: 77
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 78
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 79
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 80
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 81
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 82
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 83
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
84. Programming with Inputs/Outputs (I/O)
• Galil application programs handle hardware I/O, data
input, and messaging.
Sold & Serviced By: 84
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 85
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 86
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 87
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 88
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 89
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 90
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 91
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 92
RE
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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).
Sold & Serviced By: 93
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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)
Sold & Serviced By: 94
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 95
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
97. I/O Hardware Overview
• Home, limit and general
purpose inputs
• Amp Enable Circuit
• Uncommitted outputs
• Analog inputs
• Extended I/O options
Sold & Serviced By: 97
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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)
Sold & Serviced By: 98
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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
Sold & Serviced By: 99
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.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)
Sold & Serviced By: 100
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
101. Input Safety Features
• Abort input configuration and usage:
- Instantly stop motion on all axes (infinite deceleration)
- Opto-isolation provided through INCOM
- Used with OE command will disable amplifier (coast stop)
- CN command configures inputs for axis-specific aborts and code handling
• #ININT subroutine (configure with II command)
- Used to interrupt the controller on a specific input.
- Can be used to interrupt on a high or low going signal
• #LIMSWI subroutine
- Used if a limit switch condition occurs.
• #AMPERR subroutine
- used to interrupt on an amplifier fault (bad hall state, over current, over voltage,
ELO, etc)
• Note for Optima/Econo: Thread 0 must be running for automatic
subroutines to function.
Sold & Serviced By: 101
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
102. Amplifier Enable
• The amplifier enable signal
allows the Galil firmware to
control an external amplifier’s
ready state. (SH/MO)
• Third party amps have widely
differing enable signals.
– Active High/Active Low;
Enable/Inhibit;
Sinking/Sourcing; 5v, 12v,
24v
• DMC-40x0-I200, DMC-41x3 &
DMC-21x3-20105 are easily
field upgradeable for 16+
configurations.
• Provisions for other hardware
(ICM-20100, 2900,1900)
through 7406/7407 ICs
Sold & Serviced By: 102
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
103. Uncommitted Outputs
• Outputs are single ended and TTL level on the controller board.
• Opto-Isolated Outputs
• DMC-4000, RIO, DMC-21x3-ICM-20105 have high power
opto outputs. 500mA at a max of 3A per byte. 12-24VDC
• RIO also has 8 low power opto at 25mA. 5-24VDC
• DMC-41x3 has 4mA outputs, 5-24VDC. High power, 500mA
outputs available with (HSRC) order option
• PCI based: low power, 24mA opto-isolated outputs are
available through the ICM-1900-Opto and ICM-2900-Opto.
Available sourcing with –HISIDE order option.
Sold & Serviced By: 103
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
104. Uncommitted Outputs (cont)
High-power, sourcing, optically-isolated outputs as on the RIO, 4000, 41x3(HSRC),
and ICM-20105
Low power, sinking, optically isolated outputs on the RIO, ICM-1900/2900-OPTO,
Sold & Serviced By: 104
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
105. Analog Inputs
• Single ended analog inputs can be used for feedback, joystick
control, pressure or force transducers, etc.
• Controllers equipped with “AQ” command provide +/- 10, 0-10, +/-
5, 0-5 v ranges, and allow differential inputs.
• Standard 12-bit resolution. Optional 16-bit resolution. Increased
resolution does not necessarily yield increased accuracy.
• Noise considerations should be taken into account when using
analog inputs, especially in PC environment.
• DMC-40x0, 41x3 and RIO controllers have a dedicated analog
ground.
Sold & Serviced By: 105
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
106. Extended I/O Options (local and remote)
• DMC-4000 has 32 extended I/O 3.3v or 5v. Other boards may add DB
daughterboard.
• Extended I/O available on the controllers is 3.3 or 5v level. Take caution not to
connect 5v circuits to 3.3v extended I/O. Order -5v.
• Remote extended I/O via the RIO. Programmatically, the I/O appears local (SB,
CB, @IN, @OUT).
• Galil Ladder Compatible.
• Modbus TCP/IP and RTU. Motion controllers are ModBus masters.
Sold & Serviced By: 106
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
107. Troubleshooting
"There are only 10 types of people in the world:
Those who understand binary, and those who don't."
Sold & Serviced By: 107
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com
108. Troubleshooting Overview
• Communication problems
• Feedback problems
• Motion problems
• The red LED
• Programming problems
• Noise problems
Sold & Serviced By: 108
Toll Free Phone: 877-378-0240
Toll Free Fax: 877-378-0249
sales@servo2go.com
www.servo2go.com