PID controller

From Free net encyclopedia

(Redirected from Feedback controller)

Template:Wikify-date A proportional-integral-derivative controller (PID controller) is a common feedback loop component in industrial control applications (see also control theory and closed-loop controller).

The controller compares a measured value from a process with a reference setpoint value. The difference or "error" signal is then processed to calculate a new value for a manipulated process input, which new value then brings the process measured value back to its desired setpoint. Unlike simpler control algorithms, the PID controller can adjust process inputs based on the history and rate of change of the error signal, which gives more accurate and stable control. It can be shown mathematically that a PID loop will produce accurate stable control in cases where other control algorithms would either have a steady-state error or would cause the process to oscillate.

Contents

Control loop basics

The PID loop tries to automate what an operator with a gauge and a control knob would do. The operator would read a gauge showing the output of a process, and use the knob to adjust the input of the process until the process's output stabilizes at the desired value on the gauge. In older control literature this adjustment process is called a "reset" action. The position of the needle on the gauge is a "measurement." The desired value on the gauge is called a "setpoint." The distance between the gauge's needle and the setpoint is the "error."

A control loop consists of three parts:

  1. Measurement by a sensor connected to the process,
  2. Decision in a controller element,
  3. Action through an output device ("actuator") such as a control valve.

So, the controller reads a sensor. Then it subtracts this measurement from a desired value, the "setpoint," to determine an "error". It then uses the error to calculate a correction to the process's input variable so that the correction will remove error from the process's output measurement. It then adds the correction to the process's input variable to remove errors from the process's output.

In a PID loop, the correction that's added is calculated from the error in three ways, to cancel out the present error, average out past errors, and anticipate the future a bit from the slope of the error(s) over time.

For example, suppose a water tank is used to supply water for several parts of a plant and it is necessary to control the tank level at a constant value. A sensor would measure the height of water in the tank, this produces the "process variable" measurement. The controller would have an input connected to this process variable and an input to represent the desired level in the tank, say, 65% full. The controller would then have its output connected to a motor-operated valve connected to the water supply. Opening the valve would fill the tank, closing the valve would allow the level to decrease. The control signal to the valve would be the "manipulated variable" and represent an input to the "process" of keeping the tank level constant.

A PID controller can be used to control any measurable variable which can be affected by manipulating some other process variable. For example, it can be used to control temperature, pressure, flow rate, chemical composition, speed, or other variables. Automobile cruise control is an example of an application area outside of the process industries.

Some control systems arrange PID controllers in cascades or networks. That is, a "master" control, may produce signals used by other controllers. One common example is that in motor controls, one often wants the motor to have a controlled speed and end up in a controlled position. So, one "slave" controller manages the speed, but the "slave's" speed is set (up to some maximum, usually) by the "master" controller that manages the motor's position.

Coupled and cascaded controls are common in chemical process control, HVAC and other systems where many parts cooperate.

Theory

The PID loop adds negative corrections, removing error from the process's controllable variable (its input).

Some persons use different terms: The "process variable" is also called the "process's input" or "controller's output." The process's output is also called the "measurement" or "controller's input."

This up a bit, down a bit movement of the process's input variable is how the PID loop automatically finds the correct level of input for the process. Removing the error "turns the control knob," adjusting the process's input to keep the process's measured output at the setpoint.

The error is found by subtracting the measured quantity from the setpoint.

"PID" is named after its three correcting calculations, which all add to and adjust the controlled quantity. These additions are actually "subtractions" of error, because the proportions are usually negative:

  1. Proportional - To handle the present, the error is multiplied by a (negative) constant P (for "proportional"), and added to (subtracting error from) the controlled quantity. P is only valid in the band over which a controller's output is proportional to the error of the system. For example, for a heater, a controller with a proportional band of 10 °C and a setpoint of 20 °C would have an output of 100% at 10 °C, 50% at 15 °C and 10% at 19 °C. Note that when the error is zero, a proportional controller's output is zero.
  2. Integral - To handle the past, the error is integrated (added up) over a period of time, and then multiplied by a (negative) constant I (making an average), and added to (subtracting error from) the controlled quantity. I averages the measured error to find the process output's average error from the setpoint. A simple proportional system oscillates, moving back and forth around the setpoint, because there's nothing to remove the error when it overshoots. By adding a negative proportion of (i.e. subtracting part of) the average error from the process input, the average difference between the process output and the setpoint is always being reduced. Therefore, eventually, a well-tuned PID loop's process output will settle down at the setpoint.
  3. Derivative - To handle the future, the first derivative (the slope of the error) over time is calculated, and multiplied by another (negative) constant D, and also added to (subtracting error from) the controlled quantity. The derivative term controls the response to a change in the system. The larger the derivative term, the more rapidly the controller responds to changes in the process's output. Its D term is the reason a PID loop is also called a "Predictive Controller". The D term is a good thing to reduce when trying to dampen a controller's response to short term changes. Practical controllers for slow processes can even do without D.

