From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Lowpass Filter Design question

I am taking measurements using a 9205 in a C-series expansion chassis connected to an FPGA.  The scaling I have to do is 2.5 V/185 mA so you end up multiplying the signal by 5405.405 to get mA readings.  Since I am multiplying by such a large number a small change in the voltage read makes a big difference in the mA reading - hence I need to filter.

 

Right now I have experimented with a point by point butterworth 2nd order low pass filter with a cuttoff frequency of 0.015 and a sampling frequency of 250.  I really have just been experimenting and don't know the appropriate way to chooose these values.  I need to be able to have accurate measurements within +/- 1.5%.

 

I know changing the sampling rate and cutoff frequency can dramatically effect the response of the system - it needs to have a fast response time (not sure exactly what that number might be but less than a second for sure).

 

Does anyone have any filtering knowledge they can throw at me?  I have attached a FFT graph of the filter when the input is "0" and there is no scaling or offset - zero usually hangs areoung 0.017 +/- 0.004 V.

 

Thanks for any help.

0 Kudos
Message 1 of 14
(3,759 Views)

Let's start at the beginning.

 

1. Scaling by any constant factor will not change the signal to noise ratio and will not have any effect on the output of a filter except for magnitude.

2. For 2.5 V @ 185 mA I calculate 74 mA/V, not 5000+.

3. What is your signal source? What is the bandwidth of the desired signal? What is the source and nature of the interference or noise? What is the bandwidth of the interference/noise? What is the signal to noise ratio at the input to the A/D conversion?

4. What are you doing with the signal after it is acquired and filtered, if necessary?

 

Lynn

Message 2 of 14
(3,740 Views)

1. Yes that is true and that's where I am having trouble - I don't know how to get rid of enough noise while keeping an acceptable response time.

2. Oops... I wrote that wrong.  It has a maximum reading of 2.5 V with a conversion of 1000mA/185mV = 5.405405 (then multiply by 1000 to get 5405.405 mA/V scaler)

3. The signal source will be solonoid currents (right now I've been using a constant current source for testing).  Off the top of my head I don't have the bandwidth of the desired signal but I can get that.  The rest of the items I don't know and am not sure how I can get.  (Told you I don't know much about filtering things or what is needed to know to filter things.)  I will try to get as much of the information that you asked for as I can.

4. The cleaned up scaled and acquired signal is going to be logged and recorded - this system runs automated testing and records the results.

 

I don't know if this helps, but the measurement device is a ACS714 Hall-Effect Current Sensor.  Unfortuntaely I don't have the schematics to know exactly how it is hooked up.

 

Thanks.

0 Kudos
Message 3 of 14
(3,724 Views)

I have some circuits using the ACS 758, so I am familiar with that family of devices.  The outputs are rather noisy.

 

Let's work backward from the answers to 4 to get some ideas about 3.  How often do you log a data point? What is the accuracy requirement? Are the solenoids used to provide mechanical force? How often are they switched? Does the current ever vary (other than on/off)? If so, over what range and how fast?  Are you measuring other parameters (voltage, force, temperature,...) as well as current?  These questions are easier to answer and may provide most of the information needed to choose a filter or other signal processing.

 

Lynn

Message 4 of 14
(3,705 Views)

Thank you for the help.  I am working on getting more details about what it is going to reading.  I have some of them but am waiting on others.

 

1.  How often do you log a data point?

Right now nothing is being "logged."  I am just looking at the output as it comes.  The way it is set up is the voltage is read from the output of the ACS714 with a 9205 card in a C-series expansion chassis along with three other 9205's taking the same measurements.  The chassis is connected to an FPGA (7813R) in a PXI rack which is connected via ethernet to a host computer through an 8110 embedded controller.  So as of now it's gathering data points as fast as the hardware will allow it to.

 

2.  What is the accuracy reqiurement?

Ideally I want the accuracy of the measurement to be +/- 1% of the signal I am trying to measure, but +/- 1.5% is acceptable.

 

3.  Are the solenoids used to provide mechanical force?  How often are they switched?

