Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

The Encoder Velocity Parameter is encoder pulses per servo interrupt. The default value of servo interrupt is 500 uSec so this is usually a very small number.

If you are trying to calculate velocity, see the sample program below:

REM ********************************************
REM Program to determine speed of source encoder
REM ********************************************
REM Be sure to allocate 1000 bytes of memory for Program

HALT
NEW
DETACH

AXIS1 ON
ATTACH MASTER1
ATTACH SLAVE0 AXIS1 "Y"

10 DIM LV2
20 P1=0
30 P4=0

100 INTCAP Y0 :REM Trigger INTCAP on marker
110 INH 809 :REM Assign P2 to value of Hardware capture register
120 P2=P12548 :REM Assign P5 to the value of Global system clock
130 P5=P6916

170 P3=(P2-P1):REM Determine pulses between marker pulse
180 P6=(P5-P4):REM Determine time (ms) between marker pulse

190 LV0=((1000/P6)*60):REM Calculate RPM

200 PRINT "Encoder count = ";P3;" * Time in mSeconds = ";P6
210 PRINT "RPM = ";LV0
220 PRINT " "

300 P1=P2
310 P4=P5
390 GOTO 100

REM ***** LRUN program to display information *****

Related FAQ:  How Fast is Servo Axis Moving?

  • No labels