LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

First three harmonic analysis

Hi Mark

Thank you for your reply. Now I am getting the 330Hz frequency using this code. I have attached the LabView code. But I am not able to divide the x-scale value by number of blades i.e 11.  I can do this by multiplying the x-scale value. Is there any other way to do this?


There is another doubt with the specific harmonic that we have discussed earlier. I have attached the code for specific harmonic. In the left most "Build waveform" function, the "dt" value was placed as the inverse of sampling frequency. In the DAQ Assistant there are 6 channels. Will I have to repeatedly write this code for 6 times to get the averaged first three specific harmonic?
The specific harmonics were seen to be of zigzag type even during no flow condition. Also, the x-axis time scale is not coming as per the real time scale. I am attaching the data for sp. harmonic. Do I need to modify the code?

Thank you

Pramod



0 Kudos
Message 31 of 48
(1,632 Views)

Hi Pramod,

To change the timebase for your signal, you can get the waveform component dt, and divide it by the number of blades you are counting. Here is an example of what I'm talking about:

Let me know if this work as expected.

 

I'm not sure what you mean by "I have attached the code for specific harmonic. In the left most "Build waveform" function, the "dt" value was placed as the inverse of sampling frequency. In the DAQ Assistant there are 6 channels. Will I have to repeatedly write this code for 6 times to get the averaged first three specific harmonic?"

If you want to change the number of harmonics calculated in the average, you can just wire the outputs of those spectral measurments to a different divisor and graph.



Message Edited by Sappster on 07-16-2008 05:00 PM
Sappster
0 Kudos
Message 32 of 48
(1,617 Views)
Hi Mark
I modified the code and it worked well.

About specific harmonic:
As per your suggestions, I had developed the specific harmonic LabView code (available in previous pages of this post). I am acquiring the data with 6 analog channels with 10 kHz sampling frequency and 1000 number of channels. I am having two queries with this code.

1. Will this code work for 6 channels or shall I have to repeatedly write it for 6 times?
2. The x-axis, time, is lagging the real time.

Please see the attached code and the data file.

Thank you

Pramod
0 Kudos
Message 33 of 48
(1,604 Views)
Hi Pramod,
 
The VI you provided can handle multiple channels being read by your DAQ card.
 
As for the time lag you mentioned, can you explain more. I'm not sure I understand. Is the time that you are seeing in the measurment file not the same as the time on the graph?
Sappster
0 Kudos
Message 34 of 48
(1,595 Views)
Hi Mark

The time that I am seeing in the measurement file and the graph is same. But that time is not same as the real acquisition time. I have attached the image file. Figure shows that the measurement time is 0.02 seconds however measurement was carried out for more than 5 seconds.
The "dt" parameter in the" build waveform" function (outside the while loop) was selected as 0.0001 based on 10 kHz sampling frequency. Is it correct?

Thank you

Pramod
Download All
0 Kudos
Message 35 of 48
(1,580 Views)
Hi Pramod,
 
The method used in that example can cause you to have an invalid timebase because you are appending data to a waveform initialized by the waveform constant outside the loop. If the number in the constant doesn't match your acquisition settings it will overwrite them. If you had .0001 for a 10 KHz acquisition you should be reading the correct time, but when I opened the VI it was set to .1.
 
What about the other methods we looked at for adding the data together after the acquisition? like the method used in the 6 harmonics example? Can you use this method to correct this VI?
Sappster
0 Kudos
Message 36 of 48
(1,564 Views)
Hi Mark

Using trial and error I was just checking the results by varying the "dt" parameter from 0.1 to 0.0001. Today again I checked with 0.0001 sampling time for a 10 kHz sampling frequency, it was showing the data for 0.02 seconds, however it was actually 15 seconds.
I also tried with the method that we used earlier for adding the data after acquisition. I have attached the vi. It is showing only single waveform as we have added the three harmonics.

Thank you

Pramod
0 Kudos
Message 37 of 48
(1,557 Views)
Hi Pramod,
 
I'm a little confused by your example. What is the ultimate goal you want to accomplish?
 
I noticed a few things in the code that maybe be altering your calculations unexpectantly. You are adding the values of the harmonics. Is the data you want to graph to total harmonics for the first three harmonics. If so you can just use the Distortion Measurment VI to search the 3 harmonics. Also the values you are calculating from the Distortion Measurment VI is adding the first 10 harmonics together.
 
You Might want to use the merge signal function to just graph the different harmonics over time. Attached is an example of what I mean.
 
Secondly, with the graph time you will have to provide a timbase for your harmonic calculations because the output is only one value and therefore does not have it's own timing values. I have also included a method for doing this in the example. You will have to calculate the timebase for the harmonis signal you are building by dividing your acquired signal's sampling frequency by the number of samples you are reading.
 
Also you might want to note that because you are running this with a simulated signal, the time that is being graphed may not correlate to the actual time on your computer because you are not reading the data at the actual sampling frequency.
Sappster
0 Kudos
Message 38 of 48
(1,548 Views)
Hi Mark

My ultimate goal is to plot first three harmonics with correct time base. I have used the time interval of 0.0001 seconds for 10 kHz sampling frequency. As you have suggested, the time base in my case will be 10 (sampling frequency/no. of samples). Then shall I have to put 'dt=10' in the "Build Waveform" function placed outside the while loop as shown in my previous attachment?

I am using only DAQ Assistant and not Simulate Signal for the data acquisition. That day I just tried with Simulate Signal as the pc on which I was working was not loaded with NI card. And by mistake I sent that vi attachment.

I couldn't able to open the vi code that you sent as an attachment. The vi code is from higher version and I am using LabView 7.1. Earlier I was having evaluation cd of LabView 9.1 so I managed to open it. However, the evaluation period has expired last week. Therefore can you please send vi code LabView 7.1 version?
0 Kudos
Message 39 of 48
(1,537 Views)
Hi Pramod,
 
Here is an image of the VI I posted:
 
if you are sampling at 10 KHz and reading x samples, then your sampling rate for the distortion should be 10,000/x. In your example you were reading 100 samples. So the distortion samping rate is 100 Hz and the sample time (dt) is .01.


Message Edited by Sappster on 07-28-2008 05:55 PM
Sappster
0 Kudos
Message 40 of 48
(1,501 Views)