Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital filtering in PXIe-4330 with hardware timed single point sampling?

Hi, a question from a fairly new LabVIEW user:

 

I want to take measurements from a loadcell using the PXIe-4330 module.  It is a real time force-control application, so my main concern is obtaining the latest force reading from inside a control loop.  When setting up DAQmx I see three sample mode options: finite, continuous, or hardware timed single point.  Based on other forum posts, I gather that the single point option is most appropriate for my needs.  Unfortunately, using this approach I see a lot of noise in the readings.

 

I've read that the 4330 module is intelligent about filtering the signals according to the sample rate you use (it oversamples as fast as it can and then applies a digital filter with cutoff determined by the desired sample rate).  Sure enough, when I use DAQ assistant and set the sampling mode to continuous, the signal looks very smooth; it seems the noise is being effectively filtered out.  As soon as I switch to hardware-timed single point mode, the noise returns.  I'm assuming that the digital filtering isn't enabled, or isn't set up the same, in single point mode.

 

Is there a way I can get the 4330's digitial filtering working in the single point sampling mode?  If not, is there an alternative using the continuous sampling mode that would still be practical for a real time control application?

 

Thanks!

Matt Hall

0 Kudos
Message 1 of 3
(3,928 Views)

Matt,

 

I have no experience with the PXIe-4330 but will offer some general comments.

 

Any filter requires multiple samples of the signal to work. So it is not at all clear how a filter could work in the hardware timed single point mode. 

 

When doing control operations often the most important issue is getting data on a timely basis so the process does not get too far from the setpoint before the next control update.  If this is a critical issue, you need to be using a real-tme OS. Once you have established the maximum allowable time between updates, you can decide how to manage the data collection.

 

Suppose you need to update once per second. Then you could sample continuously at 1000 samples per second and read 1000 samples on each call to the DAQmx Read. Average the 1000 samples and use the average as the single point input to the control algorithm.  At low speeds the time to do the average and control calculations will be negligible. At higher speeds the processing time needs to be carefully considered but the concept is the same.

 

Averaging is pretty fast.  You might be able to simply sum the array of samples and let the control algorithm do any necessary scaling (saving possibly one division operation and an array size operation).

 

Lynn

0 Kudos
Message 2 of 3
(3,911 Views)

Lynn, thanks for the input!

 

To clarify what I was talking about, the PXIe-4330 apparently does oversampling and applies a digital filter by itself, i.e. with the embedded microcontroller(s) on the actual module.  So this is seperate from LabVIEW, and perhaps possible even in single point sampling mode.  I thought it might be possible anyway, but it doesn't seem to be happening.  So, I've adopted a solution along the lines of what you suggested: continuous sampling at 500 Hz and grabbing groups of ~5 samples every 10 ms and averaging them to use for control.  In this mode, the onboard filtering of the module is clearly active, making a huge reduction in noise (regardless of my meagre 5-sample averaging).

 

If I needed more filtering, I would probably try to implement a digital filter in LabView, since averaging has a pretty big delay penalty for the filtering it accomplishes.

 

I found the first few posts in this thread helpful in setting it up: http://forums.ni.com/t5/Multifunction-DAQ/DAQmx-continuous-sampling-problem/td-p/393033

In my case, I'm using a PXI with RTOS as a real time target.

 

0 Kudos
Message 3 of 3
(3,894 Views)