LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Chatter Detection with Peak and Threshold Analysis

I am sampling waveform data and detecting using Basic Level Trigger Detection the falling slope and the rising slope. Currently, the only way I have found to do this is by Falling Peak detection and then again do the Rising Peak detection for an Energized channel. I first sample the Falling Peaks and write out an Array of Indices and then again I do it over for the Rising Peak Indices and then I evaluate those two arrays to see if the Detector Width between the indices is large enough to meet the specified criteria.


I have encountered an array of random errors from Not enough memory and locking up LabVIEW using full Datasets with multiple waveforms, Also, Error -1801 Duration Input is not an integer multiple of dt. I have also found that it doesn't properly evaluate all peaks and some times misses a rising edge which may mean it also misses a falling edge. I have attached screenshots of the issues... If anyone can help me I would greatly appreciate it.

 

I have attached my sample code and a sample of Chatter in TDMS.

I'm evaluating a 24v waveform for any drop in voltage greater than 50% ie 12v and a Duration longer than 2ms.

I have tried the Threshold Detector.vi  but it was only able to pick up on the rising peaks. Is there a better solution to my current problem?

I'm hoping I've overlooked a basic vi that can simplify this task.

 

My end goal is to have a vi parse through multiple channels and automatically label and generate plots of all instances that meet the Criteria specified for chatter. I already have the Parsing, Labeling and Printing to report functions working but the data process section attached is very questionable at best...

 

Thanks in advance,


Billy G. Alexander

 

 

Chatter detection.PNGError.PNGMissed Trigger 2.PNGMissed Trigger 3.PNGMissed Trigger 4.PNGMissed Trigger 5.PNGMissed Trigger.PNG

 

 

0 Kudos
Message 1 of 9
(220 Views)

