LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get DBL from an array cluster/get the phase of a waveform

Hi everyone,

 

I'm creating a code that simulates a three phase system and I have to calculate the active and reactive power for each phase. The rest of the problem is solved with a control and simulation loop (I'm solving a system of differential equations), so what I want to get is the RMS value (or maximum amplitude) and the phase of a waveform in order to calculate the reactive and active power. What I've got so far is an array of three currents and I tried to get the phase with FFT Spectrum (Mag-Phase) VI, but the type of result is not a DBL or a DBL array. In this way I can't calculate anything...

 

So, how can I get the phases from it? Second question (optional): is there another method to calculate the phases and the RMS aplitudes?

Download All
0 Kudos
Message 1 of 3
(1,288 Views)

The output of your FFT Spectrum (Mag-Phase) VI is a 1D array of Clusters, and each Cluster contains three elements: f0, df, and phase.

Just from that, I would recommend using auto-indexing into a for-loop that contains an "Unbundle By Name" function to build a 1D array of doubles (from the "phase" element).

 

But... I've never dealt with a control and simulation loop. I don't know best-practice or capabilities of that loop.

So... hopefully someone with more experience will read this and provide better help if my recommendation isn't the right answer here. 😅

 

-joeorbob

0 Kudos
Message 2 of 3
(1,211 Views)

Hi mazzons98,

I'm not sure whether this help but did you try 'Amplitude and Phase Spectrum.vi' before as shown in the PNG below ?

I have attach the way to convert cluster to DBL as well in case you need a block diagram to visualise better

 

 

Download All
0 Kudos
Message 3 of 3
(1,175 Views)