PIDIntro
From ControlsWiki
Title: P, I, D, PI, PD, PID Control
Note:
Video lecture available for this section!
Authors: Ardemis Boghossian, James Brown, Sara Zak
Date Presented: October 19, 2006
Stewards: Ji Sun Sunny Choi, Sang Lee, Jennifer Gehle, Brian Murray, Razili Stanke-Koch, Kelly Martin, Lance Dehne, Sean Gant, Jay Lee, Alex Efta
Date Revised: October 6, 2007
Introduction
Process controls are necessary for designing safe and productive plants. A variety of process controls are used to manipulate processes, however the most simple and often most effective is the PID controller.
Much more practical than the typical on/off controller, PID controllers allow for much better adjustments to be made in the system. While this is true, there are some advantages to using an on/off controller:
-relatively simple to design and execute
-binary sensors and actuators (such as an on/off controller) are generally more reliable and less expensive
Although there are some advantages, there are large disadvantages to using an on/off controller scheme:
-inefficient (using this control is like driving with full gas and full breaks)
-can generate noise when seeking stability (can dramatically overshoot or undershoot a set-point)
-physically wearing on valves and switches (continuously turning valves/switches fully on and fully off causes them to become worn out much quicker)
To allow for much better control and fine-tuning adjustments, most industrial processes use a PID controller scheme.
The controller attempts to correct the error between a measured process variable and desired setpoint by calculating the difference and then performing a corrective action to adjust the process accordingly. A PID controller controls a process through three parameters: Proportional (P), Integral (I), and Derivative (D). These parameters can be weighted, or tuned, to adjust their effect on the process. The following section will provide a brief introduction on PID controllers as well as methods to model a controlled system in Excel.
The Process Gain(K) is the ratio of change of the output variable(responding variable) to the change of the input variable(forcing function). It specifically defines the sensitivity of the output variable to a given change in the input variable.
Gain can only be described as a steady state parameter and give no knowledge about the dynamics of the process and is independent of the design and operating variables. A gain has three components that include the sign, the value, the units. The sign indicates how the output responds to the process input. A positive sign shows that the output variable increases with an increase in the input variable and a negative sign shows that the output variable decreases with an increase in the input variable. The units depend on the process considered that depend on the variables mentioned.
Example:
The pressure was increased from 21psi to 29psi. This change increased the valve position from 30%vp to 22%vp.
K = (29-21)psi / ((22-30)%vp) = -1.0psi/(%vp)
Dead Time(t0) is the between the change in an input variable and when the output variable begins. Dead time is important because it effects the controllability of the control system. A change in set point is not immediate because of this parameter. Dead time must be considered in tuning and modeling processes.
Types of Control
Process controls are instruments used to control a parameter, such as temperature, level, and pressure. PID controllers are a type of continuous controller because they continually adjust the output vs. an on/off controller, when looking at feed forward or feed backward conditions. An example of a temperature controller is shown in Figure 1.
Figure 1. Temperature controller in a CSTR
P, I, D, PI, PD, PID Control
As previously mentioned, controllers vary in the way they correlate the controller input (error) to the controller output (actuating signal). The most commonly used controllers are the proportional- integral-derivative (PID) controllers. PID controllers relate the error to the actuating signal either in a proportional (P), integral (I), or derivative (D) manner. PID controllers can also relate the error to the actuating signal using a combination of these controls.
Proportional (P) Control
One type of action used in PID controllers is the proportional control. Proportional control is a form of feedback control. It is the simplest form of continuous control that can be used in a closed-looped system. P-only control minimizes the fluctuation in the process variable, but it does not always bring the system to the desired set point. It provides a faster response than most other controllers, initially allowing the P-only controller to respond a few seconds faster. However, as the system becomes more complex (i.e. more complex algorithm) the response time difference could accumulate, allowing the P-controller to possibly respond even a few minutes faster. Athough the P-only controller does offer the advantage of faster response time, it produces deviation from the set point. This deviation is known as the offset, and it is usually not desired in a process. The existence of an offset implies that the system could not be maintained at the desired set point at steady state. It is analogous to the systematic error in a calibration curve, where there is always a set, constant error that prevents the line from crossing the origin. The offset can be minimized by combining P-only control with another form of control, such as I- or D- control. It is important to note, however, that it is impossible to completely eliminate the offset, which is implicitly included within each equation.
Mathematical Equations
P-control linearly correlates the controller output (actuating signal) to the error (diference between measured signal and set point). This P-control behavior is mathematically illustrated in Equation 1 (Scrcek, et. al).
c(t) = controller output
Kc = controller gain
e(t) = error
b = bias
Figure 2. P-controller output for step input.
Integral (I) Control
Another type of action used in PID controllers is the integral control. Integral control is a second form of feedback control. It is often used because it is able to remove any deviations that may exist. Thus, the system returns to both steady state and its original setting. A negative error will cause the signal to the system to decrease, while a positive error will cause the signal to increase. However, I-only controllers are much slower in their response time than P-only controllers because they are dependent on more parameters. If it is essential to have no offset in the system, then an I-only controller should be used, but it will require a slower response time. This slower response time can be reduced by combining I-only control with another form, such as P or PD control. I-only controls are often used when measured variables need to remain within a very narrow range and require fine-tuning control. I controls affect the system by responding to accumulated past error. The philosophy behind the integral control is that deviations will be affected in proportion to the cumulative sum of their magnitude. The key advantage of adding a I-control to your controller is that it will eliminate the offset. The disadvantages are that it can destabilize the controller, and there is an integrator windup, which increases the time it takes for the controller to make changes.
Mathematical Equations
I-control correlates the controller output to the integral of the error. The integral of the error is taken with respect to time. It is the total error associated over a specified amount of time. This I-control behavior is mathematically illustrated in Equation 2 (Scrcek, et. al).

