From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Producer/Consumer Model to perform continuous output

Hello All!

I have another question I hoped some of you may help guide me. Any input it greatly appreciated.

 

I am currently working on a project where I will use a periodic but non-sinusoidal waveform as my analog input, perform the FFT, and output the signal minus the fundamental. This signal will be fed into a controller of my design (not going to go into a description since it is not the purpose of this post). Per someone's recommendation on a previous post, I was advised to use a producer-consumer model in order to obtain a continuous output and minimize the time delay between my input and output as much as possible, since having a minimum delay as much as possible is very important in my application.

 

I have attached the current VI I am working on so that some of you may see what current issues I am facing. I have been closely following another example and trying to fit it into my application.

 

My first question: Does my approach look correct? I am new to LabVIEW and would greatly appreciate any feedback.

 

Second: Can someone take a look at the current errors I am getting and advise me on how to correct them? One of the errors is setting up the channel for my analog output, the only options I am getting are for analog input, not sure what I am doing wrong. The other error is associated with the case structure within my consumer loop. I am unsure of how to handle the false case.

 

I spent most of my time designing and implementing the controller that I did not much thought into the signal processing aspect. Thank you all for taking the time in reading this lengthy post to help guide me in the right direction, any feedback is greatly appreciated.

0 Kudos
Message 1 of 4
(2,830 Views)

Sorry, I'm commenting more on your premise, less on your implementation.  I have some experience generating "periodic non-sinusoidal" waveform.  I'm curious about your statement that you wanted to play this periodic signal through an FFT and subtract out the "fundamental".

 

If you have a periodic signal, then it is a very simple procedure to run the waveform through a fit to the fundamental and subtract it without having to do an FFT.  Thus you can compute the "periodic non-sinusoidal waveform - fundamental", which allows you to eliminate the need for Analog Input, FFT, Producer/Consumer, and allows you to concentrate on a single Analog Output loop.

 

While you learn about Signal Analysis and how to accomplish the task described in the paragraph above, you can try coming up with the Analog Output code to output a periodic signal having the period of your Waveform.  What is the Period of your signal (in second), and what is the output rate you plane to use for producing the Analog Output?  It looks like your Output Rate is 18K.  I see a buffer size of 18K -- is the period of your signal 1 second?  If the period is larger, I'd assume you were producing it "in pieces", a second at a time.  Can you clarify?

 

Bob Schor

Message 2 of 4
(2,793 Views)

Hello Bob!

 

I am working on a shunt active power filter that will be used to attenuate unwanted frequency components present on the supply line as a consequence of connected non-linear loads. I will be stepping the supply voltage down to a tolerable level to feed into the myDAQ (I will provide isolation between the high power side and control circuit) to analyze the signal. The power filter will eliminate the unwanted frequency components through current compensation. I have designed a hysteresis controller (bang-bang controller) that will use the reference signal as its input to drive the switching of my bridge circuit. The non-sinusoidal waveform is a consequence of the non-linear load taking current in short abrupt pulses, I wish to extract the fundamental 60Hz frequency component and use the resulting waveform as my reference signal for my controller and switching circuit.

 

The current values listed on the output rate and buffer size are just arbitrary. I have not decided on what those values will be yet.

0 Kudos
Message 3 of 4
(2,787 Views)

"One of the errors is setting up the channel for my analog output, the only options I am getting are for analog input, not sure what I am doing wrong."

 

Can you send images about this? To better understand what is the issue.

0 Kudos
Message 4 of 4
(2,701 Views)