LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID control?

Solved!
Go to solution

I designed a pressure regulater (itself is a while loop) to run in a for loop, i used a PID controller. Right now this regulater works well for the first iteration of for loop. But from second for loop, it didn't work any more. I notice there is a tick count in PID controller, i don't know is there relationship to it or not.  Is there any way to adjust it and let it work continuely in a loop.

 

Thanks in advance.

0 Kudos
Message 1 of 5
(3,633 Views)
Can you post your code, or at least a screenshot of the relevant portion of it?  You probably should not have a PID running inside a for loop.  Are you trying to control multiple pressures and feeding an array to your PID VI?  If so, you're probably having problems with shift register reuse - each iteration of the for loop will use the same shift registers, messing up your output.  If this is the case try rewriting your PID loop to handle an array input instead.
0 Kudos
Message 2 of 5
(3,630 Views)

Hi Nathand,

Thank u for your reply. 

I have attanched my vi. it's a bit big program. What i'm interest in right now is just the first part of program in sequence structure. Because i want to repeat this process for several times, so i think maybe it's convenience to use a for loop. Your suggestion i don't really understand it. Can u explain a bit more after u read my vi 

0 Kudos
Message 3 of 5
(3,597 Views)
Solution
Accepted by topic author zhiqin
I think you can solve your problem by simply connecting the while loop iteration counter (the blue "i" terminal) through an =0 (equals zero) node to the Reinitialize input of the PID function.  What I think you're seeing is that on the second iteration of your for loop the PID output is starting from wherever it left off when the first for loop iteration finished, and you can fix this by reinitializing the PID function once per iteration of the for loop.
0 Kudos
Message 4 of 5
(3,588 Views)

hi nathand.

 

Thanks a lot. Your advice is exactly what i want.

 

 

 

 

 

 

0 Kudos
Message 5 of 5
(3,573 Views)