08-10-2010 07:41 PM
hola
estoy adquiriendo unos datos con una daq.
son los datos de un encoder .
el encoder me envia 1000 unidades por cada vuelta que yo le de .
es decir esta en cero si lo muevo hacia la izquierda una vuelta completa me da 1000unidades y si lo muevo hacia el otro lado me las resta incrementelmente. eso esta bien es lo que deseo.
lo veo perfectamente en labview
ahora lo que no he podido hacer es medir las revoluciones por minuto
porque no se como medir el tiempo...y no puedo utilizar un ciclo while...
gracias
08-11-2010 11:28 AM
08-11-2010 12:43 PM
thanks but my encoder is incremental...
08-11-2010 02:19 PM
Hi fabiancam,
My Spanish is not very good so I hope it's OK if I post in English.
From another thread it sounds like you are using a 6009. This board only has one counter that can be used to count digital edges (which is what I assume you are currently doing). I would take a look at the following community example for help to convert this software-timed edge count task to be used to measure RPM:
Software-Timed Frequency Measurement Using Edge Counter
The example checks the difference in counts between iterations of a software-timed loop. This allows us to compute the frequency of the pulses. There will be some jitter due to USB and the Windows system clock, but setting a longer Measure Time will compensate for this by dividing this jtiter over a larger time window. The example returns the data in Pulses Per Second but you can multiply by .06 for your 1000 pulse encoder to get the value in RPM.
(x Pulses / second ) * (1 rev / 1000 pulses) * (60 seconds / 1 minute) = .06x RPM
If you are NOT using a 6009, but rather a DAQ card that supports buffered counter measurements, then I would recommend using a deterministic clock instead of a software-timed loop. The example posted by Luciano is meant to show how to take an array of buffered encoder measurements (in degrees) and compute the slope of this array. Alternatively, if your board supports direct frequency measurements than this could be an option as well.
Best Regards,