LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PID Temperature control using slope of output

Yes. In general the desired slope should always be zero but there will reach a point when the heat exchanger cannot "keep up" at which point the PID controller should saturate the output (max pump speed) and I will simply not be able to reduce the heat any further.

0 Kudos
Message 11 of 19
(997 Views)

@kjon wrote:

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.


It sounds like you're talking about using a PID controller to control temperature, which is a pretty standard thing to do. The derivative term should increase the cooling output relative to the derivative of the temperature error, which (if your setpoint is constant and your PV is above your setpoint) should be the same as the derivative of temperature itself. A temperature rising above your setpoint results in a positive derivative term which increases the cooling output to compensate, just like you're describing.

0 Kudos
Message 12 of 19
(997 Views)

@arteitle wrote:

 

It sounds like you're talking about using a PID controller to control temperature, which is a pretty standard thing to do. The derivative term should increase the cooling output relative to the derivative of the temperature error, which (if your setpoint is constant and your PV is above your setpoint) should be the same as the derivative of temperature itself. A temperature rising above your setpoint results in a positive derivative term which increases the cooling output to compensate, just like you're describing.

I'm not using temperature as the setpoint, but the slope of the temperature which is calculated based on the last XX seconds (usually 20-30) of temperature history.

0 Kudos
Message 13 of 19
(995 Views)

If the slope is the process variable and you want to keep constant temperature, the setpoint is zero, i.e. no change in temperature. What exact problems do you have with tuning?

0 Kudos
Message 14 of 19
(992 Views)

@kjon wrote:

I'm not using temperature as the setpoint, but the slope of the temperature which is calculated based on the last XX seconds (usually 20-30) of temperature history.



You're saying it's fine for the temperature to change as long as it changes at a constant rate. What's a typical slope setpoint that you'd use? Is there a problem with using a slope setpoint of zero, so that you do maintain a constant temperature?

0 Kudos
Message 15 of 19
(988 Views)

@kjon wrote:

I'm not using temperature as the setpoint, but the slope of the temperature which is calculated based on the last XX seconds (usually 20-30) of temperature history.


Again, your logic is circular. You are measuring and controlling temperature, so why would you feed the controller a derived variable instead? As we said before, PID does it's own derivative calculation already, all it needs is a setpoint and a way to monitor temperature over time.

 

Can you take a step back and explain why you think that your approach is sane from some perspective? We cannot see it.

 

To just keep the temperature constant, use the first measurement as setpoint.

0 Kudos
Message 16 of 19
(984 Views)

@altenbach 

Again, your logic is circular. You are measuring and controlling temperature, so why would you feed the controller a derived variable instead? As we said before, PID does it's own derivative calculation already, all it needs is a setpoint and a way to monitor temperature over time.

 

Can you take a step back and explain why you think that your approach is sane from some perspective? We cannot see it.

 

To just keep the temperature constant, use the first measurement as setpoint.I'm definitely not saying that this approach is "sane" which is why I came here in the first place 🙂

The problem with using the temperature as a setpoint is that it would never be physically attainable which would result in the pump running full speed all the time. The issue lies in the design of the heat exchanger. It does not have sufficient capacity to allow for temperature control using a temperature setpoint. All it can do is maintain an equilibrium based on the reference air temperature and the amount of heat that is input into the system by the fan. Using temperature as a setpoint will never work because it is all based on the heat input from the fan (and how hard the fan is running) and ambient flow conditions. 

My only intention with this post was to find out if there is a better way of controlling the heat exchanger given my limited cooling capacity and my inability to hit and maintain an actual temperature rather than just some stable equilibrium state.

0 Kudos
Message 17 of 19
(973 Views)

I'm definitely not saying that this approach is "sane" which is why I came here in the first place Smiley Happy

 

The problem with using the temperature as a setpoint is that it would never be physically attainable which would result in the pump running full speed all the time. The issue lies in the design of the heat exchanger. It does not have sufficient capacity to allow for temperature control using a temperature setpoint. All it can do is maintain an equilibrium based on the reference air temperature and the amount of heat that is input into the system by the fan. Using temperature as a setpoint will never work because it is all based on the heat input from the fan (and how hard the fan is running) and ambient flow conditions. 

 

My only intention with this post was to find out if there is a better way of controlling the heat exchanger given my limited cooling capacity and my inability to hit and maintain an actual temperature rather than just some stable equilibrium state.

0 Kudos
Message 18 of 19
(964 Views)

I went back and re-scanned this thread from the beginning.  There's some failure to communicate but I think I'm piecing enough stuff together to at least act as translator in some areas.

 

To the OP:

1. In general, you desire the temperature to be constant (slope=0).  However, your cooling system is *not capable* of achieving that under all circumstances.  The best it can do is to saturate its output (pump speed).   [see msg #11]

 

2. There is no trick you can pull with a different control algorithm or different process variable that will get around the basic physics that limits you.  More heat can get generated than you can take away even when maxing out the pump speed.  As a result, temperature rises.  THAT IS WHAT YOU ARE INEVITABLY STUCK WITH, given the system as it is.

 

3. Pause to finish experiencing the 7 stages of grief.  I think much of this thread has probably been camped out in stages 2 and 4, denial and bargaining.

 

4. Ahhhhhh!   Acceptance!   Now, recognize that in fact you *can* (as many have stated) still use PID control on temperature.  Not on slope, but on temperature itself.  It's just that now you go into it knowing that PID won't be able to fully achieve constant temperature.  When it can't, realize that it really is doing the best it can (max pump speed), and the resulting temp rise is *not PID's fault*.  It's the fault of your inadequate cooling system.

 

5. Continuing this thought: you rejected this approach [see msg #18] because you over-committed to the idea that if PID couldn't be successful at maintaining constant temperature, then you shouldn't use it to *try*.  That was the wrong conclusion.  PID is still a viable choice.  True, for periods of time it'll fail to maintain constant temp due to inadequate cooling capacity.  But later when you stop putting heat into the system through your fan motor, good ol' PID is still there, ready to do whatever cooling it can to get you to the temperature you were wanting in the first place.

  

6. Granted, you'll need to attend to some additional details to make the PID control work as well as possible.  For example, you'll need to implement some intelligence in limiting/adjusting/resetting your integral term.  You know you'll go through time periods where the temperature error term keeps growing and its integral will be wanting and trying to grow faster.   You'll need to limit this.  Here's a quick, untested thought that might help you get started:

- let's define LIM as the maximum control effort that can physically be achieved, i.e., it corresponds to the max pump speed.

- let's use the version of PID that goes like this:  kP*err + kI*(integral of error) + kD*(derivative of error) = overall control effort

- it does no good for the sum of these terms to exceed LIM.  So after calculating your control effort term you'll always limit it to the range [0, LIM].  (The 0 minimum assumes the pump is for cooling only).

- problems also arise from "windup" if you allow the error integral to grow without constraint

- so maybe consider something like this?   At each step, if the calculated control effort would exceed LIM, reset the (integral of error) term so the new calculated control effort *equals* LIM.  (Just don't reset it from a positive to a negative value.  Stop at 0.)   This limits your integral windup while still putting in max control effort toward cooling when needed.

 

7. That was just a guess at an ad-hoc refinement.  Any such tweaks to a pure PID control will have their various effects that will make behavior depart from classical PID theory.  In the course of testing things out, you'll (hopefully) find departures that help and you'll also (unfortunately) find departures that hurt.

 

 

-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).
Message 19 of 19
(953 Views)