Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Speed measurement with PCI6601

I am building an application for measuring two linear encoders ( micrometers ) and one quadrature encoder for measuring speed of one motor.

At the moment I can read the two linear encoders with the "position measurement" option for the PCI6601.
But I have trouble to calculate in an easy way the speed of the rotating motor in RPM.

Could anyone have any easy solution for doing this?

Thanks

Massimo Visintin
0 Kudos
Message 1 of 7
(4,175 Views)
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

- This EXAMPLE on using the 660x devices for frequency measurements.

Regards,

AlessioD
0 Kudos
Message 2 of 7
(4,156 Views)
Thanks for your info; I tried to use the VI you suggested but on my actual VI ( it runs every 40 milliseconds ) the new frequency VI stops the data acquiring of the rest of VI.
So, I am trying to solve this problem ( using Labview 6.1 ) by using in my WHILE loop running every 40 ms, a shift register of 25 elements and calculate the difference between the first and the last elements: this is my speed in mm/s. It's not the best solution but it seems to work quite well.

Massimo Visintin
0 Kudos
Message 3 of 7
(4,149 Views)
One other thing you could do is to implement a buffered edge counting for your speed measurement. Setting counter operations to buffered count allows your software to download the count at any given time into a buffer.
BAsically the counter starts counting edges on the source input and every time there is an edge occurring on the Gate input, the current count is stored into a buffer.
If the edges coming into the Gate input are periodic with a know period (e.g. 1 Edge/sec) then you would know how many edges occurred on the source input over 1 second.
There sholud be some examples that show how to do this in LabVIEW

Cheers,
AlessioD
0 Kudos
Message 4 of 7
(4,149 Views)
Alessio, I had a loot to the VI's you are mentioning in your reply. At the moment I have three of the four 6601 counter channels in use, but in the near future I will need the last counter channel for another rotation speed measurement, I need a VI with only one channel for the speed reading. Your idea is good but is not so clear for me how to use one counter channel for reading both the acual count every 40 ms and the buffered counts in 1 second with a very quick program.

Massimo Visintin
0 Kudos
Message 5 of 7
(4,144 Views)
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.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 6 of 7
(4,138 Views)
Kevin, thanks for your time.

2. My speed has not to be accurate. In particular its range is from 0 to 70 mm/s with a precision of +/- 1 mm/s.

3. Could be a good solution to use a different loop once per second to measure the speed to make the program more efficient. But wich is the best way to do this. Now I have only one loop running every 40 ms. This speed is needed to read all the counts coming from one encoder at 250 pulses/rotation.

1. I agree with you for using a simpler measurement as I don't need precision. My measurement is only an indication for the operator of the speed of the working machine.

Thanks for your time.
Massimo Visintin
0 Kudos
Message 7 of 7
(4,132 Views)