LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Zero Crossing issue

Have a zero crossover vi and can't seem to capture the actual zero crossover when positive going negative.  It doesn't capture the zero value it captures the next value. I just can't seem to find out why. Please find the attached vi along with a small text file for use with the vi. 

 

Thanks for any help you can provide......

Have a good weekend.

 

DG

0 Kudos
Message 1 of 4
(2,493 Views)

Way too much code!

0 Kudos
Message 2 of 4
(2,474 Views)

First of all, you seem to have duplicate X values, so that will complicate things. Can you save the file with higher resolution?

 

All you need to do is a linear interpolation to get the zero crossing.

0 Kudos
Message 3 of 4
(2,464 Views)

It may not be exactly what you want but Threshold 1D Array seems to be close.  Because it only looks for crossings of the threshold in the positive direction, you need to negate the array after each crossing is found if you want to find crossings in both directions.  It also tends to define the last element as a crossing, so I deleted that.  Read the detailed help file for more information about how the function works.

 

This will not be memory efficient for large arrays because it makes a copy for the negated array. If the threshold is ever made something other than zero, the negation needs to be changed to a reflection around the threshold.

 

Lynn

0 Kudos
Message 4 of 4
(2,455 Views)