LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview PID: internally resets the error to avoid integral wind up -how, why???

I am using Labview PID (with only PI terms, D = 0) to control a furnace temperature.  I used my own and also autotune to get PID values (P = 4, i = 12).  Initially the output saturates for a while (when requesting a big temperature change).  To avoid overshoot (or avoid integral wind up?) the PID sets the error to zero (somehow internally!) when the temperature is still far from the setpint somehow internally and output drops to zero.  This does not make sense because the error is still positive and thus k*error + k/T * integral(error) should still be positive.  The output then goes through a series of oscillations (slowly damping).  The results is that temperature of the furnace rises, plateaues, rises, plateaues and slowly works its way to the setpoint.  How can I optimize this control better??

 

Best Regards,

Arman

0 Kudos
Message 1 of 6
(5,569 Views)

Hi Arman:

 

Is your program based on one of the PID Toolkit examples or is this some code you wrote yourself?  Without knowing exactly what you're doing it's hard to say what  the issue is.  If you post the code you're using, hopefully we can give you some advice.

Alex Person
NI-RIO Product Support Engineer
National Instruments
0 Kudos
Message 2 of 6
(5,529 Views)
I forgot to post this before but here's a Developer Zone article on Improving PID Controller Performance.  Hopefully there's some helpful information you can use in there.
Alex Person
NI-RIO Product Support Engineer
National Instruments
0 Kudos
Message 3 of 6
(5,527 Views)

This is a PID bug I have submitted once or twice, but apparently it has never been fixed.  The windup correction is overkill, since it adjusts the integral term to prevent the sum from exceeding the limits.

 

I had to go into the toolkit and put in a different windup control algorithm.  I decided to set a maximum limit on the integral term instead.  Keeping it at 20% of the total range works pretty well for my applications.  You can also set it at 80% for applications that need a large integral term.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 6
(5,520 Views)

Alex, Bruce,

 

I am using the PID VI with autotuning option.  The code is very simple: I feed my thermocouple readout (process variable) and the desired setpoint to the PID VI and take the output to the external power source which heats up the furnace.  I can provide the code if you still wish, but there is really not much to it and yes it is similar to the examples provided in the toolkit. 

 

I am attaching the data I get in my setup.  You see initially the output of PID saturates (Figure 2), then PID output drops to zero - why?  As Bruce has also observed, this is done internaly to avoid overshoot, but it is an overkill here.  Bruce, could you provide more detail how you reduced this effect?  I think it would be very useful if the PID VIs would provide the values of proportional, integral and derivative terms they calculate.  The proportional term is easy, K*error and I get this when I use only the P term.  However, i am not able to reproduce the P + I terms, i.e. what I calculate in spreadsheet is not what the PID VI outputs.

 

Best,

Arman

 

0 Kudos
Message 5 of 6
(5,499 Views)

I would have to dig into the software to give you exact details.

 

I remember after the P and I terms are combined, the value is coerced to the limits.  The new I value is calculated by subtracting the P value.  Instead, I coerced the I value to a max of 20% of the range, then coerce the sum of P, I, and D terms to the limits.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 6 of 6
(5,478 Views)