More technically, a PID loop can be characterized as a filter applied to a frequency-domain system. This is useful in order to calculate whether it will actually reach a stable value. If the values are chosen incorrectly, the controlled process input can oscillate, and the process output may never stay at the setpoint.

The generic transfer function for a PID controller of the interacting form is

<math>H(s)=P\frac{Ds^2+s+I}{s+C}</math>,

with C being a constant which depends on the bandwidth of the controlled system.

Nomenclature

The parameters of PID control were originally named after the adjustments on mechanical controllers and so were called proportional band, reset and rate. These quantities are based on the interacting algorithm. Modern practice is to refer to gain, integral gain, and derivative gain since this better matches the usage in digital controllers.

There are two different forms of the PID controller:

  • The standard or "non-interacting" form, which allows independent adjustment of the proportional, integral and derivative constants.
  • The series or "interacting" form. The series or "interacting" algorithm applies the gain term to both integral and derivative terms (think of a PD and PI controller in series); this is effectively how older pneumatic and analog electronic controllers worked. It is the more restricted form of the two. The series form is said to be the most intuitive to tune by hand and is the classical form.

Gain and proportional band are related but inverse quantities. A controller setting of 100% proportional band means that a 100% change of the error signal (setpoint-process variable) will result in 100% change of the output, which is a gain of 1.0. A 20% proportional band indicates that 20% change in error gives a 100% output change, which is a gain of 5.

The reset and rate values are scaled based on the proportional band of the interacting control algorithm. Reset is measured in minutes to correct the output by the proportional band. Rate is measured in proportional band/minute.

Tuning a PID loop

"Tuning" a control loop is the adjustment of its control parameters (gain/proportional band, integral/reset, derivative/rate) to the optimum values for the desired control response. The optimum behavior on a process change or setpoint change varies depending on the application. Some processes must not allow an overshoot of the process variable from the setpoint. Other processes must minimize the energy expended in reaching a new setpoint. Generally stability of response is required and the process must not oscillate for any combination of process conditions and setpoints. Tuning of loops is made more complicated by the response time of the process; it may take minutes or hours for a setpoint change to produce a stable effect. Some processes have a degree of non-linearity and so parameters that work well at full-load conditions don't work when the process is starting up from no-load. This section describes some traditional manual methods for loop tuning.

There are several methods for tuning a PID loop. The choice of method will depend largely on whether or not the loop can be taken "offline" for tuning, and the response speed of the system. If the system can be taken offline, the best tuning method often involves subjecting the system to a step change in input, measuring the output as a function of time, and using this response to determine the control parameters.

If the system must remain online, one tuning method is to first set the I and D values to zero. Increase the P until the output of the loop oscillates. Then increase I until oscillation stops. Finally, increase D until the loop is acceptably quick to reach its reference. A fast PID loop tuning usually overshoots slightly to reach the setpoint more quickly; however, some systems cannot accept overshoot.

Effects of increasing parameters
ParameterRise TimeOvershootSettling TimeS.S. Error
PDecreaseIncreaseSmall ChangeDecrease
IDecreaseIncreaseIncreaseEliminate
DSmall ChangeDecreaseDecreaseSmall Change

Another tuning method is formally known as the "Ziegler-Nichols method". It starts in the same way as the method described before: first set the I and D gains to zero and then increase the P gain until the output of the loop starts to oscillate. Write down the critical gain (Kc) and the oscillation period of the output (Pc). Then adjust the P, I and D controls as the table shows:

Ziegler-Nichols method
ControlPTrTd
P0.5·Kc--
PI0.45·KcPc/1.2-
PID0.6·KcPc/2Pc/8

