View Full Version : PID Loops
trane151
10-02-2006, 05:49 PM
Looking for information on how to setup PID loops. Starting at the basics any info would be great.
codewriter
10-02-2006, 06:29 PM
http://www.google.com
search word: PID Loop Tuning
Shophound
10-05-2006, 10:16 AM
I found the article linked to in this thread helpful:
http://hvac-talk.com/vbb/showthread.php?threadid=93655
The bare essential aspect of PID loops is that it is a control process to maintain a setpoint as the process variable changes. IOW, say you have an AHU with a chilled water coil and the AHU is designed to maintain a discharge air temperature of 55 degrees. As heat load over the coil or chilled water temperature through the coil varies, the discharge air temperature will vary unless there's some way to compensate for these changes. Enter the PID loop; Proportional, Integral, Derivative. In this case, the chilled water coil is modulated by a final control device, specifically a chilled water valve, via the PID logic in order to return discharge air temperature to setpoint whenever a deviation from setpoint occurs.
If the heat load increases, more chilled water is added to return discharge air temperature to setpoint. If heat load falls off, chilled water flow is reduced to keep setpoint. The PID loop works to achieve this end without making the valve "hunt" or cycle, which would result in actual discharge air temperature over and undershooting setpoint endlessly unless corrected.
Your eyes, brain, and right foot are a PID loop when you drive. You look at your speedometer and choose 65 mph as your setpoint. You press on the gas pedal until you get to setpoint. Then a big hill comes up and unless you add more gas, you'll sag below setpoint. After you crest that hill you hit a downgrade. You let off the gas to maintain 65 mph. Next, you hit a level patch. You find yourself needing to vary the gas pedal position very little to stay at 65 mph.
The "process variable" is the speed of your car. "Setpoint" is the speed you want to maintain regardless of road changes (unless you hit heavy traffic, of course!). The "final control device" is the gas pedal. The PID loop is you. How quickly you return to setpoint when driving conditions change is a result of how well you respond to the changes without going too fast or slow. This is what we're after with a PID loop.
Proportional:
Controller will read any error between process variable and setpoint and output a change to the final control device based on proportional band. Proportional only control will never achieve setpoint, it will only respond to variance from setpoint and attempt to bring the process variable closer to setpoint in accordance with proportional band.
Integral:
Integral output adds or subtracts from the proportional output to eliminate error between actual process variable measurement (such as temperature) and setpoint.
Derivative:
Rarely used for HVAC, it is essentially a logic sequence that attempts to predict the future of the integral value; it helps achieve setpoint faster and reduces over and undershoot.
How to tune a PID loop will vary with controller manufacturer. The basic thing to know is make any changes to the PID parameters in small increments, and be patient as the loop adapts to any changes. Also, once the loop stabilizes, it's good to introduce an "upset" (basically change the setpoint a few notches) to see how well the loop responds and if it can re-establish setpoint in a reasonable amount of time.
And...don't tune a loop on FRIDAY! :D
[Edited by shophound on 10-05-2006 at 10:19 AM]
trane151
10-05-2006, 05:45 PM
Thanks Shophound...For the info.
roadgear16
10-05-2006, 09:56 PM
proportional- how far from setpoint am I (deviation)
integral- how long have I been away from setpoint(time)
derivitive- typically not used.
In a nut shell.
kwillmech
10-05-2006, 10:47 PM
Trane151 do you work for Trane? If so then you should have CNT-APG002-EN. For those that do not you can find it here (http://www.box.net/public/4jgxxpc6f7).
keepitsimplestupid
10-06-2006, 09:17 PM
My version.
P = 1/gain. As gain increases control can be tighter or more prone to oscilation
I = Makes control occur at the setpoint instead of below the setpoint. A constant multiplied by the integral of the error term. Direct Digital Controls (DDC) need methods to prevent reset windup (adding forever).
D = Prevents overshoot of temperature and usually used in fast responding systems. A constant applied to the derivative of the error term.
kwillmech
10-07-2006, 12:23 AM
PID control logic seems to be slightly different between different manufacturers. PID values don't always mean the same thing.
keepitsimplestupid
10-07-2006, 07:35 PM
In theory, they should be the same. You need to watch out for the units. A popular unit for I is repeats/minute.
What can cause some problems is when a digital controller replaces an analog one. In an analog one, the maximum value of reset is limited by the power supply rails and the value of the PID equation. In a digital one, lets hope the designer limited it to 100%. They could limit the output to 100% or limit the error to 100%.
The idea is to prevent reset wind up is that you stop integrating when the output reaches 100% or the integral of the error reaches 100%.
A popular controller, but not for HVAC, uses the term Max power, but it's really the maximum output of the error amplifier. This variable can alter the values of PID.
P = 1/G: All of the terms are supposed to have G in them, I believe. It's been a decade or so, since I had to do a PID loop from scratch (FORTRAN). If it's omotted, then that can severely change P, I and D.
A direct quote from here: http://www.expertune.com/tutor.html
"Depending on the manufacturer, integral or reset action is set in either time/repeat or repeat/time. One is just the reciprocal of the other. Note that manufacturers are not consistent and often use reset in units of time/repeat or integral in units of repeats/time. Derivative and rate are the same."
phxurs
10-08-2006, 02:35 AM
Originally posted by roadgear16
proportional- how far from setpoint am I (deviation)
integral- how long have I been away from setpoint(time)
derivitive- typically not used.
In a nut shell.
I,m going to agree with this = KISS Keep it simple stu "pid"
IN Hvac The "D" Portion is Rarely used!
But think space as(P) Time (I)and (D) as Distance
simux
10-20-2006, 11:31 PM
I would read the manufacturers recommendations for settings. These rules of thumb give you an excellent starting point.
bryan l
10-24-2006, 08:50 AM
Originally posted by roadgear16
proportional- how far from setpoint am I (deviation)
integral- how long have I been away from setpoint(time)
derivitive- typically not used.
In a nut shell.
"derivitive- typically not used." Not true. Its what makes PID actually effective. otherwise its just a PI loop and the control aspect acts totally different. Some applications dont need PID but some wont run without it. It all depends.
roadgear16
10-24-2006, 10:20 PM
Originally posted by bryan l
Originally posted by roadgear16
proportional- how far from setpoint am I (deviation)
integral- how long have I been away from setpoint(time)
derivitive- typically not used.
In a nut shell.
"derivitive- typically not used." Not true. Its what makes PID actually effective. otherwise its just a PI loop and the control aspect acts totally different. Some applications dont need PID but some wont run without it. It all depends.
My mistake, I should have said that the D value is left at zero 99.99% of the time instead of "typically not used"
bryan l
10-25-2006, 12:14 AM
well in the fridge world D is "usually" 1 when dealing with valves and compressors. It all depends on what is being done with the logic. Its like saying that some people use a multi meter 99.98% of the time for voltage, well in some cases this is true, in MOST its not.
jogas
10-27-2006, 07:49 PM
One thing to remember about tuning a PID loop is that the required sensitivity for the proportional value can and does change with load. The proportional contribution is really calculated on the "change" in difference between set point and measured value. That's why you can have a loop perfectly tuned and then come back another day and it'll be hunting badly. I'll set the Proportional value to the widest setting practical and set the Integral contribution so it has a 1% to 2% change in output per centage.
This strategy has helped me tune some large AHU's steam coil hot decks and mixed air loops that were out of control.
My 2 cents,
jogasz28
bryan l
10-28-2006, 01:53 AM
Okay, I just spent two days out of town "massaging" 3 compressor group PID's for a Supermarket. You never stop learning, this is for sure. First and foremost is the nature of the PID your working with, What is the Throttle range and where is it located? is it 50/50 on both sides of the set-point? or is it programmed like a condenser with 75/25?
P is only going to try to stabilize the input. It will try to level out any place, that could be anywhere inside the TR.
I is going to try to correct the error between where P wants to settle out and where the set-point is.
D is going to decide just how fast P and I work. D is mainly around to keep P and I from taking forever to find a happy place.
Changing P is really a fine tuning action, you directly affect P with changes to the Throttle range, this is how P is most highly affected, the smaller your TR the more drastic the changes P will make to stay in the Range.
Changing I will help the most when tuning I find, this will get the desired effect you are looking for, getting P to come as close as possible to the actual set-point. The higher the number the faster I will try to pull P toward the SP
Changing D is going to help with over shooting the SP. This is where your stability comes in. Too high a number and you will be swinging all over the graph. To small your never going to get close to a nice flat stable output.
Here is the balance, and EVERY loop is different, You can have exactly the same equipment, but if your conditions are just slightly different your starting at scratch again. Some algorithms have things like max and min output values to limit swing of say a valve or motor. You really need to look into what is available in the algorithms. The best advice I can give is to first look at what is contributing to the input values changes. Do you haves some valves that are hunting, or some other variable that you can look at to try stabilize. Once you have a input that is as good as you can make it you can focus on tuning the loop to maximize control. PID will not help if your input swings all over the graph. Its like playing monkey in the middle, if the kids are whipping a ball around you so fast you cant keep track of where it was let alone where it is your never going to gain control, but if the kids slow down the pace you will be able to get position and control the game.
Patience, patience, patience...
jogas
10-28-2006, 06:05 AM
Originally posted by bryan l
Okay, I just spent two days out of town "massaging" 3 compressor group PID's for a Supermarket. You never stop learning, this is for sure. First and foremost is the nature of the PID your working with, What is the Throttle range and where is it located? is it 50/50 on both sides of the set-point? or is it programmed like a condenser with 75/25?
P is only going to try to stabilize the input. It will try to level out any place, that could be anywhere inside the TR.
I is going to try to correct the error between where P wants to settle out and where the set-point is.
D is going to decide just how fast P and I work. D is mainly around to keep P and I from taking forever to find a happy place.
Changing P is really a fine tuning action, you directly affect P with changes to the Throttle range, this is how P is most highly affected, the smaller your TR the more drastic the changes P will make to stay in the Range.
Changing I will help the most when tuning I find, this will get the desired effect you are looking for, getting P to come as close as possible to the actual set-point. The higher the number the faster I will try to pull P toward the SP
Changing D is going to help with over shooting the SP. This is where your stability comes in. Too high a number and you will be swinging all over the graph. To small your never going to get close to a nice flat stable output.
Here is the balance, and EVERY loop is different, You can have exactly the same equipment, but if your conditions are just slightly different your starting at scratch again. Some algorithms have things like max and min output values to limit swing of say a valve or motor. You really need to look into what is available in the algorithms. The best advice I can give is to first look at what is contributing to the input values changes. Do you haves some valves that are hunting, or some other variable that you can look at to try stabilize. Once you have a input that is as good as you can make it you can focus on tuning the loop to maximize control. PID will not help if your input swings all over the graph. Its like playing monkey in the middle, if the kids are whipping a ball around you so fast you cant keep track of where it was let alone where it is your never going to gain control, but if the kids slow down the pace you will be able to get position and control the game.
Patience, patience, patience...
1
I guess I'm confused, here is my understanding of PID's:
The only time you get a 50% output is when both the set point and measured value are the same and there is no Integral or Derivitive values set (set at zero).
Integral is how long the measured value has been away from set point.
I've never seen Derivitive work yet on HVAC equipment in 14 years of setting PID's. It probably works in Supermarket Refrigeration because the load process is generally cyclic and repeatable, and not influenced greatly by external factors (such as Outside temperature/economizer) as on HVAC equipment.
I've set many large multi-stage compressors on HVAC and have never used Derivitive.
If anyone has had continued success using Derivitive, please explain as I'm always willing to learn new ways.
Great PID discussion!
jogasz28
jogas
10-28-2006, 06:06 AM
Originally posted by jogas
Originally posted by bryan l
Okay, I just spent two days out of town "massaging" 3 compressor group PID's for a Supermarket. You never stop learning, this is for sure. First and foremost is the nature of the PID your working with, What is the Throttle range and where is it located? is it 50/50 on both sides of the set-point? or is it programmed like a condenser with 75/25?
P is only going to try to stabilize the input. It will try to level out any place, that could be anywhere inside the TR.
I is going to try to correct the error between where P wants to settle out and where the set-point is.
D is going to decide just how fast P and I work. D is mainly around to keep P and I from taking forever to find a happy place.
Changing P is really a fine tuning action, you directly affect P with changes to the Throttle range, this is how P is most highly affected, the smaller your TR the more drastic the changes P will make to stay in the Range.
Changing I will help the most when tuning I find, this will get the desired effect you are looking for, getting P to come as close as possible to the actual set-point. The higher the number the faster I will try to pull P toward the SP
Changing D is going to help with over shooting the SP. This is where your stability comes in. Too high a number and you will be swinging all over the graph. To small your never going to get close to a nice flat stable output.
Here is the balance, and EVERY loop is different, You can have exactly the same equipment, but if your conditions are just slightly different your starting at scratch again. Some algorithms have things like max and min output values to limit swing of say a valve or motor. You really need to look into what is available in the algorithms. The best advice I can give is to first look at what is contributing to the input values changes. Do you haves some valves that are hunting, or some other variable that you can look at to try stabilize. Once you have a input that is as good as you can make it you can focus on tuning the loop to maximize control. PID will not help if your input swings all over the graph. Its like playing monkey in the middle, if the kids are whipping a ball around you so fast you cant keep track of where it was let alone where it is your never going to gain control, but if the kids slow down the pace you will be able to get position and control the game.
Patience, patience, patience...
I guess I'm confused, here is my understanding of PID's:
The only time you get a 50% output is when both the set point and measured value are the same and there is no Integral or Derivitive values set (set at zero). Otherwise, getting a 50% values is a coincidence as the algorythm is just moving thru that value.
Integral is how long the measured value has been away from set point.
I've never seen Derivitive work yet on HVAC equipment in 14 years of setting PID's. It probably works in Supermarket Refrigeration because the load process is generally cyclic and repeatable, and not influenced greatly by external factors (such as Outside temperature/economizer) as on HVAC equipment.
I've set many large multi-stage compressors on HVAC and have never used Derivitive.
If anyone has had continued success using Derivitive, please explain as I'm always willing to learn new ways.
Great PID discussion!
jogasz28
bryan l
10-28-2006, 11:44 AM
Actually HVAC would be easier to setup than a Ref system due to the stability of your medium. For example your mixing outside air (gradual changes in WB, DB and RH) Your RA is going to be quite stable and your SA is the part that will change allot. In Fridge you have to deal with systems going into defrost and going out every few min, Pressures jumping up and down as compressors cycle, Head pressure cycling fans cause fluctuations, people leaving doors open and loading cases, it goes on and on, Honestly Refrigeration is a application that will the the hardest to control with PID due to the rapid changes of the inputs.
HVAC may not use D very much and this is because you can get a stable output with just P and I doing the work. D really comes into play on a system with rapid swings on both sides of a Set-point.
jogas
10-28-2006, 05:35 PM
Originally posted by bryan l
Actually HVAC would be easier to setup than a Ref system due to the stability of your medium. For example your mixing outside air (gradual changes in WB, DB and RH) Your RA is going to be quite stable and your SA is the part that will change allot. In Fridge you have to deal with systems going into defrost and going out every few min, Pressures jumping up and down as compressors cycle, Head pressure cycling fans cause fluctuations, people leaving doors open and loading cases, it goes on and on, Honestly Refrigeration is a application that will the the hardest to control with PID due to the rapid changes of the inputs.
HVAC may not use D very much and this is because you can get a stable output with just P and I doing the work. D really comes into play on a system with rapid swings on both sides of a Set-point.
Wrong....you Ignore the Outside Air contribution.
Jogas
keepitsimplestupid
10-29-2006, 12:00 AM
Error is % error
Out is in %
P = 0-100% usually
P0 = 0; usually
P = P0 + Kp*Error + Ki*(Integral of error with respect to time) + Kd*(derivative of error with respect to time)
For DDC (Direct Digital Control), you must put a clamp on (Integral of error)
For those without calculus background:
Distance is like error
the derivative of distance with respect to time is speed
Conversely, the integral of speed with respect to time is distance.
The integral of distance with respect to time is like how far you traveled.
Numerical integration is like summing (error * delta t)
Numerical differetiation is like computing the slope betweet error at tn and error at tn+1.
The period t, is fixed in the controller.
dingman
11-03-2006, 12:38 PM
That's all very interesting! I've been tuning HVAC PID loops for quite a few years now and sometimes it feels like an art (for people like me with very little math).
Still, I get it done, thanks to all for the information.
jogas
11-03-2006, 04:30 PM
Originally posted by dingman
That's all very interesting! I've been tuning HVAC PID loops for quite a few years now and sometimes it feels like an art (for people like me with very little math).
Still, I get it done, thanks to all for the information.
I've never calculated any math for PID's in many years of tuning them. The values just give you some degree of effect you have on the PID's output. The bottom line is how the output changes as the measured value changes to control without too much hunting of the output or input.
The art is getting the most out of each individual application while presented with that systems design and installation compromises and restrictions.
jogas
dingman
11-06-2006, 03:10 PM
I have to admit, working with Powers\Landis\Siemens equip for all of my years, I don't need to fiddle with loop tuning much anymore. I already have a "library" of established values that work in 98% of my applications.
When I come to a difficult system, obviously the first thing to check is - the mechanical system. I find out how much of my actuator is "usable". Alot of times, the system is poorly designed and the valve sizing is way off, or the demand isn't what it was supposed to be and the customer wants the system to be tuned using only 10% of the range of the controls.
Anyway, Siemens is just now giving it's tech a new loop that's included with new control panel firmware...
It's called an "Adaptive Loop" and isn't a PID loop. I don't have many details on it yet, but it's not supposed to need much tuning, if any at all. We'll see.
jogas
11-10-2006, 08:33 PM
Originally posted by dingman
I have to admit, working with Powers\Landis\Siemens equip for all of my years, I don't need to fiddle with loop tuning much anymore. I already have a "library" of established values that work in 98% of my applications.
When I come to a difficult system, obviously the first thing to check is - the mechanical system. I find out how much of my actuator is "usable". Alot of times, the system is poorly designed and the valve sizing is way off, or the demand isn't what it was supposed to be and the customer wants the system to be tuned using only 10% of the range of the controls.
Anyway, Siemens is just now giving it's tech a new loop that's included with new control panel firmware...
It's called an "Adaptive Loop" and isn't a PID loop. I don't have many details on it yet, but it's not supposed to need much tuning, if any at all. We'll see.
I'd really like to hear about that adaptive loop. I've heard of self-tuning PID's before, but never one that worked well.
Jogas
big mac51
11-23-2006, 05:44 PM
Try using P=400 I=10 D=0 and use this as a starting point and then change to P=500 I=20 so on.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.