From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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 for slow heater temp control

I just recently got the PID toolkit, and have a heater that I want to control with it... the heater heats up a liquid going through some plumbing system.  But it's real slow... I've been controling it manually and it takes a few monutes to reach a certain temperature, and then once it does I usually manually try to balance it there by setting my heater to off then around 50%... and basically just feeling it out until it stabilizes, but it's a sloooow process.... are PIDs a good solution for me?

 

thanks!

0 Kudos
Message 1 of 11
(12,134 Views)

They could be...

If implemented correctly a PID control loop will certainly do what you require.

Of course you will need suitable output and sensing hardware. 

Slow response loops are easier to control than fast ones, & often less demanding on hardware.

b.

0 Kudos
Message 2 of 11
(12,129 Views)
Yes, PID is probably a good solution for you.  Do you have continuous control over the heater power, or is it purely on-off?  If you only have on-off control, you will need to implement some sort of PWM (pulse-width modulation) to cycle the heater power.  Since it's a slow process you can implement the PWM in software and not worry about precise timing.  You will want to take a look at at open-loop tuning methods to get your initial PID parameters; I've had good luck with the Cohen-Coon approach.  Open-loop tuning means no feedback (the PID isn't used).  You start up your system, make a step change in heater power (say from 0% to 50%), and record the temperature until it reaches steady state.  You use the temperature data and some simple equations to determine initial PID gains, which you can then adjust if necessary.
0 Kudos
Message 3 of 11
(12,126 Views)
Thanks, I've been having trouble tuning my PID controller... I've been following some directions I found on the NI website, that said to set everything to zero and then raise the proprtionality constant until you see oscillations, but my heater is so slow that it would take too long to see these oscillations... is this the way to tune a PID controller?
0 Kudos
Message 4 of 11
(12,125 Views)
The PID Toolkit Manual has instructions for open-loop tuning, which does not involve waiting for your system to oscillate.
0 Kudos
Message 5 of 11
(12,118 Views)

Thanks for the link, I'm having a hard time getting this to work at all, I have a few basic questions about what the SP paramter and limits should be.

 

I have a heater, I control it with 4-20mA, I'm reading a temperature sensor, it gives me 0-50C readings... 

 

can I feed my .004-.02 command directly into the Setpoint input of the PID VI? I've been trying this and it's not working. or do I have to change it to match my temperatures? Cause my PV comes back in degrees... but if I match it to my temps do I just do a linear equation that proprtionaly matches up 4-20mA to 0-50C? Even though the real relationship is non-linear? 

 

I've been trying to feed 4-20mA into setpoint of PID, and I changed the range on the PID VI to .004-.02, but I'm getting no where like this.

 

much thanks!

0 Kudos
Message 6 of 11
(12,106 Views)

You need to feed your setpoint in degrees into the PID block.  Otherwise, why would the PID algorithm be useful?  The PID algorithm tries to match the process variable to the setpoint, so if they are in different units you'll have all sorts of problems.  You want to set the output limit of the PID to .004-0.02 mA.  There's no need for you to do any math to match up the ranges, the PID algorithm does that for you once tuned.  In fact, you can think of the Proportional Gain as the slope of a line giving the relationship between process variable and output power.

 

If you're asking about the tuning process, then you want to remove or bypass the PID block entirely - that's what makes it open-loop.  Once you determine the tuning parameters you re-enable the PID block.

 

EDIT: by the way, it may be easier to help you if you post your code or a screenshot of it (preferably as a PNG)

Message Edited by nathand on 03-10-2010 05:19 PM
0 Kudos
Message 7 of 11
(12,091 Views)
One more thing about PID tuning that's gotten me a few times: the LabVIEW PID block expects that tuning parameters will have time units of minutes, not seconds.  If you do the calculations using seconds and plug in those values you'll get miserable control and wonder what you did wrong.  Make sure you use minutes.
0 Kudos
Message 8 of 11
(12,066 Views)

Ok, I've been checking out the manual http://www.ni.com/pdf/manuals/322192a.pdf and trying to follow the closed-loop tuning procedure on page 3-4, but I can't make sense of what I need to use as my PID Gains...

 

I followed the steps and got my system in steady oscillations at about Kc = -0.5

 

I timed my period of oscillation at about tu = 20s

 

but according to table 3-1... it says PB(percent) = 1.67PBu .... huh? is this what I need to enter as my Kc?  my Kc is -0.5... then is says PBu = 100/Kc... so my PBu is -200... so is my proportional constant 1.67*(-200)?

 

and then it says for Reset (minutes), 0.55TTu... I know what Tu is, what's T?

 

Rate (minutes) this is the only one that is clear to me 0.125Tu.... I got that (0.125)*(0.333)

 

thanks!

confused.

0 Kudos
Message 9 of 11
(12,048 Views)

I still think the open-loop tuning process is easier for a slow heater, but your closed-loop gains should work.

 

The "TTu" is a typo - it should just say Tu.

 

I'm not sure why that manual insists on using Proportional Band; the traditional approach says that the Proportional Gain is Kc / 0.6.  This is equivalent to the proportional band approach since 1 / 0.6 = 1.67, thus P gain = 1.67 * (100 / PBu) = 1.67 * 100 / (100 / -0.5) = 1.67 * -0.5 = 0.83.  This is the same result you get from -0.5 / 0.6 = 0.83.

 

This all starts to make more sense after you spend some time building and tuning PID loops.  It also helps if you take time to learn the physical significance behind the values.  For example, the Integral time is often referred to as the Reset time, because it's the time it takes for the Integral action to duplicate the Proportional action.  Internally, the integral gain is actually the Proportional gain divided by the Integral time, so for a constant error, after a number of minutes have passed equal to the integral time, the Integral action exactly matches the Proportional action.

0 Kudos
Message 10 of 11
(12,034 Views)