Galil Motion Control DMC-21 5 Series User Manual page 70

Table of Contents

Advertisement

The DMC-21x5 can compute trigonometric functions. However, the argument must be expressed in degrees. Using
our example, the equation for X is written as:
X = 50T - 955 sin 3T
A complete program to generate the contour movement in this example is given below.
Contour Mode Example
#points;
DM
pos[16];
DM
dif[15];
c=0;
t=0;
#a
v1=50*t
v2=3*t;
v3=-955*@SIN[v2]+v1;
v4=@INT[v3];
pos[c]=v4;
t=t+8
c=c+1
JP#a,(c<16)
#b;
c=0
#c
d=c+1
dif[c]=pos[d]-pos[c];
c=c+1
JP
#c,(c<15)
#run;
CM
A;
DT
3;
c=0
#e
CD
dif[c];
c=c+1
JP
#e,(c<15)
CD
0=0;
#wait;
WT
20
JP
#wait,(_CM<>511);
EN;
Teach (Record and Play-Back)
Several applications require teaching the machine a motion trajectory. Teaching can be accomplished using the
DMC-21x5 automatic array capture feature to capture position data. The captured data may then be played back in
the contour mode. The following array commands are used:
Chapter 6 Programming Motion ▫ 65
'label for program
'dimension pos array
'dimension dif array
'set c as index
't is time in ms
'argument in degrees
'compute position
'integer value of v3
'store in array pos
'program to find position differences
'compute the difference and store
'program to run motor
'contour Mode
'8 millisecond intervals
'contour distance is in dif
'end contour buffer
'wait until path is done
'end the program
COMMAND
RA
Specifies which arrays to use for recording
RD
Specifies data to capture
RC
Specifies time interval
_RC
Contains if recording is in progress
Table 6.13: List of commands related to Record Array
DESCRIPTION
DMC-21x5 User Manual 1.0a1

Advertisement

Table of Contents
loading

Table of Contents