LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Phase shifting wave signal

Hi everyone, I’m currently developing a small project (for university purpose) of a single phase DC/AC inverter in LABview. I have done all the stuff and it works pretty good, but there is a problem with the phase mismatch. The load impedance is set as Z=R+jX with real and imaginary parts: the imaginary part is supposed to give a phase mismatch (positive or negative in relations to the vale of jX). The problem is that I am not able to add the phase shift to the wave; I have tried many solutions, but it always end with the original and the final waves perfectly synchronised (they are just scaled by Z module, that is correct). 

 

How can I add a phase shift to my output wave?

0 Kudos
Message 1 of 7
(2,467 Views)

Well, you attached no code, nor "pictures" of your waves.  Do you understand the relationship between "phase", "frequency", and "time"?  Have you tried simply adding a short time delay to your signal?

 

Bob Schor

0 Kudos
Message 2 of 7
(2,441 Views)

Hi Bob, I attached a picture of the last part of the VI, where I get the problem. The wave signal entering from left is the voltage reference that exits from the inverter: as you can see I tried to get the waveform components, and then divided the Y by r (module of Z) for the resistive part; about the phase, I transformed theta angle from radians to degrees, then subtracted from the entering wave, and finally divided by the frequency in order to get the period. I added this period to the trigger time "t0" of the original wave in order to get the time shifting, but I still have the two waves perfectly synchronised (in the second picture is the output wave, the red the original wave and the orange is the output).

 

Note: I used the same value for both R and jX in order to get phase mismatch of 45° (1/4 of period); the wave I'm trying to add the shift is a PWM modulation.

0 Kudos
Message 3 of 7
(2,407 Views)

Because you are a very new member to the Forums, and have little experience with LabVIEW, you can't imagine how unhelpful "pictures of small pieces of LabVIEW code" (as compared to "LabVIEW code" as a .vi file, or a compressed .zip file of an entire LabVIEW Project folder).

 

Phase-shifting a Wave signal is as simple as creating a copy of the Waveform and introducing a (small) Time Shift by altering t0.  Attach your complete VI (with a Control saved with data in it for us to use in our tests) and if you can't phase-shift it, I (or maybe GerdW, who gets up earlier than I) will show you how (with your own code).

 

Bob Schor

 

 

0 Kudos
Message 4 of 7
(2,387 Views)

@Bob_Schor wrote:

Because you are a very new member to the Forums, and have little experience with LabVIEW, you can't imagine how unhelpful "pictures of small pieces of LabVIEW code" (as compared to "LabVIEW code" as a .vi file, or a compressed .zip file of an entire LabVIEW Project folder).

Are you serious? The screenshots are perfectly fine. Helpful even.

 

Stef_gir96 - Have you tried placing indicators for the original t0 and offset t0 values to verify they are different? Your code looks ok (though I'm no signal expert) - it looks more like a display issue with waveform graph, where it doesn't offset each plot based on t0.

 

You might try plotting the waveforms using an XY graph instead. Transform the waveforms into XY values using Waveform to XY Pairs.vi found in the Waveform > Analog Waveform palette. To plot multiple plots on an XY graph, first bundle the XY pairs into a cluster, then build an array with them as shown:

 

MichaelBalzer_0-1636102142858.png

That should result in correctly plotted offsets for the waveforms.

 




Certified LabVIEW Architect
Unless otherwise stated, all code snippets and examples provided
by me are "as is", and are free to use and modify without attribution.
0 Kudos
Message 5 of 7
(2,375 Views)

MichaelBalzer - I tried your solutions and initially seemed to be good but when I change the ZL values it doesn't change because the plot shows the same mismatch. Maybe there are some problems before that point.

 

Hi Bob, you can find my VI attached; note that this project is just a simulation, I am not using an acquisition system for entering the values. 

 

Stefano

0 Kudos
Message 6 of 7
(2,364 Views)

Stef,

     Thanks!  I was "answering the wrong question", sort of.  I was assuming you were looking at your signals using a chart (to view a section of the signal as it "flowed past you", rather than a graph, which requires that you plot first (say) the first 10 points, then redo the plot with the first 20 points, then redo the plot with the first 30 points, etc.

 

     I tried my "phase-shifting trick" with the Graph, and it fell flat.  So I simply created a Waveform Chart, implemented the Phase Shift by making it a simple "time shift", and it works just fine.  I diagram-disabled your Graph-building and replaced it with a Chart-builder, shown in the Snippet below (I also attached the code, or at least I really intend to attach the code -- I've been known to forget this step ...).  You'll notice that I express the Delay as "units" -- since I'm not really "up" on what you are doing, I'll let you figure out how to express Delay in degrees, radians, or (as I think I have done) time units (like seconds) ...  You'll also note that I don't use Icons for Controls or Indicators, so the Waveform Graph is just another un-iconized Indicator.

Inverter UFF BS Snippet.png

Bob Schor 

 

 

0 Kudos
Message 7 of 7
(2,353 Views)