Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

frequency measurements pci-6221

Hi,
 
   I need a little help from the Labview gurus out there.  I have LabView 8.0 and the latest version on Max.  I am using a PCI-6229 and an optical tachometer (has separate power supply) trying to read the rpms coming off of a pulley.  I have been tring to use a counter with a digital input frequency task with out much success.  So far I have figured out that I must give the data assitant vi a time out value for when the pulley is not moving.  The pulley has 8 pieces of reflective tape which should generate 8 pulses for each revolution.  The pulley speeds that I am interested in measuring are from 500 rpm to 8000 rpm ( 8 Hz to 133 Hz ).  The 8 pieces of tape where added to increase the resolution.  The actual signal being measured should be (due to the tape) 67 Hz to 1067 Hz. 
 
   I have tried all 3 methods with various settings but cannot seem to get a good signal (verified with hand held tach).  The measurements vary by several Hz and seem to spike way up radomly.  Most of the spiking disappears when I have the sensor input hooked up to PFI8 or 9 (depending on the method) and the return hooked up on digital ground (instead of on another PFI). 
 
   Could someone out there point out what I'm doing wrong?  I would appreciate any help selecting the correct measurement type, settings for it, pins and some insight on what a graphic indicator would look like when the measurement is correct (I suspect it should be a line that slopes up from left to right and does not flatten out at the end).  
 
     
0 Kudos
Message 1 of 7
(4,480 Views)
Hi,

In regards to the issues you are experiencing with "spikes" that seem to be cleared up with grounding, it is definitely important to make sure that the device whose signals you are measuring is referenced to the digital ground of your PCI-6221. 

Are the pulses that are being sent to the PCI-6221 at either 3.3V or 5V logic levels?  If so, then you should be able to hook your signal wire to the counter0 source input of your PCI-6221 and the ground reference of your device to the digital ground of your PCI-6221 in order to count reliably.  Why were you attempting to hook both your signal and ground wires to PFI pins?

The appearance of a graphical indicator depends on what information you are sending to it.  My recommendation is to use a waveform chart and send it frequency values.  If the pulley is rotating at a constant rate, then you should see a flat line on the waveform chart (indicating a constant frequency).  If the pulley is getting faster or slower you will see ramps up or down respectively on the chart.

Finally, if you are uncertain about how you've set up your code, example programs are a great place to start.  Here is a set of exmples that goes through 3 methods of frequency counting. Try "Method 1" listed in this set of example programs named "Inverse Period Measurement.vi"  Can you get an accurate reading?

Let me know if this helps out and if you have any other questins that I can help out with.

Have a great day!
Travis W

Message Edited by Travis W on 08-20-2006 11:42 PM

0 Kudos
Message 2 of 7
(4,450 Views)
Hi,

    I found a small problem in my code.  Method 1 and 3 work but give different degrees of accuracy.  Method 1 gives an rpm reading from 1250 to 1350 (actual is 1280 as measured with hand held tach).  Method 3 gives an rpm reading from about 1260 to 1300 (This is better but on our old data acquisition system we were able to get a reading with in 4 RPMs which would have been better but there were not enough bits).   Method one is set-up as 1 sample on demand.  Method 3 is set up as 1 sample on demand with a 300 divisior.  Changing to N samples only seems to slow the methods down.  I still seem to see the variation in both.  There is mention of Enable Duplicate Count Prevention (attribute/property) in the help.  How do I turn this on and do you think it would help?  I would like to get this measurement at least comparable to our old data acquistion system (within 4 RPM, 0.06 HZ).  I am fairly confident that this speed is stable (it is stable on the hand held tach and it was stable on the old system).  The DC motor that is actually driving the pulley thru a belt measures stable with the hand held tach and its analog signal with returns its speed is stable.  Any suggestions on what to check or improvements to how I make this measurement with code?    
0 Kudos
Message 3 of 7
(4,438 Views)
 Duplicate count prevention can be enabled through the use of a DAQmx property node, which will be tougher to do when using the DAQ Assistant.  If you wanted to give it a shot, I would recommend trying it with one of the shipping examples for frequency measurement or with one of the examples linked in the previous post.  Let me know if this helps out at all.

Also, can you look at this signal on the analog input of your pci-6221?  Are the pulses clean and distinct, or is their ringing and fluctuations in the signal?

Have a great day!
Travis W





Message Edited by Travis W on 08-22-2006 11:55 PM

Message Edited by Travis W on 08-23-2006 12:28 AM

0 Kudos
Message 4 of 7
(4,418 Views)

The spikes you describe sound like electrical noise -- DC motors are notorious for emitting electrical noise from their brush commutations.

Your 6229 has an 80 MHz timebase available for freq measurements.  Even at your top freq of ~1000 Hz, you should be able to measure speed to about 1 part in 80,000.  This corresponds to about a 0.1 RPM resolution.  I can't comment on whether the DAQ Assistant will get you there because I've never used it.

I'd venture that you should expect anywhere from 5-15% speed variations given the setup you described, with a prominent artifact based on the accuracy of your placement of the 8 tape strips.

I dunno if duplicate count prevention will help you in an "on-demand" acquisition mode.  There's a more advanced mode that I like to recommend, but there's some learning curve to get there.  The basic idea is to perform a continuous acquisition, explicitly request the 5+ most recent data points rather than waiting for new data, find reported speed by discarding the high and low values and taking a median of the rest of them.

-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 5 of 7
(4,405 Views)

I'm sorry its been so long since I posted last.  I had to allow a different test to run on this equipment and could not trouble shoot during it.  I have tried duplicate edge count prevention but it did not have any effect.  I hooked this sensor up to an analog input and sampled it.  I received a square wave that was at 0.5V to 4.5V.  The wave was pretty clean and distinct.  Every once in awhile there was a little nosie on the high side of the square wave (4.5V).  It was very short in duration and was less than 0.1 V.  It did not disrupt the frequency of the wave. 

Could you elaborate a little on the continuous acquistion, requesting the last 5 readings? 

0 Kudos
Message 6 of 7
(4,327 Views)

1. Continuous Acquisition: use the DAQmx Timing vi and specify "Continuous Samples" at one of the top wiring inputs before calling DAQmx Start.

2. Read Recent: Use a DAQmx Read Property node to specify:

   a. "RelativeTo" = "MostRecentSample"

   b. "Offset" = (-) # of samples to read.  For example: -5.

Then when you call DAQmx Read, specify the # of samples you want.  For example: 5.

Notes:

I *think* but am not 100% sure that the "RelativeTo" and "Offset" properties are persistent, meaning that they remain in effect until you specify otherwise.  If they're persistent you can set them up once outside your reading loop.  Otherwise, you'd need to set them up just prior to each read operation.

You may need to delay your very first reading to make sure that the desired # of samples have gotten into the DAQ buffer before you ask for them.

I suspect that your hand-held tach is doing a significant amount of filtering to produce such a constant steady speed measurement.  Your DAQ measurements show values that are in the same neighborhood but with a larger range of variability.  Frankly, variations sound more plausible than truly constant freq given your description of the equipment (reflective tape on a pulley).  If the average speed is the key item of interest, I'd recommend averaging over some multiple of full revs, i.e., 8, 16, 26, ... samples at a time.

-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 7 of 7
(4,320 Views)