Most modern industrial facilities no longer tune loops using the manual calculation methods shown above. Instead, PID tuning and loop optimization software are used to ensure consistent results. These software packages will gather the data, develop process models, and suggest optimal tuning. Some software packages can even develop tuning by gathering data from reference changes.

Mathematical PID loop tuning induces an impulse in the system, and then uses the controlled system's frequency response to design the PID loop values. In loops with response times of several minutes, mathematical loop tuning is recommended, because trial and error can literally take days just to find a stable set of loop values. Optimal values are harder to find, and yet can save a company huge amounts of money. Commercial software is available from several sources, and can easily pay for itself if a PID loop runs a large, or expensive process. Some digital loop controllers offer a self-tuning feature in which very small setpoint changes are sent to the process, allowing the controller itself to calculate optimal tuning values.

Problems

The PID controller algorithm itself has few problems. Most problems arise from instrumentation connected to the controller.

One common problem is "integral windup". It might take too long for the output value to ramp up to the necessary value when the loop first starts up. Sometimes this can be fixed with a more aggressive differential term. Sometimes the loop has to be "preloaded" with a starting output. Another option is to disable the integral function until the measured variable has entered the proportional band.

Some PID loops control a valve or similar mechanical device. Wear of the valve or device can be a major maintenance cost. In these cases, the PID loop may have a "deadband." The calculated output must leave the deadband before the actual output will change. Then, a new deadband will be established around the new output value.

Another problem with the differential term is that small amounts of noise can cause large amounts of change in the output. Sometimes it's helpful to filter the measurements, with a running average, or a low-pass filter. However, low-pass filtering and derivative control cancel each other out, so reducing noise by instrumentation means is a much better choice. Alternatively, the differential band can be turned off in most systems with little loss of control. This is equivalent to using the PID controller as a PI controller.

The proportional and differential terms can also produce undesirable results in systems subjected to instantaneous "step" inputs (such as when a computer changes the setpoint). To avoid this, some PID algorithms incorporate various schemes:

  1. derivative of output Many industrial PID systems actually measure the differential of the output quantity, which is always continuous (i.e., never has a step function), and usually moves in the same direction as the error.
  2. setpoint weighting Setpoint weighting uses several setpoints. The errors from the two setpoints are combined to reduce upsets. Some schemes slowly reduce the proportion of error from an "old" setpoint, and increase the proportion of error from a "new" setpoint. Other schemes have multiple setpoints controlled by different outside controllers. The error in the integral term must be the true control error to avoid steady-state control errors. These parameters do not affect the response to load disturbances and measurement noise.

Digital implementations of a PID algorithm may have limitations owing to the sampling rate of the data, and the limits of internal calculation and precision. For example, very old PLC systems may have used only 12 or 16 bits for internal variables, with limited precision. Some software implementations do not correctly handle internal overflow or extreme values, or may arbitrarily limit the values for the adjustable gain parameters.

Another problem faced with PID controllers is that they are linear. Thus performance of PID controllers in non-linear systems (such as HVAC systems) is variable. Often PID controllers are enhaced through methods such as scheduling or fuzzy logic.

How to get one

A PID loop can be implemented with any physical system that can produce ratiometric behavior and integration.

Software PID loops are the most stable, because they do not wear out, and their high expense has been decreasing. PID controller functionality is a common feature of programmable logic controllers (PLC), and that's how most factories buy them.

A PID controller can also be purchased for industrial uses as a panel-mounted controller. These often control only one or two loops and are still applied for small stand-alone systems where a PLC or computer control is unnecessary.

In the early history of automatic process control the PID controller was implemented as a mechanical device, often energized by compressed air. Mechanical systems (once the cheapest) can use a lever, spring and a mass. Pneumatic controllers were once common, but have been largely replaced by digital electronic controllers.

Electronic analog controllers are now very cheap, and can be made from a solid-state or tube amplifier, a capacitor and a resistance. Electronic analog PID control loops are often found within more complex electronic systems, for example, the head positioning of a disk drive, the power conditioning of a power supply, or even the movement-detection circuit of a modern seismometer.

External links

es:Proporcional integral derivativo (PID) ja:PID制御 nl:PID regelaar pl:regulator PID fi:PID-säädin zh:PID控制器