Galil DMC-2X00 用户手册

下载
页码 267
DMC-2X00 
Chapter 6  Programming Motion  
y 59  
JP #c,c<15 
 
EN 
End first program 
#RUN 
Program to run motor 
CMA Contour 
Mode 
DT3 
4 millisecond intervals 
c=0  
#E  
CD dif[c] 
Contour Distance is in dif 
WC 
Wait for completion 
c=c+1  
JP #E,c<15 
 
DT0  
CD0 Stop 
Contour 
EN 
End the program 
Teach (Record and Play-Back) 
Several applications require teaching the machine a motion trajectory.  Teaching can be accomplished 
using the DMC-2x00 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: 
DM C[n] 
Dimension array 
RA C[] 
Specify array for automatic record  (up to 4 for DMC-2x40) 
RD _TPA 
Specify data for capturing (such as _TPA or _TPC)  
RC n,m 
Specify capture time interval where n is 2
n
 samples, m is number of records 
to be captured 
RC? or _RC 
Returns a 1 if recording 
Record and Playback Example 
Instruction Interpretation 
#RECORD Begin 
Program 
DP0 
Define position for A axis to be 0 
DA*[ ] 
De-allocate all arrays 
DM xpos [501] 
Dimension 501 element array called xpos 
RA xpos [ ] 
Record Elements into xpos array 
RD_TPA 
Element to be recorded is encoder position of A axis 
MOA 
Motor off for A axis 
RC2 
Begin Recording with a sample rate of 2
2
 msec 
#LOOP1;JP#LOOP1,_RC=1 Loop 
until 
all 
elements have been recorded 
#COMPUTE 
Routine to determine the difference between consecutive points 
DM dx [500] 
Dimension a 500 element array to hold contour points 
i = 0 
Set loop counter 
#LOOP2 
Loop to calculate the difference 
DX[I]= xpos [i+1]- xpos [i] Calculate 
difference 
i=i+1 
Update loop counter 
JP#LOOP2,i<500 
Continue looping until dx is full 
#PLAYBK 
Routine to play back motion that was recorded