04-23-2018 08:12 AM
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?
Solved! Go to Solution.
04-23-2018 08:24 AM
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
04-23-2018 08:25 AM
04-24-2018 01:47 AM - edited 04-24-2018 01:49 AM
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).
04-24-2018 01:53 AM
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"…
04-24-2018 02:35 AM - edited 04-24-2018 02:36 AM
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.
04-24-2018 02:44 AM
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!
04-24-2018 03:12 AM - edited 04-24-2018 03:15 AM
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
04-24-2018 03:33 AM
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"!
04-24-2018 03:41 AM
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.