|
[DPRG] Propeller Reading Ecoders
Subject: [DPRG] Propeller Reading Ecoders
From: John Abshier
jabshier at kc.rr.com
Date: Tue May 13 08:22:36 CDT 2008
At the outdoor competition, someone asked me about the Propeller's ability
to read encoders. The quadrature encoder object uses one cog (of 8). From
the documentation:
REQUIRED CYCLES AND MAXIMUM RPM:
Encoder Reading Cog requires 144 + 50*(TotEnc-1) cycles per sample. That
is: 144 for 1 encoder, 194 for 2 encoders, 894 for 16 encoders.
Conservative Maximum RPM of Highest Resolution Encoder = XINFreq *
PLLMultiplier / EncReaderCogCycles / 2 / MaxEncPulsesPerRevolution * 60
Example 1: Using a 4 MHz crystal, 8x internal multiplier, 16 encoders where
the highest resolution encoders is 1024 pulses per revolution:
Max RPM = 4,000,000 * 8 / 894 / 2 / 1024 * 60 = 1,048 RPM
Example 2: Using same example above, but with only 2 encoders of 128 pulses
per revolution:
Max RPM = 4,000,000 * 8 / 194 / 2 / 128 * 60 = 38,659 RPM
Note that most people run the propeller at 5 MHz with a 16x internal
multiplier. Therefore, the numbers above are conservative by a factor of
over 2.
Thanks to David Anderson and everyone else for a great contest.
John Abshier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.dprg.org/pipermail/dprglist/attachments/20080513/28b9670c/attachment-0001.html
More information about the DPRG mailing list
|