LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What does PID output mean

Hello,
 
I am trying to understand PID in labview. Suppose I want to generate a sine wave with amplitude equal to 1.  I set the setpoint as a constant 1. The process variable will be the amplitudes of the output signal.  Then what should I do with the output? Is the output the desired amplitude ?
 
Thanks
0 Kudos
Message 1 of 26
(4,534 Views)
The PID output would then drive the amplitude control of the sine wave generator.  Of course, PID control is somewhat useless unless the process variable is changing for some outside reason.  PID would then compensate for the change and bring it back to the setpoint.
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 2 of 26
(4,508 Views)

The PID output is the control signal (input) to your system. Given the PID gains, and based on how far away or near to the current feedback (process variable) you are, the PID output (i.e. system input) will be adjusted to drive your system to the desired setpoint.

Come to think of it, are you trying to generate a sine wave with the PID VI? Why not use the sine wave generator?

Message 3 of 26
(4,509 Views)
I assumed he was controlling the amplitude of the sine wave.  Again, unless an outside force is acting on it there's not much point in using PID to stabilize it.
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 4 of 26
(4,504 Views)
Thank you for answering. 

Yes, I am using a sine waveform generator to drive a shaker and I am controling the amplitude of the output sine wave. Due to the external force on the shaker, the output amplitudes are not always the same to the input.

Here is what I guess to implement the PID:

1.  Set the setpoint to be a constant 1 (I want the output amplitude to be 1)
2.  Use the measured amplitude of output signal as process variable.
3.  Connect the PID output to the amplitude parameter of the sine wave generator.

 But it doesn't work.

Any suggestions?
0 Kudos
Message 5 of 26
(4,495 Views)
Hmmmm.  Test out your physical connections to be sure of your hardware.  Post your code here so we can help you troubleshoot the software.
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 6 of 26
(4,493 Views)
Here is the code I used.

I used two DAQ assist to generate and measure the signals.

Thank you for your time

Bill Shaw
0 Kudos
Message 7 of 26
(4,483 Views)

You are reinitializing your PID in every loop, so you don't let the PID "remember" what it needs to correct previous inputs. Remove that constant and give it a shot. Other than that, what kind of behavior are you seeing? Could it be a matter of tuning your gains? Try making the gains into a control so you can tune online. Remember to make a control to reinitialize the PID, ONLY when you change your PID gains, not all the time.

Message 8 of 26
(4,477 Views)
Thanks.
Your comments sound quite reasonable. But if I remove the constant, how to set the setpoint?
What I have seen was there were some changes of input (target signal) and output (measured) amplitudes but they just didn't match, actually not even close to each other. I may try to use autotuned PID later.

Can you tell me how to set the setpoint?

0 Kudos
Message 9 of 26
(4,474 Views)
I meant to remove the boolean constant that's connected to the reinitialize input of the PID, so you don't do that at every iteration of the loop. And if you want to tune your PID gains while you're running, make the PID gains cluster a control. You are currently setting the setpoint to 0.1, which I thought you wanted to set to 1?
0 Kudos
Message 10 of 26
(4,473 Views)