From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

PID tuning - temperature control

Solved!
Go to solution

Hello,

 

I working on a PID control project with a dreaded heater control.  The heater is fairly small ~ 10 watts, so the response time is very quick.  As my setpoint increases, my PV decreases.  I am controlling the heater with a DC power supply, so the nominal is a midpoint voltage and I let the PID +/- 100% swing the voltage from 0 to full scale. 

 

The  Kc is about 0.4.

With a P control, Kp = 0.2, I get a damped oscillation that hovers about 2-4% above the setpoint.

With a PI control, Kp= 0.2, Ki = 0.00001, I get a steady oscillation around the setpoint.

 

Attached is an example with the PI control.  It does seem that my sampling rate is too slow (both the SP and PV are done with GPIB). 

PID oscillation

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The sequence of events is --> Command SP -> (wait) --> Read PV --> Use PID to set new SP --> (loop) 

 

I have tried to improve this by putting the PV measurement in a parallel loop.  This seems to help some, but did not eliminate the oscillation.  The old loop time was ~ 0.3 seconds, now it is 0.15 seconds.  Any faster and my loop time < PV measurement time.

 

Any suggestions?  I tried the PID Autotune vi, but it could never tune the system.

 

Message Edited by vt92 on 02-25-2009 11:36 AM
>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 1 of 13
(9,341 Views)
Your loop speed should be fast enough assuming there is sufficient thermal mass in your system.  I suspect the distance between your feedback sensor and the heat source is too large.  Find the sweet spot for the physical components first using just a simple Proportional tune.   After you've established that, you can fine tweak it further by adjusting software parameters.
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 2 of 13
(9,326 Views)
The thermal mass is quite low.  The heat source and sensor are very close, they are part of one physical component. 
>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 3 of 13
(9,312 Views)
If you want to reduce oscillations using PID control, you need a value for Kd. Having Kd will help dampen the response and reduce oscillations. Here is a Knowledge Base on tuning PID control. It is used for servo motors but you can apply the same basic tuning idea discussed in the second half of the article to your system.
0 Kudos
Message 4 of 13
(9,281 Views)
Solution
Accepted by topic author vt92

I have done a couple of things to improve the response:

 

1.) I am using a two stage PID.  The "inner loop" PID constantly controls the heater wattage from 0 to full scale.  The "outer loop" adjusts the wattage +/- to reach the setpoint. (fine tuning)   Each PID loop has its own set of PID parameters. 

2.) For some reason, the PID control never worked well because my setpoint was inversely proportional to wattage.  I created a formula which converted my setpoint to a function that is proportional to the wattage.

 

 

 

 

 

 

>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 5 of 13
(9,254 Views)
I have a temperature control setup. Its heater input (controller output) ranges from 0 to 60 PWM units.

I am using PID control toolkit addon. I am unable to implement even a proportional controller. With a change in kc also, there is a slight change in the heater input (controller output), instead of being at its highest, it is very low.

When the error is large enough to go beyond the output range, how is the control effort calculated by the PID block? Also, how large should the Ti term be to nullify the integral action? Please guide.
0 Kudos
Message 6 of 13
(9,045 Views)

Hi,

 


scilab_labview_user wrote:

When the error is large enough to go beyond the output range, how is the control effort calculated by the PID block?

 

When the error is large enough such that the control output is beyond the output range that you wire into the PID block, the output is coerced to be equal to either the upper or lower range value. 

 


Also, how large should the Ti term be to nullify the integral action?

Do you want to take out the integral term all together? If so, you can set the integral gain to be 0 when you wire in the gain values to the PID block.

 

0 Kudos
Message 7 of 13
(9,014 Views)

 When the error is large enough to go beyond the output range, how is the control effort calculated by the PID block?

 When the error is large enough such that the control output is beyond the output range that you wire into the PID block, the output is coerced to be equal to either the upper or lower range value.

 

Can I set it to high or low, in accordance to my choice?

 

-----------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Also, how large should the Ti term be to nullify the integral action?

Do you want to take out the integral term all together? If so, you can set the integral gain to be 0 when you wire in the gain values to the PID block. 

 

 Isn't it of the form:

 

u(t) = Kc[ e(t) + 1/Ti * integral(e(t)) + Td * derivative (e(t)] 

 

implemented after discretizing.

 

 

 

Message Edited by scilab_labview_user on 04-02-2009 01:44 AM
0 Kudos
Message 8 of 13
(8,991 Views)

Hi,

 

The output range that you give the PID block is a cluster of two numbers, the upper and lower range value. If the error is too large and the resulting output is larger than the upper limit, the output will be coerced to the upper range value. Similarly, if resulting output is lower than the lower limit, the output will be coerced to the lower range value. 

 

Yes, that is the form of u(t) but if the PID block sees that Ti=0, it assumes that the user wants to use P or PD control and ignores that term.

0 Kudos
Message 9 of 13
(8,964 Views)

I have a similar problem, can you share your formula?

0 Kudos
Message 10 of 13
(6,937 Views)