LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

acqusitioning signal from sonar sensor and filtering

Hi
I am using sonar sensor to caclulate the distance and velocity of my robot vehicle. If I look at signal in Ocope for distance measurement I have two signal(see attachment) one shorter pulse width which is command from host controller to sonar sensor to emit burst this shorter pulse is like 2 micro second and then when the echo returns I have larger pulse this pulse width depends upon the ditabce from the object--larger pulse width is from 115 microsecond to 18.5 millisec. Since I want to calculate the velocity of my robot I need only larger pulse width and if I take difference of two consecutive larger pulses it will give me the velocity.
but in present case I get pulse width of two consecutive as one larger and one smaller every time. My question is how can I filter or reject shorter pulse from my calculation.


see my attachments for Oscope which is exactly what the signal should look like. But the signal which I am capturing in Vi is all edgy how can I take good signal in Vi and how can I get pulse width for only echo that I receive in sonar and not shorter pulse in order to calculate further my velocity and stuff.

thanks
0 Kudos
Message 1 of 4
(2,343 Views)
Salutations,

Labview offers some solid products in "Analyze" -> "Signal Processing"

If i understand you right, you get two pulses, so these would seem like peaks on an amplitude time plot. You could set up a threshold to ignore values below a certain number. Hence, eliminating the "shorter" pulse. Then you'd only have the large pulses to look at and you can calculate your distances and then velocities.


If your signal is all "edgy" you might want to try a filter for the data. Now, there are a lot of fancy filters out there, labview provides a few good ones (same kind of area as previous information).

Make sure you read up on signal processing a bit before you go nuts and get things all messed up.

Sincerely,
ElSmitho
0 Kudos
Message 2 of 4
(2,327 Views)
Hi
I captured the signal in Vi that came with NI examples cont acq & graph voltage-int clk.vi . I mentioned earlier since sonar sensor emits small ping and then larger pulse tells you about the distance larger the pulse farther the distance ideally speaking I must see one small pulse and one larger pulse but I can see the larger pulse but instead of small I am looking at some noise or distortion. so pattern I am getting is large pulse and then distortion , larger pulse then distortion and so on. If I am able to remove that noise the larger pulse width is my distance which I want further for my calculation. Look at the attachments.
What do you suggest?
My Vi was same as I posted only I have attached graphic indicator more in the Vi.
Due to this recurrent distortion I get some wrong constant data and number alternatively which makest my delta X i.e dstance same

for example distortion every times give me 0.17 distance so if disance is like 20 cm my display will work like 20--0.17---21---0.17--22---0.17 so if I take deltax that is difference between twoconsecutive distance change which should be like difference between 22-21=1 it actually becomes 22-0.17=20.93 and next time it calculates 0.17-23=-22.83 which becomes wrong.

If I remove this distortion or tell my Vi not to read below certain votages--- how can I do that.
Since you mentioned increase the thresh hold how we do that and how to remove this distortion just see my captures of the signal.
Thanks
0 Kudos
Message 3 of 4
(2,317 Views)
Salutations,

Thresholds, more or less you say... is data number greater than chosen number? True - use data number, False - do not use data number.

that would be a way of setting up a minimum thresholds.

As far as filtering goes, there are a few ways you could go about it...

I'd suggest starting by looking at on your block diagram, pull up the menu possibilities and go to "Analyze" --> "Waveform Conditioning" --> Filter

It'll give you filter and window options, sooner or later you'll get an idea of what you're looking at. I'm sure LabView help will also provide a lot of information, it has for me in the past. So give it a look around, and see what you can do..

By setting up a low pass filter (threshold..) you can eliminate those .17 values or whatever they were... and just keep around the
20, 21, 22, etc....

Sincerely,
ElSmitho
0 Kudos
Message 4 of 4
(2,314 Views)