LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

lowpass filter in labview 7.1

Solved!
Go to solution

Hi all

 

I would like to ask about lowpass filter.

Is there any way of making a simple lowpass filter without any add on in Labview 7.1.

We are trying to connect a micro-switch into a DAQmx device, but the thing is, since the switch is somehow ground-connected to a stepper motor, whenever the motor runs, it will have spikes, and those spikes were read as 1 logic in the labview. Since we don't have any signal processing add ons in the labview, we are trying to make it ourself.

 

Thank you

-Just a student-
0 Kudos
Message 1 of 11
(10,392 Views)

Hi Nandha

I think there's a couple of relatively simple solutions you could use here. Firstly, depending on your Daqmx device, you may be able to use the 'minpulsewidth' property on your daqmx task which can instruct the card to ignore any signals which last less than x microseconds. If your device can use the change detection method then you should be able to implement this.

Alternatively, you could analyse your readings and code your labview program to ignore a minimum number of logic 1's. I'm assuming here that you are using just a single digital input and sampling that input at a given rate. In which case, use a loop structure to search your data for a change from logic 0 to logic 1. When that change occurs, count the number of samples at logic 1 and if the number of samples is less than x, then discard that data.

 

If you need any more help on this then it would be useful if you could provide more information on what you are trying to achieve and details of your daqmx device.

 

Regards,

Andy

Message 2 of 11
(10,384 Views)

Thank you for your reply

 

But, the thing is that because of the spikes -which can be more that 5 volts- we decided to use analog inputs in the DAQ device, we were afraid that the spikes might damage the DAQ device.

So using this analog inputs, is your solution also applicable?

 

-Just a student-
0 Kudos
Message 3 of 11
(10,362 Views)
Labview 7.1 has many filter VIs that you can use, you don't need to install other toolkit. You can find them on filters pallette. For example, "Butterworth Filter.vi" should work for you.
0 Kudos
Message 4 of 11
(10,361 Views)

i don't see any filter pallete in my labview. Add ons perhaps?? I tried to find it "ctrl+F : filter" the result is nothing

 

regards

Nandha

-Just a student-
0 Kudos
Message 5 of 11
(10,359 Views)

It is possible your hardware has som filter inside, look for jitter correction.

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 6 of 11
(10,338 Views)

Before you implement a filter in software you can do much at the hardware side.

1) Run separate cables from the power supply to your motor/motor controller. A motor draw some current so use adequate cable width

2) Place small capacitors in parallel with the motor windings. Solder them at the motor terminals. They should be placed as close to the motor as possible

3) Run a shielded twisted pair cable from your micro-switch to your daq unit. Ground the shield only at one side.

4) Lower your input impedance for the micro switch input channel. Place a say 2K resistor from your input channel to ground. Do this at your daq unit screw terminals. If you have a 5 volt signal this will draw 2.5mA. It should be OK.

  5) Place a simple 1 order filter at the input terminal. Choose the cut off frequency  as low as possible. But not so low that it destroy your signal. Here you must do some testing. I guess a cut off frequency equal to 5 to 10 times your sample rate should be OK.  

You may also try to increase the sample rate, and do some averaging. As an example if you sample with 1KHz, increase your sample rate to 10Khz. Then down sample your data by averaging every 10 sample. 

You should at least implement 1,2, and 3. But also try 4, and 5. Combine them, or chose on of them.

I could talk about this for a long time, but I choose to stop here 😉

Good luck



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
Message 7 of 11
(10,325 Views)
Solution
Accepted by topic author Nandha

Though all suggestions are meaningful

But solution has not been achieved. So actually, we tried to change from analog input to digital input in our DAQ device. Hopefully the -up-to-10V-spike will not spoil our DAQ device. And it turned out OK. In the digital input, the spikes has not appeard even once, and we consider it done.

 

@ t06afre: thanks for the hardware set up suggestion, but since this is a testbox that we are dealing with, its not gonna be easy to put capacitors in the motors and unlikely considered to be done. The twisted pair cable is not a bad idea though.

 

We thought that software filter solution would be the best (less time needed and less messy) but its not like we have not thought of using hardware filter (R-C circuit, duuh).

And about the "minimum pulse width" setting, isn't only applicable for some DAQ device? CMIIW

-Just a student-
0 Kudos
Message 8 of 11
(10,288 Views)

The attached figure shows how to access to the filter pallette in LV71

 

0 Kudos
Message 9 of 11
(10,230 Views)
sorry man, but this is what i have in mine (please refer to the attachment)
-Just a student-
0 Kudos
Message 10 of 11
(10,217 Views)