c(t) = controller output
Ti = integral time
e(t) = error
c(t0) = controller output before integration
Figure 3. I-controller output for step input.
Derivative (D) Control
Another type of action used in PID controllers is the derivative control. Unlike P-only and I-only controls, D-control is a form of feed forward control. D-control anticipates the process conditions by analyzing the change in error. It functions to minimize the change of error, thus keeping the system at a consistent setting. The primary benefit of D controllers is to resist change in the system, the most important of these being oscillations. The control output is calculated based on the rate of change of the error with time. The larger the rate of the change in error, the more pronounced the controller response will be.
Unlike proportional and integral controllers, derivative controllers do not guide the system to a steady state. Because of this property, D controllers must be coupled with P, I or PI controllers to properly control the system.
Mathematical Equations
D-control correlates the controller output to the derivative of the error. The derivative of the error is taken with respect to time. It is the change in error associated with change in time. This D-control behavior is mathematically illustrated in Equation 3 (Scrcek, et. al).

c(t) = controller output
Td = derivative time constant
de = change in error
dt = change in time
Figure 4. D-controller output for step input.
Controller Effects on a System
The following images are intended to give a visual representation of how P, I, and D controllers will affect a system.
Figure 5. Stable data sample.
Figure 6. Data disturbance.
Figure 7. P-controller effect on data.
Figure 8. I-controller effect on data.
Figure 9. D-controller effect on data.
Proportional-Integral (PI) Control
One combination is the PI-control, which lacks the D-control of the PID system. PI control is a form of feedback control. It provides a faster response time than I-only control due to the addition of the proportional action. PI control stops the system from fluctuating, and it is also able to return the system to its set point. Although the response time for PI-control is faster than I-only control, it is still up to 50% slower than P-only control. Therefore, in order to increase response time, PI control is often combined with D-only control.
Mathematical Equations
PI-control correlates the controller output to the error and the integral of the error. This PI-control behavior is mathematically illustrated in Equation 4 (Scrcek, et. al).
c(t) = controller output
Kc = controller gain
Ti = integral time
e(t) = error
C = initial value of controller
Figure 10. PI-controller output for step input.
Effects of Kc and Ti
With a PI control system, controller activity (aggressiveness) increases as Kc and Ti decreases, however they can act individually on the aggressiveness of a controller’s response. Consider Figure 11 below with the center graph being a linear second order system base case.
Figure 11. Effects of Kc and Ti [2]
The plot depicts how Ti and Kc both affect the performance of a system, whether they are both affecting it or each one is independently doing so. Regardless of integral time, increasing controller gain (moving form bottom to top on the plot) will increase controller activity. Similarly, decreasing integral time (moving right to left on the plot) will increase controller activity independent of controller gain. As expected, increasing Kc and decreasing Ti would compound sensitivity and create the most aggressive controller scenario.
With only two interacting parameters in PI control systems, similar performance plots can still cause confusion. For example, plots A and B from the figure both look very similar despite different parameters being affected in each of them. This could cause further problems and create a wildly aggressive system if the wrong parameter is being corrected. While trial and error may be feasible for a PI system, it becomes cumbersome in PID where a third parameter is introduced and plots become increasingly similar.
Another noteworthy observation is the plot with a normal Kc and double Ti. The plot depicts how the proportional term is practical but the integral is not receiving enough weight initially, causing the slight oscillation before the integral term can finally catch up and help the system towards the set point.
Proportional-Derivative (PD) Control
Another combination of controls is the PD-control, which lacks the I-control of the PID system. PD-control is combination of feedforward and feedback control, because it operates on both the current process conditions and predicted process conditions. In PD-control, the control output is a linear combination of the error signal and its derivative. PD-control contains the proportional control’s damping of the fluctuation and the derivative control’s prediction of process error.
Mathematical Equations
As mentioned, PD-control correlates the controller output to the error and the derivative of the error. This PD-control behavior is mathematically illustrated in Equation 5 (Scrcek, et. al).
c(t) = controller output
Kc = proportional gain
e = error
C = initial value of controller
Figure 12. PD-controller output for step input.
Proportional-Integral-Derivative (PID) Control
Proportional-integral-derivative control is a combination of all three types of control methods. PID-control is most commonly used because it combines the advantages of each type of control. This includes a quicker response time because of the P-only control, along with the decreased/zero offset from the combined derivative and integral controllers. This offset was removed by additionally using the I-control. The addition of D-control greatly increases the controller's response when used in combination because it predicts disturbances to the system by measuring the change in error. On the contrary, as mentioned previously, when used individually, it has a slower response time compared to the quicker P-only control. However, although the PID controller seems to be the most adequate controller, it is also the most expensive controller. Therefore, it is not used unless the process requires the accuracy and stability provided by the PID controller.
Mathematical Equations
PID-control correlates the controller output to the error, integral of the error, and derivative of the error. This PID-control behavior is mathematically illustrated in Equation 6 (Scrcek, et. al).
c(t) = controller output
Kc = controller gain
e(t) = error
Ti = integral time
Td = derivative time constant
C = intitial value of controller
Figure 7. PID-controller output for step input.
Note: Order of e(t)
The order of the elements in the e(t) can vary depending on the situation. It could be the fixed element minus the varying element or the other way around. To better illustrate the concept let's go to an example. Let's say you are creating a PID control to control the fluid level in a tank by manipulating the outlet valve. When the fluid level in the tank exceeds your set value, you will want the valve to open up more to allow more flow out of the tank. You are looking for a positive response. Therefore your e(t) should give a positive value when the fluid level is higher than the set. In this case your e(t) will be (V-Vset). The same logic can be used for other systems to determine what the e(t) should be in the PID controls.
Modeling PID Controllers With Euler in Excel
As with many engineering systems, PID controllers can be modeled in Excel via numerical methods such as Euler's Method. First begin with the initial value for a given parameter. Determine the change in that parameter at a certain time-step by summing the three controllers P, I, and D at that step, which are found using the equations listed in the P, I, D, PI, PD, PID Control section above. Take this change, multiply it by the chosen time-step and add that to the previous value of the parameter of interest. For more detailed information see Numerical ODE Solving in Excel. An example of a chemical engineering problem that uses this method can be seen in Example 4 below.
Troubleshooting PID Modeling in Excel
When setting up an Excel spreadsheet to model a PID controller, you may receive an error message saying that you have created a circular reference. Say you are controlling the flow rate of one reactant (B) to a reactor which is dependent upon the concentration of another reactant (A) already inside the reactor. Your PID equations look as follows:
After you have set up your columns for A - Aset, d(A - Aset)/dt, xi, and the cells for your parameters like Kc, taui and taud, you will need to set up your PID column with your PID equation in it. After entering your equation into the first cell of the PID column, you may receive the Circular Reference error message when trying to drag the equation down to the other cells in your column.
There are two things you can do:
- It is likely that you need to start your PID equation in the second or third cell of your PID column. Enter reasonable values into the first couple of cells before you start the PID equation, and you will find that these values shouldn’t affect the end result of your controller.
- You can also try decreasing the step size (Δt).
Summary Tables
A summary of the advantages and disadvantages of the three controls is shown below is shown in Table 1.
A guide for the typical uses of the various controllers is shown below in Table 2.
A summary of definitions of the terms and symbols are shown below in Table 3.
Example 1
Hypothetical Industries has just put you in charge of one of their batch reactors. Your task is to figure out a way to maintain a setpoint level inside of the reactor. Your boss wants to use some type regulator controller, but he is not quite sure which to use. Help your boss find the right type of controller. It is extremely important that the level inside the reactor is at the setpoint. Large fluctuation and error cannot be tolerated.
SOLUTION:
You would want to use a PID controller. Because of the action of P control, the system will respond to a change very quickly. Due to the action of I control, the system is able to be returned to the setpoint value. Finally, because it is so critical for the system to remain at a constant setpoint, D control will measure the change in the error, and help to adjust the system accordingly.
Example 2
You go back to your high school and you notice an oven in your old chemistry class. The oven is used to remove water from solutions. Using your knowledge from ChE 466, you begin to wonder what type of controller the oven uses to maintain its set temperature. You notice some high school students eager to learn, and you decide to share your knowledge with them in hopes of inspiring them to become Chemical Engineers. Explain to them the type of controller that is most likely located within the oven, and how that controller works.
SOLUTION:
Since the oven is only used to remove water from a solution, fluctuation, error, and lag between the set point and the actual temperature are all acceptable. Therefore, the easiest and simplest controller to use would be the On-Off controller.
The On-Off controller turns on the heating mechanism when the temperature in the oven is below the setpoint temperature. If the temperature of the oven increases above the set temperature, the controller will turn the heating mechanism off.
Example 3
Having taken your advice, your boss at Hypothetical Industries decides to install a PID controller to control the level in the batch reactor. When you first start up the reactor, the controller initially received a step input. As the reactor achieves steady state, the level in the reactor tends to fluctuate, sending pulse inputs into the controller. For a pulse input, provide a grahical representation of the PID controller output.
Figure 8. Pulse input.
Figure 9. P-controller output for pulse input.
Figure 10. I-controller output for pulse input.
Figure 11. D-controller output for pulse input.
Figure 12. PID-controller output for pulse input.
Example 4
Different kinds of disturbances are possible when determining the PID controller robustness. These different disturbances are used to simulate changes that might occur within your system. For a CSTR reactor, you decide to heat up your system to account for the cold outside weather. The disturbance in the input temperature is a ramp disturbance, as shown in figure #. If the controller responds to the input temperature, what will be the PID controller output?
Figure 13. Ramp input.
Figure 14. P-controller output for ramp input.
Figure 15. I-controller output for ramp input.
Figure 16. D-controller output for ramp input.
Figure 17. D-controller output for ramp input.
Example 5
Following is a P&ID of the process A+B-->C.
SOLUTION: The general equation for a PID controller is:
c(t) = controller output
Kc = controller gain
e(t) = error
Ti = integral time
Td = derivative time constant
C = intitial value of controller
Multiple Choice Question 1
What type of controller is displayed by the equation below?
![c(t)=K_c[e(t) + \textstyle \frac{1}{T_i} \int e(t) dt]](/wiki/images/math/0/e/5/0e5cd924a600d7ade695fdc7962caa37.png)
a.) Feedforward
b.) PID
c.) Derivative
d.) Proportional Integral
Multiple Choice Question 2
Which type of controller increases the stability of the system by keeping it at a consistent setting?
a.) Derivative
b.) Proportional
c.) On-Off
d.) Integral
Multiple Choice Question 3
Which type of controller increases the speed of response to reach the desired set point the fastest while eliminating offset?
a.) On-Off
b.) Proportional
c.) Integral
d.) Proportional-Integral
Example 4
- Note that the problem and values used in it are fictional!*
A microbiology laboratory discovered a deadly new strain of bacteria, named P. Woolfi, in the city's water supply. In order to sterilize the water, the bacteria has to be heat killed at a temperature of 105 degrees Celsius. However, this is above the boiling point of water at 1 atm and the bacteria is only susceptible to heat when in liquid due to spore formation when in gas or vapor. To accomplish this sterilization it was suggested that an auto-clave be used to keep the water in the liquid state by keeping it at a pressure of 5 atm while heated for 30 seconds. The auto-clave can only handle up to 7 atm of pressure before exploding, so to ensure that the process is running at the desired specifications, a PID Controller Model must be created in Excel. See figure 18 for a visual of the system.
Figure 18.Auto-clave with PID Controls for Temperature and Pressure
Sage's Corner
Super PID Brothers
Multiple Choice
Glucose Level
Glucose Level Slides without narration
References
[1] Astrom, Karl J., Hagglund, Tore., "Advanced PID Control", The Instrumentation, Systems and Automation Society. [2] Cooper, Douglas J. "Practical Process Control E-Textbook " http://www.controlguru.com [3] Scrcek, William Y., Mahoney, Donald P., Young, Brent R. "A Real Time Approach to Process Control", 2nd Edition. John Wiley & Sons, Ltd. [4] www.wikipedia.org
