The solenoids represent electro-hydraluics valves in a machine so they provide force to move a valve open/closed.  So in the field they could potentially be switched on and off as fast as someone uses the control.  As far as testing goes - I'm waiting to hear back from one of the test engineers.


4.  Does the current ever vary (other than on/off)?  If so, over what range and how fast?

The total current range that can be expected is between 0 - 5 A, but more commonly the measurements will fall in the 0 - 2.1 A range.  I am told that the current could be turned on from 0 A to rated current in as little as 10ms but realistically it would ramp from 0 - 2 A in ~100ms.

 

5.  Are you measuring other parameters (voltages, force, temperature,...) as well as current?

These measurements are apart of a larger test system where several measurements are taken.  As far as relating directly to the solenoids - this is the only measurement as part of an FIU setup using PXI-2512 cards to do the FIU.

 

Other information I was told is that we are trying to read the average current in the circuit as opposed to trying to observe minute details.  We are running the data acquisition in VeriStand and so are limited by the loop rate of the model we are running which can range from 100 - 5000 Hz.


That's about all the information I was able to gather so far.  Hopefully it helps - I appreciate it.

 

EDIT:  We also have a 10 uF external cap on the output acting as a filter too.  When originally looking at the signal we observed a pretty big decrease in overall noise, but I'm wondering if this cap is too big and contributing too much to a sluggish response time.  I notice in the data sheet they only go up to a 470 nF as an external filter capacitance when the effects on rise time - not to say that a bigger one won't work for any given application but it got me thinking about it.

0 Kudos
Message 5 of 14
(3,691 Views)

That is all helpful information.

 

Since you are only turning the valves on and off, you are limited by the supply voltage and the inductance and resistance of the coils. Realistically the mechanical time to move the valve is probably longer than the electrical time constant, although that might be worth checking.  Solenoid valve inductance is usually not specified but time constants in milliseconds or even tens of milliseconds are not out of the ordinary. 0-2 A in 100 ms seems quite reasonable.

 

Settling to 1% is about about 5 time constants. Any measurements taken in less time than that near a change in the current are dynamic and not meaningful averages.

 

This is what I would suggest: Read the data at about 100 ms intervals -> number of samples to read = Sampling rate/10. Then average all those samples to get one data point every tenth of a second. This is the simplest possible low pass filter and is probably good enough. Also, reduce the 10 uF capacitor. The maximum specified capacitive load is 10 nF (see page 4 of the data sheet). It does not indicate what happens with larger capacitors but many op amp circuits will either oscillate or shut down with too much capacitance at the output. Set the filter capacitor no larger than 1-2 uF. They do not specify a maximum for that but the rise time (extrapolated, page 12) may become a problem for larger values.  Note that the noise is specified as 21 mV peak to peak with a 47 nF filter capacitor. That is the equivalent of >100 mA.  My guess is that with the configuration I have suggested, you will get a noise level on the order of 10-30 mA peak to peak.  50 mA is 1% of the 5 A full scale, so this should be good enough. To get the noise any lower will require a longer response time.

 

Lynn

Message 6 of 14
(3,681 Views)

Thank you for all the help.

 

One question -

Are you suggesting that I just do this averaging-type filter by itself or use it in addition to the butterworth filter that I already have in place?

0 Kudos
Message 7 of 14
(3,675 Views)

While there is nothing wrong with a Butterworth filter, I do not think you will gain much from using it compared to the simple averaging technique.  With the sampling rates you will be using, the point to point filters probably could not keep up.

 

Lynn

Message 8 of 14
(3,672 Views)

What about using a point to point mean under the probability and statistics pallet?

0 Kudos
Message 9 of 14
(3,670 Views)

You were talking about sampling at 250 samples per second in the original post. Trying to do everything in 4 milliseconds to be ready for the loop to go around again is the issue.  Since nothing of much significance can happen faster than about 10 times per second, it seems a lot easier to grab the data in 100 ms chunks and process it as an array rather than point by point.

 

Lynn

0 Kudos
Message 10 of 14
(3,658 Views)