LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Output chopped signal from thermopile sensor and chopper squarewave.

Hello everone,

 

I am using NI uSB-9162 for data acquistion from my thermopile sensor which is placed next to a optical chopper. I am using two channels in the NI-USB, one is the acquistion of data from thermopile sensor and other is the signal of optical chopper (Amplitude 5V).

I am showing both of these signal on XY graph. What I want to show on graph is when the signal from chopper gets to an amplitude of 2.5 V the data acquistion of output signal from the thermopile starts. 

Another thing that I want to know is how can I know the time delay between these two signals.

Thank you ! 

0 Kudos
Message 1 of 10
(626 Views)

Hi Yum,

 


@Pukhtun_Yum wrote:

I am showing both of these signal on XY graph. What I want to show on graph is when the signal from chopper gets to an amplitude of 2.5 V the data acquistion of output signal from the thermopile starts. 

Another thing that I want to know is how can I know the time delay between these two signals.


This becomes very easy as soon as you use a "normal" waveform graph to show both plots/signals instead of a XY graph!

 

  1. You should measure both signals all the time, but only use/analyze the data of the thermopile when the optical chopper gives a HIGH signal…
  2. To determine the time delay between both signals you can look at them in the waveform graph: have the plots start when the chopper changes from LOW to HIGH…
Best regards,
GerdW


using LV2020 on Win8.1+cRIO
0 Kudos
Message 2 of 10
(617 Views)

Both of these signals are taken as a 1d array. From the square wave array I get very low and very high numbers but what i need is as soon as a rising edge appears and gets to 2.5V I want to extract from exactly that point the output signal from the thermopile. 

I have used XY graph and I am not familiar with how would I do it this in waveform graph

0 Kudos
Message 3 of 10
(588 Views)

Hi Yum,

 


@Pukhtun_Yum wrote:

I have used XY graph and I am not familiar with how would I do it this in waveform graph


The context help of the waveform graph (terminal) shows how you can wire the data…

 

Mind to attach your VI with some measurement data in it?

(Run the VI until data is displayed in the graph. Then stop the VI and select Edit->set current values as default. Then save the VI and attach it here!)

 


@Pukhtun_Yum wrote:

From the square wave array I get very low and very high numbers but what i need is as soon as a rising edge appears and gets to 2.5V I want to extract from exactly that point the output signal from the thermopile.


Use a comparison function to convert your array of voltage values into a boolean array. Now search for the first TRUE value and use its index to get a subset of the measurement data of the thermopile…

(Again: attach your VI with embedded measurement data!)

Best regards,
GerdW


using LV2020 on Win8.1+cRIO
0 Kudos
Message 4 of 10
(584 Views)

If i search for the first true value it could be that the first high value is from the mid high and the output signal will not be as desired. Secondly, I want to display the graph in such a way that it starts from zero and the first attained outout data should start from the 2.5 V of the square signal.

similarly as you can see in the graph, there is a phase difference between it, how would i calculate the phase difference between it as i will increase and decrease the optical chopper frequency 

Download All
0 Kudos
Message 5 of 10
(573 Views)

Hi Yum,

 

your VI could be so much simpler:

GerdW_0-1597752730663.png

Use a wavefrom graph when you want to display waveform data.

XY graphs are intended for data with Y vs. X relationships!

 


@Pukhtun_Yum wrote:

If i search for the first true value it could be that the first high value is from the mid high and the output signal will not be as desired.


What is a "mid high"?

You wrote you are looking for the 2.5V amplitude of the chopper signal as an indication for data analysis. Now you claim it "might not be as desired"!? Please write down clear definitions of what you would like to achieve!

 


@Pukhtun_Yum wrote:

Secondly, I want to display the graph in such a way that it starts from zero and the first attained outout data should start from the 2.5 V of the square signal.


Something like this?

GerdW_1-1597753231744.png

WaveformGraph2 shows that part of plot 0 where plot1 is the first time ">2.5"…

 


@Pukhtun_Yum wrote:

how would i calculate the phase difference between it as i will increase and decrease the optical chopper frequency 


The "phase difference" is the time delay between two signals. The time delay is simply the number of samples divided by the sample rate…

 

Btw. your DAQAssistent should be set to ContinuousAcquisition…

Best regards,
GerdW


using LV2020 on Win8.1+cRIO
0 Kudos
Message 6 of 10
(561 Views)

First of all thank you man for your time.

I clearly understood what you did in the image but the  problem is if I start run there can be a possibility that the falling edge value is being taken and searched for the value of 2.5 which i do not want to display. My task is to display the graph starting from the rising edge value and not the falling edge. The data acquistion is constantly happening and i never know whether rising edge or falling edge will come first.

I have attached the image of whats not right 

0 Kudos
Message 7 of 10
(555 Views)

Hi Yum,

 

I just sketched the basic principle, you need to implement a little bit more logic!

 

In your last image my search routine still works, but finds only the first 17 samples in your signal because of its simplicity.

You can easily expand the scheme into looking for rising edges, falling edges, an expected minium length of the chopper HIGH signal, …

Best regards,
GerdW


using LV2020 on Win8.1+cRIO
0 Kudos
Message 8 of 10
(551 Views)

Can you just pass me the hint on how would i know if at the start of iteration there is rising or falling edge ?

0 Kudos
Message 9 of 10
(548 Views)

Hi Yum,

 


@Pukhtun_Yum wrote:

how would i know if … there is rising or falling edge ?


You just look at the boolean array after the comparison: a FALSE-TRUE change is considered rising edge, a TRUE-FALSE transition a falling edge. In your case you need to take care of the state of the very first sample to get no wrong detection…

 

(In my example I only look for TRUE/FALSE because I expected/simplified the signal to start with a LOW/FALSE value. You need to look for real edges: like find the first FALSE, then find the first TRUE to detect a rising edge…)

Best regards,
GerdW


using LV2020 on Win8.1+cRIO
0 Kudos
Message 10 of 10
(523 Views)