02-17-2020 01:57 AM - edited 02-17-2020 02:07 AM
Hi everyone,
I'm new in this forum and I'm a mechatronic engineer. I'm currently working on a project:
given a set of points acquired from a continuous waveform (NI9205 module), I need to find programmatically two points per period (point 1 and 2 in photo). The waveform is acquired from a diode switching ON and OFF periodically.
The points I need to find are the one in the image (1 and 2):
Attached there the zip file containing my VI (some constants will depends on sampling frequency and ON/OFF timings) and the data to be analyzed.
I appreciate any kind of help.
Regards,
GP
02-17-2020 02:26 AM - edited 02-17-2020 02:37 AM
Hi Gio,
calculate the derivation of the voltage waveform, then check for larger steps in the derived signal…
Unfortunately you forgot to mention the noise in your signal, making it harder to use a simple derivation:
Apply a filter on your noisy signal…
Also you should define the difference between points 2 and 3 (or clearly define how to detect them):
Which index is point 2 and which index is point 3?
One more idea: to get rid of the noise filtering you might simply use a threshold detector: whenever the signal crosses above/below the 0.70 threshold you are very near to one of your points 1, 2, or 3…
02-17-2020 02:33 AM - edited 02-17-2020 02:36 AM
Thank you for you kind and fast reply.
I don't know if you have a look at my VI but this is basically what I'm doing. I applied a 3rd order filter and the waveform became smooth. The I apply the derivative. The problem is that I can find the first point because I have an inversion of the derivative but I cannot find the second point because there is just a slope change in the derivative.
Any other suggestions?
GP
02-17-2020 02:40 AM
Hi Gio,
@Gio1993 wrote:
I don't know if you have a look at my VI but …
Any other suggestions?
Right now I'm stuck to LV2017 so I cannot look at your VI.
For suggestions see my edited post above…
02-17-2020 02:52 AM
Thank you again.
Find the index of points I'm searching for would solve my problem.
There is no problem with filtering, as I said, I can obtain a quite smooth waveform using the filter vi.
Points I'm interested are 1 and 2 in picture from 1st post. There is no need of threshold because I can use sampling time from the DAQ and the ON OFF times in order to detect the range of data points to search for my point.
I'll explain in a better way:
If my DAQ acquires at 1 kHz and the diode stays ON for 2 minute and OFF for 2 minutes, then I know that my 1st point will be around the 120000th sample and the second around the 240000th sample.
A simple routine to detect whenever first identified point is the 1st or the 2nd I'm searching for has been implemented in the proposed VI.
02-17-2020 05:46 AM
Hi Gio,
@Gio1993 wrote:
If my DAQ acquires at 1 kHz and the diode stays ON for 2 minute and OFF for 2 minutes, then I know that my 1st point will be around the 120000th sample and the second around the 240000th sample.
A simple routine to detect whenever first identified point is the 1st or the 2nd I'm searching for has been implemented in the proposed VI.
Then use the threshold approach:
IF sample(t-1) < threshold AND sample(t) >= threshold THEN ON
IF sample(t-1) >= threshold AND sample(t) < threshold THEN OFF
02-18-2020 02:41 AM
Thank you for the proposed approach but the threshold solution is not the best in my opinion.
I think that the best way to solve my problem is to use an approach that works on waveform pattern:
the threshold may be varying and the wave form will be always the same (independently from wave values).
I've been working and now I'm able to find point 1 and 3 from first post pic.
It remains only the routine to identify precisely the 2nd point, the one that has no derivative sign inversion. Do you think the only possible solution is to use a threshold? What about such threshold depending on sampling frequency? How do you solve such dependency?
Regards,
GP
02-18-2020 03:24 AM
@Gio1993 ha scritto:
It remains only the routine to identify precisely the 2nd point, the one that has no derivative sign inversion. Do you think the only possible solution is to use a threshold? What about such threshold depending on sampling frequency? How do you solve such dependency?
Regards,
GP
If you solved the other points by derivative analysis cannot you investigate on higher degree derivations (I don't know English terminology, I'm sorry). Try to analyse the derivation of the derivation and so on until you cannot detect you interesting points
02-18-2020 05:16 AM
Here is my try 😉
remove mean, detect zero crossings , slice the wfrm, fit a polynom (migth be better ones) , get the endpoints
02-26-2020 06:51 AM
Sorry if I took so much time to answer but I used this time to understand the last VI idea. It apparently solved my problem and it works on different datasets with same wave pattern. The only thing I don't understand is why sometimes the VI misses points. Thank you very much for your effort, it was a really good starting point.
Regards.