05-19-2005 11:30 AM
05-26-2005
04:32 AM
- last edited on
11-12-2025
07:48 AM
by
Content Cleaner
Massimo,
the speed of the rotating motor can be measured by measuring the frequency of the signals coming from the encoder (or the period).
I suggest you take a look at
- This TUTORIAL on Frequency Measurements
Regards,
AlessioD
05-26-2005 01:29 PM
05-27-2005 12:28 AM
05-27-2005 08:38 AM
05-27-2005
10:29 AM
- last edited on
11-12-2025
07:49 AM
by
Content Cleaner
Massimo,
A few notes in no particular order:
1. Re: future use of last counter for another speed measurement. With the 6601, you only have 1 DMA channel available for buffered measurements. A second buffered measurement would have to be manually configured to use interrupts.
A buffered measurement will give you much better precision, but you may be better off starting with a simpler unbuffered approach when getting started.
2. How accurately do you need to measure speed? And how often do you need a new measurement? It sounds like you're reasonably happy with a simple speed estimate made about once per second.
3. Have you considered making a separate loop for the speed measurement? You could simply read the count once per second (unbuffered) and put it into a shift register. Then estimate speed as delta counts divided by delta time. A small enhancement would be to also store the time from 'Tick Count (msec)' on each loop, and use a measured delta time rather than an assumed one in the calculation.
Note that with this method, it's best to run unbuffered to avoid the lock-up problem you saw. It'll also be simpler to add your second speed-measurement counter task in the future.
4. Again, there *are* solutions available involving precise buffered measurements. I recently posted a DAQmx-based example that includes an instant-response buffered read (toward the end of this thread.). But I'd recommend first getting a simpler approach to work, then coming back to the buffered measurements later when you're sure you need more precision.
Good luck!
-Kevin P.
05-27-2005 01:04 PM