See the following figure for an example of a PID controller.
PID is a generic closed-loop control mechanism used in many industrial control systems. PID is the most commonly used feedback controller in use today. A controller that implements PID mode continuously calculates the difference or error signal between a measured process variable (PV) and a preferred setpoint (SP). The PID controller adjusts the process control inputs to minimize this error, referred to as the manipulated variable (MV).
- Proportional
- Integral
- Derivative
If you tune the PID parameters or constants in the algorithm, the controller can provide control action designed for specific process requirements. The response of the controller can be described in terms of the responsiveness of the controller to an error, the degree to which the controller overshoots the setpoint, and the degree of system oscillation. Some applications may require use of one or two terms to provide the appropriate system control. This is achieved by setting the constants of the unneeded control outputs to zero.
The variations include PI, PD, P, or I controllers in the absence of the respective control actions. PI controllers are relatively common, since the derivative term is sensitive to measurement noise, whereas the absence of an integral value may prevent the system from reaching its target value due to the control action.
Control loop basics
A typical example of a closed-loop control scheme is when the adjusted hot and cold faucet valves maintain the water from the faucet at a required temperature. This involves the combination of the two hot and cold water process streams. You can use the water combination to measure the temperature. Based on this feedback of measured water temperature, you can perform a control action to adjust the hot and cold water valves until the process temperature stabilizes at the preferred value. Measured water temperature is the same as measurement of the PV, while the temperature is referred to as the SP. The input to the process (water valve position) refers to the MV. The difference between the measured temperature and the setpoint is the error and quantifies whether the water is too hot or too cold, and by how much the measured temperature deviates from the setpoint temperature.
After the temperature is measured (PV), and the error is calculated, the controller can change the tap position (MV). When the valve is turned on, the controller can turn the hot valve only slightly if warm water is required, or the controller can open the valve all the way if very hot water is required. This is an example of proportional control. In the event that hot water does not arrive quickly, the controller can open the hot water valve more to speed up the process.
PID controller theory
The PID closed-loop control scheme is named after its three correcting terms, whose sum constitutes the manipulated variable (MV):
Where P_{out}, I_{out}, and D_{out} are the contributions to the output from the PID controller from each of the three terms.
Proportional term
The proportional term, also referred to as gain, makes a change to the output that is proportional to the current error value. To adjust the proportional response, multiply the error by the proportional gain constant, Kp. Use the following formula to calculate the proportional term of the output.
Where:
- Kp: proportional constant (tuning parameter)
- SP: setpoint or preferred value
- PV: process variable or measured value
- e: error = SP – PV
- t: time or instantaneous time (the present)
A high proportional gain results in a large change in the output for a given change in the error. If the proportional gain is too high, the system can become unstable. In contrast, a small gain results in a small output response to a large input error, and a slower, less responsive controller. If the proportional gain is too low, the control action may be too small when it responds to system disturbances. For most closed-loop control schemes, the proportional gain contributes the bulk of the output change.
Integral term
The integral term, also referred to as reset, is proportional to both the magnitude of the error and the duration of the error. Summing the instantaneous error over time, or error integration, gives the accumulated offset that was corrected previously. The accumulated error is multiplied by the integral gain and added to the controller output. The integral gain Ki determines the magnitude of the contribution of the integral term to the overall control action. .
The integral term is given by:
Where:
- Ki: integral constant (tuning parameter)
- SP: setpoint or preferred value
- PV: process variable or measured value
- e: error = SP – PV
- t: time or instantaneous time (the present)
- τ: dummy integration variable
The integral term, when added to the proportional term calculated above, accelerates the movement of the process towards setpoint and eliminates the residual steady-state error that occurs with a proportional-only control scheme. However, since the integral term responds to accumulated errors from the past, it can cause the present value to overshoot the setpoint value and cross over the setpoint and then create a deviation in the other direction.
Derivative term
To calculate the rate of change of the process error, the slope of the error is determined over time with its first derivative with respect to time. Multiply this rate of change by the derivative gain Kd. The magnitude of the contribution of the derivative term, also called rate, to the overall control action is termed the derivative gain, Kd.
The derivative term is given by:
where
- Kd: derivative constant (tuning parameter)
- SP: setpoint or preferred value
- PV: process variable or measured value
- e: error = SP – PV
- t: time or instantaneous time (the present)
The derivative term slows the rate of change of the controller output. This effect is most noticeable close to the controller setpoint. Therefore, derivative control can reduce the magnitude of the overshoot produced by the integral component and improve the combined controller-process stability. However, the differentiation of a signal amplifies noise, This term in the controller is highly sensitive to noise in the error term and can cause a process to become unstable if the noise and the derivative gain are sufficiently large.
Summary
The proportional, integral, and derivative terms are summed to calculate the output of the PID controller. Defining u(t) as the controller output, the final form of the PID algorithm is:
- Proportional gain, Kp: Larger values mean faster response since the larger the error, the larger the proportional term compensation. An excessively large proportional gain will lead to process instability and oscillation.
- Integral gain, Ki: Larger values imply steady-state errors are eliminated more quickly. The trade-off is larger overshoot: any negative error integrated during transient response must be integrated away by positive error before reaching steady-state.
- Derivative gain, Kd: Larger values decrease overshoot, but slow down transient response and may lead to instability due to signal noise amplification in the differentiation of the error.