LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Record time when boolean condition is true

Is it possible to record the time when a boolean expression is true, i.e if an =0 condition was placed on an AC signal, would it be possible to record the times when the wave crossed 0.

I expected this part of my overall problem the easiest, but im simply not getting anywhere

Thanks

0 Kudos
Message 1 of 7
(2,707 Views)
Your question can be interpreted in a few ways.
 
  • Are you monitoring a realtime signal and want to record the exact time of day everytime the signal crosses zero?
  • Do you have a recorded signal and want to find the zero-crossings?

Be aware that a discretely sampled AC signal will probably never be exactly zero, so the true zero-crossing is most likely between data points. If you do a "=0", you'll never get a match.

Fortunately, LabVIEW has all the tools you possibly need to do what you want. If you could give us a bit more detail on your exact scenario, we can come up with a suitable solution.

 

Some ideas:

  1. Monitor when the sign of the signal changes.
  2. Use e.g. "zero crossing ptbypt"
  3. Use interpolate array
  4. ...
0 Kudos
Message 2 of 7
(2,695 Views)

Thanks for looking at my problem,

The real problem is to do with an engine crank sensor (Variable reluctance). When the sensor is placed on a toothed wheel (12 - 3 teeth), the sensor produces a sinusoidal like wave, with a gap 25% of the time. Teeth can be found on the wave as V=0 and dv/dt<0. The gap will then be used as  a ref point.

My eventual intentions are to monitor the signal from the engine and calculate the angle of the shaft by looking at gap times between wave cycles. Before i use the real sensor i intend to fully simulate everything.

I now have an approximate simulation of the crank signal. i have attatched it.

I expected the =0 part not to work for the reason you stated but was unsure how to get around that. So, I thought i would produce a square wave first when dv/dt<0 and when -0.1<v<0.1. I was then hoping there would be a rising edge trigger tool that could give me times of these rising edges of the square wave so that i could record them in a table, but i cant find/think of a way to do this.

After i have a way of doing this i will compare gaps between teeth to find the ref tooth. After it is found i will increment a tooth counter everytime a tooth passes, and from there estimate angle of crankshaft.

As for how many teeth times need to recorded, i think 3 only. The last three teeth passing the sesnor will allow me to find 2 gaps bewteen teeth times which will allow me to find the wheels gap. I can use times between teeth to estimate a time per degree figure which is then used to increment an angle counter.
 
Any help is much appreciated i know there will be an easyish way of doing this, i just cant find it.
 
 
 
 
0 Kudos
Message 3 of 7
(2,692 Views)
I think you would be better off to put an encoder on the crankshaft. Use the encoder quadrature signal as the external clock reference. Then your hardware can sample data based on crankshaft pulses. If you use time between pulses, what happens if the rotation speed is not constant. I used this type of setup to measure cam lobe timing to less than .1 degree resolution.
0 Kudos
Message 4 of 7
(2,664 Views)
What is the output of the quadrature encoder? I thought it was just a square wave, which i have already coverted it to.
Message 5 of 7
(2,637 Views)
Yes it is just a square wave, but it is based on physical movement of the crankshaft. To convert the quadrature signals to a single pulsetrain, use a US DIGITAL LS7083 or LS7084 IC chip. This is an encoder to counter converter chip. When you make this square wave your clock reference, variation in rotation speed and time delays are not captured in the data. Each datapoint is captured at a clock pulse.  You can pause during rotation then start again and the data will be continuous. If you use a timebase to measure your signals, any pauses can stretch your signals. I guess it depends on what kind of resolution you want. 5 degrees, 2-3 degrees, less than a degree.
0 Kudos
Message 6 of 7
(2,632 Views)
This technique would require modification of the engine case to accomodate an extra sensor 90degrees from the other sensor. This would not be an option as the engine would have to be unmodified so im stuck with a Variable reluctance sensor, unfortunately.
0 Kudos
Message 7 of 7
(2,628 Views)