Showing results for 
Search instead for 
Did you mean: 

PID Temperature control using slope of output

I have a difficult problem in which I wish to maintain a constant temperature over time on the fin side of a heat exchanger by controlling the flow rate through the heat exchanger coil. I'm currently using the Time v Temp data to determine the current slope (based on the temperature history over the last say 20 seconds) and use that as the process variable for a PID controller. The issue that I am having is determining the PID constants to have a consistent response. They either seem to constantly be saturating the pump output or not changing at all even with large changes in temperature slope. What is the best way to determine the PID constants for a system of this type? Or is there a better control method to use?

0 Kudos
Message 1 of 19

I don't think you should be using the slope of temperature vs time as your process variable (or error term). If you want a constant temperature, I assume you set the slope to zero. What if your system changes temperature, say at 1 deg / sec. A second later, you may be able to get the slope back to 0 deg / sec, but your temperature has risen by 1 deg, so you are operating at a different, constant temperature.


Usually the error term would be target temperature - current temperature. As long as you do not change your target temperature, the PID controller's job would be to operate at a constant temperature.

0 Kudos
Message 2 of 19

Thanks for the response. This is how the system needs to operate though. I cannot use temperature as a setpoint because that temperature is constantly changing with other operating conditions that are out of my control. All I need to do is make sure that no matter what the actual temperature is, that is stay constant. I cannot specify temperature only that the slope of the temperature remain constant (usually equal to zero).

0 Kudos
Message 3 of 19

I can't make total sense of what you've described.


You've said:

- things outside your control will cause the temperature to "constantly change"

- whatever the temperature is, it must stay constant

- you can't specify a temperature setpoint only that the slope remain constant


Those things simply don't make sense together.  Either the description is wrong or the requirement is impossible.  The first 2 are a direct contradiction.  And a constant slope for temperature cannot possibly be sustained except for the special case of 0 slope, i.e., constant temperature.


Do you actually have more than 1 temperature measurement in this system?   1 that you have knowledge of but is outside your control (perhaps internal boiler or fluid temperature) and 1 that is in your control (heat exchanger fins)?


That *could* be a situation where you might "feed forward" some knowledge of the slope of the uncontrolled internal temperature in order to get a head start at reducing the upcoming expected change in fin temperature.  This kind of feed-forward would normally require some math modeling and system dynamics knowledge.  And you'd still run a PID loop on the difference between desired and actual fin temperature.   The overall gain or correction term would be the sum of the PID gain and the feed-forward term.



-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 19

Kevin, thanks for taking the time to respond. Let me try to better explain the situation. 

I have a wind tunnel that is closed loop and the fan motor is inside the flow, this generates heat based on the operating speed of the fan which is more or less constant for a given test. There is a heat exchanger downstream of the fan to remove the fan's added heat from the system and bring it back down to some stable temperature which is not critical what the actual temperature is as long as its stable. The wind tunnel has a breather vent that equalizes the pressure inside the tunnel with ambient pressure/temperature. The controller I am developing needs to be able to compensate for a change in heat input into the system by controlling the flow rate of the coolant through the heat exchanger. As I mentioned before, I need to maintain a constant temperature for a given flow condition, i.e. constant fan speed and given ambient temperature, by changing the heat exchanger flow rate. I would expect the controller to "see" a sudden change in temperature slope and ramp up the flow rate until the temperature stays constant then slowly drop back to maintain that temperature.

0 Kudos
Message 5 of 19

This sounds like a system where control will depend on a good thermodynamic model.


Is constant fin temperature alone really a sufficient proxy for the control you want over the system?  I'm no expert in the field but it doesn't seem to provide all the info you might need.   


Basically, it seems to me that you should be doing a *heat* balance rather than a pure temperature control.  That'd definitely require some system model knowledge, but I recognize that it might also require additional sensing that isn't currently feasible to integrate.


I'd be wanting to measure and control something like heat removal rate at the exchanger, based on fluid flow rate and delta temp from inlet to outlet.



-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 6 of 19

That's an interesting thought. It might be interesting to develop but I don't think that I have sufficient information to be able to develop something of this nature. There are too many unknowns that will affect the physics and in turn affect the output. The wind tunnel has a breather vent that is connected to the air outside of the building for exhausting particulate from the system which means it also depends on weather conditions outside. This is why I thought that using the time derivative of temperature would be the easiest solution. I'm calculating the current time derivative of temperature for the last 20 seconds of temperature data (can be set to any length). Assuming the system is already stable (constant slope of zero) and I start the fan, there will be a fairly sharp increase in temperature, at which point the controller should ramp up the cooling pump according to how quickly that temperature is increasing. I know using a derivative can be problematic but I would think that as long as the derivative isn't too noisy that it would work just like any other process variable. Is that true?

0 Kudos
Message 7 of 19

You seem to mix and confuse terms. Do you have an external PID controller that you want to feed with a certain process variable or are you trying to implement a PID controller based on some derived variable, such as slope? The term PID controller is well defined so we need to know what you have and want. A normal PID system uses proportional, integral, and derivative terms to control a system already. 


If you have a PID controller, it simply needs to be properly tuned based on the characteristics of the control system, as the D in PID implies, it already utilizes derivative terms and such. All it needs need is the setpoint. There are standard ways to tune a PID system. Have you done that?


For the temperature to simply remain constant, just use the starting temperature as a setpoint, leaving everything else as is.

0 Kudos
Message 8 of 19

I'm trying to implement a PID controller based on a derived variable. The derived variable in this case is calculated based on the measured slope of the air temperature. I have tried running the "Autotune" feature of the built-in PID controller VI in LabView and cannot ever get it to properly determine the PID constants. This is where I'm running into difficulty.

0 Kudos
Message 9 of 19

@kjon wrote:

The derived variable in this case is calculated based on the measured slope of the air temperature. 

Does that mean you want the PID controller to keep the slope constant, i.e. vary the temperature linearly forever? At one point you'll reach the limits, of course. (you cannot go below absolute zero and you cannot melt the lab :D).

0 Kudos
Message 10 of 19