LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scaling a signal

Solved!
Go to solution

Hello.

 

I used derivative of the distance to get the speed but the graph is kinda wavey. You can still see the speed but its not as nice as i would expect. So can anyone tell me what to do to remove those jumping points and that i could draw more compressed graph that would have a shape of a line? 

0 Kudos
Message 1 of 12
(3,012 Views)

Taking a derivative emphasizes the high frequencies (often "noise") in a signal.  The not-quite-opposite, forming an average, emphasizes the low frequencies (getting rid of noise).

 

So one way to get a "smoother" rate signal is to use a "running average" -- take the average of the first 11 points (0..10), the average of points 1-11, 2-12, 3-13, etc.  Now you run into a slightly different problem -- your average is centered around the middle point (i.e. 5, 6, 7) and will stop width/2 points from the end.  There are techniques for dealing with this, beyond the scope of this short note ...

 

Bob Schor

Message 2 of 12
(3,007 Views)

Hi JeeaaN,

 

do some filtering of your signal (keywords are Median, Mean, LowPass, …)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 12
(3,006 Views)

Thanks to both of you for your answers. I am not very experienced with LabView so the averaging method is abit too complex for me. Have tried the Median filter and it sorts the problem at the start but when i continuously run the program for some time at a constant speed the noise is comming back (pinned image).

0 Kudos
Message 4 of 12
(2,968 Views)

Hi JeeaaN,

 

I am not very experienced with LabView so the averaging method is abit too complex for me.

It's "too complex" to use some ready-to-use functions coming with LabVIEW? Really?

What kind of engineer are you (or do you want to be)?

 

the noise is comming back

Well, then there is a problem in your VI or there is a problem with your signal.

As you didn't attach the VI so far we cannot help you with this "problem"…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 12
(2,964 Views)

Sorry, maybe i didnt understand your suggestion directly. I saw the ready to use Average VI but i dont know how to do it that it uses 10 points and makes an average and another 10 and so on. I saw that option  with Median VI but didnt understand you so i was trying with Average VI. 

I can attach my VI (wont) but it wont help you since i am running FPGA program on myRIO, another VI on PC and getting the data from encoders through myRIO to my PC and than plotting. I am experienced on other types of programs like Beckhoffs Real Time Modules or Matlab but my company wants LabView which has a different logic of programming to what i am used too so when you are learning something from the start its abit hard to understand every detail, especially in labview which is abit dodgy in my opinion but what can i do.

 

Best regards.

0 Kudos
Message 6 of 12
(2,961 Views)

Hi JeeaaN,

 

I can attach my VI (wont) but it wont help you since i am running FPGA program on myRIO, another VI on PC and getting the data from encoders through myRIO to my PC and than plotting.

Surely it would help us to see your code! I hope you keep your project within one folder, so it would be easiest to ZIP the folder with all files needed…

 

i dont know how to do it that it uses 10 points and makes an average and another 10 and so on.

See the Point-by-Point functions in the signal analysis palette! (I often abbreviate them with "PtByPt"…)

 

LabView which has a different logic of programming to what i am used too so when you are learning something from the start its abit hard to understand every detail,

LabVIEW uses DATAFLOW…

There are a lot links to learning topics in the header of the LabVIEW board!

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 12
(2,955 Views)

Here is the ZIP of the whole folder and all programs, FPGA (FPGA Main My) and Real time (RT Main My). The problem is with graph Speed Derivative. 

 

I tried with Median Filter using Left/Right flank on 50 and the signal is getting smoother but after long operation its starting to get uglier.

EDIT: It doesnt let me post a RAR file so i attached both VIs. Hope its enough

Download All
0 Kudos
Message 8 of 12
(2,951 Views)

Hi JeeaaN,

 

Here is the ZIP

It doesnt let me post a RAR file

Do you spot the problem?

 

Hope its enough

With RT and FPGA projects the lvproj file is really needed to get the full picture!

 

Some thoughts on your VIs:

- Way too much local variables! You are producing a lot of race conditions! Use wire and THINK DATAFLOW!

- I don't see any Mean or Median function in your (RT) VI…

- Try the PtByPt functions to get a "running mean" or "running median"!

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 12
(2,944 Views)

Well, didnt think there would be a problem with the website uploading a .rar or .zip

 

THe median is in RT Main My at the bottom where i am plotting Speed Derivative. 

Download All
0 Kudos
Message 10 of 12
(2,941 Views)