Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Detect when square wave becomes triangular wave (slew rate)

Hi,
 
I have an op amp circuit built on the NI ELVIS board and I input a square wave from function generator to the circuit. I have to determine the slew rate of the op amp. In the labs, one would run the square wave over a range of frequencies and stop when the square wave looks like a triangular wave. At that frequency, one would then measure the slope of the signal and that will give you the slew rate. How can I do that in LabVIEW? How can I check when my square wave starts looking like a triangular wave? Currently I am using Analog Input vi's to capture my waveform data and display it on the waveform graph (Measurement I/O -> Data Acquisition -> Analog Input). Please help, this is urgent.
 
Thanks.
 
ntfan.
0 Kudos
Message 1 of 5
(11,060 Views)
Hi ntfan,

This should be a very simple application. In the NI ELVIS help there is an example which shows how to setup a continuous function generator with your ELVIS in LabVIEW. You can see that in the help at

NI Elvis Help»Programming NI ELVIS Using LabVIEW»Low Level NI ELVIS VIs»Function Generator VIs

If you set up the function generator you should be able to run the analog acquisition in the same while loop. You would then be able to see the waveform change as you change the settings for the function generator. (Make sure that the device input to the FGEN initialize is the DAQ card controlling the ELVIS.

If you want to programmatically determine when the square wave appears as a triangle wave, then you have to decide what you would like to calculate to determine that fact. If being able to make a visual determination is good enough for your purposes you should be fine, but if you would like to programmatically determine, then we would have to do some calculations on the data you are displaying, which shouldn't be a problem, but I need to know what you would like to calculate.

Have a great day,

Michael
0 Kudos
Message 2 of 5
(11,042 Views)

Hi Michael,

Thank you so much for getting back to me. When manually done, an input signal of a square wave is sent into an OP AMP, the outputstarts off as a square wave, and the  frequency of this signal is increased until the output square wave (output voltage) starts looking like a triangular wave. The frequency at which this occurs and the slope of the triangular wave is measured. I have to do all this programmatically: to determine the frequency at which the square wave becomes triangular and the slope  at that frequency. How can I do this?

Thanks.

ntfan

0 Kudos
Message 3 of 5
(11,033 Views)
Hi Ntfan,

To do this programatically you just need to make the while loop increase the input frequency of your function generator everytime the while loop iterates. Then in the while loop just take the derivative of the signal to see the slope and this will allow you to determin when the signal becomes a triangle wave and then terminate the while loop when the slope gets small enough to consider it a triangle wave. You could then take the frequency value and make that your output. I have an example which is a shell of how to set this up. You need to put your data acquisition code in and if you have set up the Fgen differently feel free to use that code as well. I just used the express VI for simplicity. Let me know if you have trouble getting this application working.

Have a great hump day,

Michael
0 Kudos
Message 4 of 5
(11,022 Views)

Thanks Mike.

Really appreciate your help. You have me a great idea of how to go about it. Smiley Happy

ntfan.

 

0 Kudos
Message 5 of 5
(11,007 Views)