8
•
Chapter 6 Programming Motion
CDS-3310
EN
End first program
#RUN
Program to run motor
CMA Contour
Mode
DT3
8 millisecond intervals
c=0
#E
CD dir[c]
Contour Distance is in dir
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 CDS-3310 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
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
SHA Servo
Here
Содержание CDS-3310
Страница 26: ...18 i Chapter 2 Getting Started CDS 3310 THIS PAGE LEFT PLANK INTENTIONALLY...
Страница 32: ...24 i Chapter 3 Connecting I O CDS 3310 THIS PAGE LEFT PLANK INTENTIONALLY...
Страница 124: ...CDS 3310 Chapter 8 Hardware Software Protection i 63 THIS PAGE LEFT PLANK INTENTIONALLY...
Страница 138: ...CDS 3310 Chapter 10 Theory of Operation i 77 THIS PAGE LEFT BLANK INTENTIONALLY...