01-15-2009 07:55 PM
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
Solved! Go to Solution.
01-15-2009 08:25 PM
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
01-16-2009 01:22 AM
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?
01-16-2009 01:25 AM
01-16-2009 01:38 AM
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
01-16-2009 04:04 AM
It is possible your hardware has som filter inside, look for jitter correction.
Ton
01-16-2009 07:03 AM
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

01-18-2009 09:05 PM
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
01-21-2009 11:48 PM
The attached figure shows how to access to the filter pallette in LV71
01-22-2009 02:18 AM