Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering counter input from PCI-6602

Hello
 
I've got some RF and scattered interference causing some errant readings from three sensors (two magnetic and one magnetic proximity) which are giving me RPM readings from a spinning shaft.
 
Efforts to pinpoint and eradicate the interference have been fruitless and I believe I may be stuck with it.  It is causing errant high readings.
 
Here is my subVI for obtaining speed data from a sensor; This sensor is picking up one pulse per revolution on a 12000RPM shaft, 200hz.  What I would like to do is be able to filter my frequency input so that the unreasonably high numbers are discarded and not calculated for my mean RPM output.
 
I found the examples on property nodes and worked it into the flow of my subVI, but I'm not sure how to set it or even if it's going to do what I want it to.  I know I can't use a standard 'filter' DAQ assistant since I'm not getting a waveform, but a number.  I need desperately to remove these errant high readings from my setup ASAP and cannot afford to waste more time on chasing RF around the room.
 
I've also been successful at getting RPM data via period, and could use that and apply a filter if someone had an idea.
 
Any help is greatly appreciated.  I am going to also ask in the Labview forum since this is a programmatic issue as well.
 
 
___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 1 of 4
(3,596 Views)

Hello Ralph,

Every time you run the while loop in your example, you are creating and clearing the task.  This method can become a little inefficient.  Normally you would want to create the task before you enter into the loop and then clear the task after you leave the loop.  Each iteration of the loop will then read in the frequency value from the counter. 

Do you know the frequency of this noise?  You can create an external hardware filter that will eliminate this noise.  The problem with creating a filter is that a square wave consists of a lot of frequencies summed together.  Applying a simple low pass filter to your square wave, will not necessarily eliminate this problem and might degrade your square wave.

I would suggest using a digital filter on the counter input.  This means that your square wave must be at least so long in order for it be counted.  This might help eliminate your high frequency noise.  I have included an example of a simple VI that might help you.  Here is a great KnowledgeBase on how to implement Digital Filters on Counters.

Let me know if you have anymore questions on this issue.



Message Edited by Robert F on 08-31-2007 02:12 PM

Respectfully,

Rob F
Test Engineer
Condition Measurements
National Instruments
0 Kudos
Message 2 of 4
(3,575 Views)
Thanks very much Robert, I will approach it in that manner as soon as possible!

Question.  The larger VI that this will be part of requires that I read from three different channels.  Will that be able to work without hardware conflicts?

And I was planning on this being a subvi, which would run in a larger loop.  Doesn't that defeat the purpose of your structure change about keeping some elements out of the loop?
___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 3 of 4
(3,555 Views)
 

Hello Ralph,

You would still want to develop your main application so that you only create/configure and stop/clear the task once.  If you are trying to acquire the frequency data and manipulate that information, then I would suggest maybe Master/Slave or Producer/Consumer architecture. 

These architectures would allow you to have two parallel loops.  One is acquiring the data and the other is manipulating the data.  They are able to work independently of each.  The only difference is how they send data from one loop to the other.

Master/Slave uses notifiers to send data between loops.  This data type can only save one element at a time.  Only the most recent data will be passed between loops.  If you do not grab the data fast enough in your second loop, you might loose some data.  (This might be acceptable for your application)

Producer/Consumer uses queues to send data between loops.  This data type will allow you store multiple data.  It is a First In First Out FIFO queue.  This architecture is really good if you have a long data manipulation process.  It will allow you to collect data, while manipulating the data without overwriting the buffer on the DAQ.

In order to read the frequencies on three different counters just change the channel constant.  Here is an example of a channel constant that will read from four counters.


 

Message Edited by Robert F on 09-04-2007 03:36 PM

Respectfully,

Rob F
Test Engineer
Condition Measurements
National Instruments
0 Kudos
Message 4 of 4
(3,532 Views)