rem Using quadrature-Z decoder
rem This program makes the Z-motor to move
back and forth
rem Commands demonstrated; velz, accz, posz, movaz, rem, wait, goto, rquadz
rem The Z-motor quadrature encoder should be connected to the quadrature encoder
of
rem input of the controller. Please consult the Hardware Reference Manual.
rem Set the velocity
velz 2000
rem Set the acceleration
accz 20000
rem Set quadrature decoder to 0
squadz 0
200
rem Set the position to move to
posz 5000
rem Start the absolute move
movaz
rem Wait until the move is completed
donez?
rem Wait for 250 msec
wait 250
rem Read quadrature decoder-Z
rquadz A
print "Quad-Z = ", A
rem Set the position to move to
posz 0
rem Start the absolute move
movaz
rem Wait until the move is completed
donez?
rem Wait for 250 msec
wait 250
rem Read quadrature decoder-Z
rquadz A
print "Quad-Z = ", A
rem Start all over again
goto 200
end
$
Copyright © 2002, 2003, 2004, 2005, 2006 Optimal Engineering Systems, Inc.