LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID.vi behaves inconsistently

http://zone.ni.com/reference/en-XX/help/371361L-01/lvpidmain/pid_vi_algs/

 

The diagram shows that the entire output is multiplied by Kc, but the text says that only the error signal is multiplied by Kc.

 

Experimenting with the VI shows that if I set Ti = 0.1 and Kc = 0, there is no output.  If I then set Kc = 1, the output is positive nonzero while PV < SP. If I set Kc = 0 again, the output stays fixed at the last value where Kc = 1.

 

So I'm stating/asking two things:

  1. The documentation isn't self-consistent. Can anyone clarify what the actual algorithm used by PID (DBL Array).vi is. Really, it's in a DLL call to  lvpidtkt.*: PIDNCh() which is called by that VI.
  2. PID (DBL Array).vi seems to hang when I set Kc = {0, 1, 0} in a sequence using LabVIEW 2013 SP1 on a sbRIO-9632.

UPDATE TO #2: I see that If I add Kc = 1 to the end of the test sequence, the output starts updating again. It seems that the output only hangs while Ti is non-negative and Kc is 0.

0 Kudos
Message 1 of 3
(1,205 Views)

I took quick peek at this documentation and I think the description and maths there are consistent with behaviour you're describing. When you have non-zero Kc and non-zero Ti, the integral part works. If you set Kc to 0, then integral part looks like that:

uI(k) = uI(k-1)

So the controller output stays at the last value of integral part.

And this is of course inconsistent with diagram provided in documentation 😜

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

David_Staab wrote:

The diagram shows that the entire output is multiplied by Kc, but the text says that only the error signal is multiplied by Kc.


The text says that Kc is used in the calculation of all three of Proportional, Integral, and Derivative action - for example, part of the integral action is Kc/Ti.

 

I agree that maintaining the last output value when Kc is set to 0 doesn't match the diagram, but does make some logical sense.

0 Kudos
Message 3 of 3
(1,184 Views)