VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

bandstop filter

Solved!
Go to solution

Is there a way to Implement a bandstop filter within the NIVS framework?

 

I have a PID loop feedback channel with oscillations in a very specific frequency range. I would like to attenuate in just that range.The Lowpass functionality in the Calculated Channels will not help me out.

 

Thanks,

PatM

0 Kudos
Message 1 of 10
(8,246 Views)

Hi Pat,

 

Do you have LabVIEW? If you do you can create a LabVIEW model as described in this white paper, http://www.ni.com/white-paper/11135/en , and implement a bandstop filter into Veristand from this model. You can find the Equi-Ripple BandStop.vi on your functions palette under Signal Processing>>Filters. 

Miles G.
National Instruments
Staff Applications Engineering Specialist
0 Kudos
Message 2 of 10
(8,220 Views)

Equi-Ripple Banndstop.vi requires an array to be passed in and then passes an array of filtered data out.

 

My understanding of how the Veristand Engine works is that one datapoint per channel is passed between the Primary Control Loop and the Model Execution loops for every iteration of the PCL. If this is the case, how do you pass arrays of data?

 

...or am I misunderstanding how this works?

 

PatM

0 Kudos
Message 3 of 10
(8,207 Views)

Hi Pat,

 

I checked into this and while you should be able to write arrays from your LabVIEW model to VeriStand and vice versa, there is currently a problem that is being worked on related to this. LabVIEW Models will generate an Nx1 array while VeriStand expects a 1XN array. However, this check does not occur when you are pulling values from a text file. Therefore, you can work around this problem by writing to and from a text file when you need to pass arrays of values between VeriStand and a LabVIEW model. 

 

If you'd like to track the progress of this problem, you can watch for the number, 402293, in our bug fixes document we publish with each new release of VeriStand. 

 

I hope this helps.

Miles G.
National Instruments
Staff Applications Engineering Specialist
0 Kudos
Message 4 of 10
(8,189 Views)

Hi Pat,

 

A colleague of mine pointed out something I missed here and I wanted to pass it on to you. A simpler and more effective implementation for you would be the Point by Point Filter VIs available in LabVIEW. You can see how to navigate to this palette in the picture below. This should make working with VeriStand much easier for you. I hope this helps, and I apologize for not bringing it up earlier.

 

Point by Point Filters

Miles G.
National Instruments
Staff Applications Engineering Specialist
0 Kudos
Message 5 of 10
(8,154 Views)

I tried out using the point by point bandstop filter in my model. I stuck it in a Case structure so I could turn it on and off. When it is off the output matches the input as expected. When it is on the output goes to zero.

 

The x input is a millivolt level voltage channel scale to represent load. The other vi inputs are as follows:

 

higher pass frequency - 40 Hz

lower pass frequency - 0 Hz

 

higher stop frequency - 22

lower stop frequency - 17

 

# of taps - 33

 

sampling frequency - 600 Hz (first try)

                                - 100 Hz (second try)

 

PCL loop rate - 600

 

What is wrong?

 

Thanks,

PatM

0 Kudos
Message 6 of 10
(8,115 Views)

Hi Pat,

 

Do you know what frequency the signal your getting in is? Have you tried running it through an FFT to see what frequencies are present in the signal in order to make sure it's not between your stop frequencies? 

Miles G.
National Instruments
Staff Applications Engineering Specialist
0 Kudos
Message 7 of 10
(8,099 Views)

oops!

 

I read through the help file for the Pt. by Pt. Bandstop vi and discovered that setting the lower pass frequency to 0 will cause the the output to be 0. I changed the lpf to 1 and the problem was resolved. There is however, a pretty significant offset that varies with the amplitude of the input. Is there any adjustments I can make to the input parameters that will minimize the offset?

 

Thanks,

PatM 

0 Kudos
Message 8 of 10
(8,090 Views)

Hi Pat,

 

What kind of offset are you seeing? Is your signal showing a higher amplitude than the input, or lower than the input, or something else entirely? Could you show a side by side example of what you're expecting and what you're getting, or describe it?

Miles G.
National Instruments
Staff Applications Engineering Specialist
0 Kudos
Message 9 of 10
(8,077 Views)
Solution
Accepted by topic author pmac

I changed the location of the bandstop filter within my PID loop and that resolved the offset problem. Everything seems to be working well now.

 

Thanks for your help,

PatM

0 Kudos
Message 10 of 10
(8,062 Views)