10-31-2024 03:25 AM
I am trying to detect when the output of my reading overshoots, drops back and then rises again.
example
I have tried performing a differentiation and detecting the peaks, the expectation was that a bad curve (top graph) would show 2 peaks, which is what I got. However when running the good curve (bottom graph) through the same routine it found 5. I had to set the threshold low in the Peak Detector.vi to make it work for the first example but obviously this was too low for the good example.
I am thinking that this approach is not the correct one.
I think I need to detect that the curve is always rising in the first 50 samples (in the above the sample rate is every 0.5 seconds) There are so many curve fit Vis and it is above my ability level to know which one to use to achieve what I want.
Can any of you guys point me in the right direction please?
Solved! Go to Solution.
10-31-2024 04:55 AM
Hi Ian,
@IanLloyd wrote:
I had to set the threshold low in the Peak Detector.vi to make it work for the first example but obviously this was too low for the good example.
I am thinking that this approach is not the correct one.
The approach might be ok, but (maybe) you need to adjust the parameters…
@IanLloyd wrote:
Can any of you guys point me in the right direction please?
Well, if you would provide some code with typical data embedded in controls we could help you even better…
(Please downconvert to LV2019 if you use a recent LabVIEW version.)
10-31-2024 05:25 AM
Thanks for your reply
I have attached the code. It is just something I have been throwing bits at to try and get a result.
In the data 0 to 7 in the curve selector are bad data, anything above that is good data.
Any help is appreciated.
Could something as simple as using a loop and shift registers to compare against the previous reading get me what I want?
10-31-2024 08:16 AM
Hi
The overshoot of your original curve occurs when the differential curve changes from positive to negative, not on the peak.
The peak of the diferential curve gives the point where the original curve has the max increase (the angle of the linear curve that touches your original signal0.
10-31-2024 08:32 AM
Thank you very much.
All I need to do is find a value below zero!
I have tried it out on my data and it all makes sense.
Just need to make my code production ready now.
10-31-2024 09:06 AM
I went after it a slightly different way. I look for dips in the data. It works with the two data sets you provided.
10-31-2024 10:13 AM
Thank you for taking the time to produce a solution.
I can see benefits but I think I will implement the first solution.