Thank you for attaching your code, and thank you (even more) for attaching a sample TDMS file.  When I look at the data, I see data at around 24 (volts?) that has "noise" with an amplitude of less than 0.1 throughout the duration.  However, there is a block of "something" that at the default magnification looks like a "solid block of white" going from about 24.4 to 0.  If you examine this block (which I assume you are calling "Chatter", but I'm uncertain how you define this term), it consists of samples solidly at 0 mixed with small sections near 24 and occasional sections well above 24.

 

It seems to me that with these data, a simple way to detect large deviations from the mean (trivial to see by eye) is to ... compute the mean, compute the standard deviation (from the mean), and look where the data "deviates".  The problem, of course, is your particular data set will have a very biased mean, being dragged down by all the "chatter".  You can clean this up by doing a simple "pre-clipping" operation, something like this:

  • Compute Mean and SD.
  • Make a "clipped Waveform" consisting of your original Waveform with values constrained to "mean ± 1 SD".  In your example, the mean "signal" is clearly 24, but the mean of the data is 23.11 (because of all the Chatter), while the SD is 4.6.
  • Repeat the above steps as needed to get a stable mean.
  • Decide when Chatter starts and stop by when the signal deviates from the mean by more than some criterion based on one of the SD values. 

In your particular case, the Chatter seems to be mostly "one-sided", sometimes going a little about 24, but on the negative side, going down to near 0.  Where does this type of "noise" originates, and can you eliminate it "at the source"?Chatter.pngChatter

Bob Schor 

Message 2 of 9
(176 Views)

I was somewhat bemused to see the Threshold Detector VI only allows (seemingly) a positive threshold (i.e. crossing from below), but you could consider negating all of your values then searching for crossings of -12V?

 

An alternative might be to put your input array into a "Less than" node with 12 wired as y, then Search 1D Array (or similar) for the first True value.

GCentral
Message 3 of 9
(162 Views)

Bob, 

Thank you for looking at this, I'll give the background on what we're looking at here. In most instances we are monitoring multiple channels of dry contacts in the N.C. and N.O. configuration with the +Supply on the common, I'm sampling at around 5000 samples per second. some times we sample to 10000 samples per second. the contacts are then subjected to a Design Basis Event on a Triaxial Seismic Table and the Criteria set forth by IEEE is that a deviation from the supply voltage greater than 50% and 2ms in duration constitutes chatter. If you zoom into the large white blocks you will see discontinuity which is what we're actually evaluating.

 

chatter and missed Trigger.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I actually determine the average in a separate vi that I use to specify programmatically the 50% Threshold Value to set. So I use in this example 23.11 Volts as my Threshold as you said. I also have a use case where I'm monitoring N.O. channels where the mean would be roughly 0v and only in and instance of Contact bounce IE Chatter would the value spike upwards. This also led to the primary reason for using Basic Level Trigger Detection sub vi where I could detect on rising and falling deviations. I need to indicate the exact first point below and above the establish Threshold value as my exact cursor index. however, It isn't always working as expected if you look at some of my original photos, and even the photo above shows it combined two instances the falling on one and misses the rising and picks up the next chatter instance rising. It randomly misses a drop in certain instances and I don't understand why. I am wondering if this is a buffering or indexing issue maybe?

 

Mean.PNG

 

 

 

 

 

 

 

Right now I'm writing out the Indicies to the falling and rising points in order to specifically set the 0 and 1 Cursor location so I can also programmatically index, count and quantify each instance of chatter and print each separate waveform to a pdf report. 

 

Here you see the VI I found (Not Mine) and modified slightly for indexing waveforms through the Basic Level Trigger Detection.vi  The original specified the For Loop would do 1000 Iterations... I've tried specifying different values higher and lower with no change in the missed Threshold and would occasionally get the dt errors and out of memory errors. This is currently my largest issue, I may have to fundamentally try another method or explain why I'm missing this.

basic level trigger detector.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

At your direction, I will calculate the Standard Deviation and see if I'm able to determine a different approach to identify the correct indices.

Billy

 

 

 

 

0 Kudos
Message 4 of 9
(153 Views)

Yes,

I was left feeling there must be a separate vi somewhere, I looked high and low, I have issues with the NI Website whereas theirs broken search engine links and trouble even looking up Labview Addon products that potentially could do exactly what I'm looking for. I have the Advanced Signal Toolkit and the Sound and Vibration addon but when I went looking via the new website it was almost impossible for me to look for other addons...

I digress...

 

I really have my fingers crossed theirs a LabVIEW primitive or VI that will handle this specific issue but it appears not.

0 Kudos
Message 5 of 9
(142 Views)

@StRyKeReYe wrote:

Yes,

I was left feeling there must be a separate vi somewhere, I looked high and low, I have issues with the NI Website whereas theirs broken search engine links and trouble even looking up Labview Addon products that potentially could do exactly what I'm looking for. I have the Advanced Signal Toolkit and the Sound and Vibration addon but when I went looking via the new website it was almost impossible for me to look for other addons...

I digress...

 

I really have my fingers crossed theirs a LabVIEW primitive or VI that will handle this specific issue but it appears not.


 


@StRyKeReYe wrote:

I am sampling waveform data and detecting using Basic Level Trigger Detection the falling slope and the rising slope. Currently, the only way I have found to do this is by Falling Peak detection and then again do the Rising Peak detection for an Energized channel. [...]


There exits this Trigger and Gate Express VI

Start sense—Specifies on what edge of the signal to start taking samples. The options are Rising edge, Rising or Falling edge, or Falling edge. This option is available only when you select Threshold.

 

It's a actually a .llb which itself is located at

"..\National Instruments\LabVIEW 2019\vi.lib\express\express signal manip\TriggerBlock.llb"

 

 

Message 6 of 9
(122 Views)

Alex I actually saw the Trigger and Gate Express VI awhile back but dismissed it early on.  I was cautioned that using the Express Vi would utilize more resources and be slower in the long run in the past. I need to look at it a little closer from what I can tell this looks for a single instance and would have to run multiple iterations with the found index and would require indexing from the boolean logic and I would have to create my own array of indices.

 

I did a quick attempt to make a discrete vi from the express module. I right-clicked on the express VI and selected "Open Front Panel" you'll get a dialog box asking if you want to convert it to a standard VI then I waded into the sub vi components. thank you for giving me an alternative base of coding to consider and possibly build on the functionality I need.

 

 

 

Express Vi.PNG

0 Kudos
Message 7 of 9
(94 Views)

 


@StRyKeReYe wrote:

thank you for giving me an alternative base of coding to consider and possibly build on the functionality I need.


 

the help states:

This Express VI operates similarly to the following VIs and functions:

Basic Level Trigger Detection

maybe you should stick with your original idea from the first post.

 

 


@StRyKeReYe wrote:

 I actually saw the Trigger and Gate Express VI awhile back but dismissed it early on. I was cautioned that using the Express Vi would utilize more resources and be slower in the long run in the past.

I need to look at it a little closer from what I can tell this looks for a single instance and would have to run multiple iterations with the found index and would require indexing from the boolean logic and I would have to create my own array of indices.

I suppose, you are right about that

I further assume the core of the "Trigger and Gate" express.vi is quite similar to

http://zone.ni.com/reference/en-XX/help/371361R-01/ptbypt/boolean_crossing_ptbypt/



 

Message 8 of 9
(84 Views)

my suggestions

1# do this for the file input...

0_path.PNG

 

2# do a statistical approach as Bob suggested

for the .tdms file attached, I'd do it like this....

empirical_statistic.PNG

 

 

 

 

 

be carefull! this gets all instance, you need to further filter the {low;high} pairs according to your criterias (Amplitude>12V, Duration >= 2 ms)

I haven't look into §RemoveNonChatter1d.vi"

 

e.g. index 426 (width= 4 | max = 24,0333 ; min = 0,01)

e.g. index 396 (width 4 | max = 24,0358 ; min = 20,8108)

 

attached as LabView 2010

0 Kudos
Message 9 of 9
(61 Views)