IPC
IPC
IPC
P
r
o
p
o
r
t
i
o
n
a
l
t
e
r
m
• 2
.
2
[edit] Control loop basics
Further information: Control loop
A familiar example of a control loop is the action taken when adjusting hot and cold faucet valves to
maintain the faucet water at the desired temperature. This typically involves the mixing of two process
streams, the hot and cold water. The person touches the water to sense or measure its temperature.
Based on this feedback they perform a control action to adjust the hot and cold water valves until the
process temperature stabilizes at the desired value.
Sensing water temperature is analogous to taking a measurement of the process value or process
variable (PV). The desired temperature is called the setpoint (SP). The input to the process (the water
valve position) is called the manipulated variable (MV). The difference between the temperature
measurement and the setpoint is the error (e) and quantifies whether the water is too hot or too cold and
by how much.
After measuring the temperature (PV), and then calculating the error, the controller decides when to
change the tap position (MV) and by how much. When the controller first turns the valve on, it may
turn the hot valve only slightly if warm water is desired, or it may open the valve all the way if very hot
water is desired. This is an example of a simple proportional control. In the event that hot water does
not arrive quickly, the controller may try to speed-up the process by opening up the hot water valve
more-and-more as time goes by. This is an example of an integral control.
Making a change that is too large when the error is small is equivalent to a high gain controller and will
lead to overshoot. If the controller were to repeatedly make changes that were too large and repeatedly
overshoot the target, the output would oscillate around the setpoint in either a constant, growing, or
decaying sinusoid. If the oscillations increase with time then the system is unstable, whereas if they
decrease the system is stable. If the oscillations remain at a constant magnitude the system is
marginally stable.
In the interest of achieving a gradual convergence at the desired temperature (SP), the controller may
wish to damp the anticipated future oscillations. So in order to compensate for this effect, the controller
may elect to temper their adjustments. This can be thought of as a derivative control method.
If a controller starts from a stable state at zero error (PV = SP), then further changes by the controller
will be in response to changes in other measured or unmeasured inputs to the process that impact on the
process, and hence on the PV. Variables that impact on the process other than the MV are known as
disturbances. Generally controllers are used to reject disturbances and/or implement setpoint changes.
Changes in feedwater temperature constitute a disturbance to the faucet temperature control process.
In theory, a controller can be used to control any process which has a measurable output (PV), a known
ideal value for that output (SP) and an input to the process (MV) that will affect the relevant PV.
Controllers are used in industry to regulate temperature, pressure, flow rate, chemical composition,
speed and practically every other variable for which a measurement exists.
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 (see the section on loop tuning). In
contrast, a small gain results in a small output response to a large input error, and a less responsive (or
sensitive) controller. If the proportional gain is too low, the control action may be too small when
responding to system disturbances.
[edit] Droop
A pure proportional controller will not always settle at its target value, but may retain a steady-state
error. Specifically, the process gain - drift in the absence of control, such as cooling of a furnace
towards room temperature, biases a pure proportional controller. If the process gain is down, as in
cooling, then the bias will be below the set point, hence the term "droop".
Droop is proportional to process gain and inversely proportional to proportional gain. Specifically the
steady-state error is given by:
e = G / Kp
Droop is an inherent defect of purely proportional control. Droop may be mitigated by adding a
compensating bias term (setting the setpoint above the true desired value), or corrected by adding an
integration term (in a PI or PID controller), which effectively computes a bias adaptively.
Despite droop, both tuning theory and industrial practice indicate that it is the proportional term that
should contribute the bulk of the output change.
The integral term (when added to the proportional term) accelerates the movement of the process
towards setpoint and eliminates the residual steady-state error that occurs with a proportional only
controller. However, since the integral term is responding to accumulated errors from the past, it can
cause the present value to overshoot the setpoint value (cross over the setpoint and then create a
deviation in the other direction). For further notes regarding integral gain tuning and controller stability,
see the section on loop tuning.
The derivative term slows the rate of change of the controller output and this effect is most noticeable
close to the controller setpoint. Hence, derivative control is used to reduce the magnitude of the
overshoot produced by the integral component and improve the combined controller-process stability.
However, differentiation of a signal amplifies noise and thus 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. Hence an approximation to a differentiator with a limited
bandwidth is more commonly used. Such a circuit is known as a Phase-Lead compensator.
[edit] 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:
where the tuning parameters are:
Proportional gain, Kp
Larger values typically 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.
[edit] Stability
If the PID controller parameters (the gains of the proportional, integral and derivative terms) are chosen
incorrectly, the controlled process input can be unstable, i.e. its output diverges, with or without
oscillation, and is limited only by saturation or mechanical breakage. Instability is caused by excess
gain, particularly in the presence of significant lag.
Generally, stability of response (the reverse of instability) is required and the process must not oscillate
for any combination of process conditions and setpoints, though sometimes marginal stability (bounded
oscillation) is acceptable or desired.
[edit] Optimum behavior
The optimum behavior on a process change or setpoint change varies depending on the application.
Two basic requirements are regulation (disturbance rejection – staying at a given setpoint) and
command tracking (implementing setpoint changes) – these refer to how well the controlled variable
tracks the desired value. Specific criteria for command tracking include rise time and settling time.
Some processes must not allow an overshoot of the process variable beyond the setpoint if, for
example, this would be unsafe. Other processes must minimize the energy expended in reaching a new
setpoint.
Many PID loops control a mechanical device (for example, a valve). Mechanical maintenance can be a
major cost and wear leads to control degradation in the form of either stiction or a deadband in the
mechanical response to an input signal. The rate of mechanical wear is mainly a function of how often
a device is activated to make a change. Where wear is a significant concern, the PID loop may have an
output deadband to reduce the frequency of activation of the output (valve). This is accomplished by
modifying the controller to hold its output steady if the change would be small (within the defined
deadband range). The calculated output must leave the deadband before the actual output will change.
The proportional and derivative terms can produce excessive movement in the output when a system is
subjected to an instantaneous step increase in the error, such as a large setpoint change. In the case of
the derivative term, this is due to taking the derivative of the error, which is very large in the case of an
instantaneous step change. As a result, some PID algorithms incorporate the following modifications:
Derivative of output
In this case the PID controller measures the derivative of the output quantity, rather than the
derivative of the error. The output is always continuous (i.e., never has a step change). For this to
be effective, the derivative of the output must have the same sign as the derivative of the error.
Setpoint ramping
In this modification, the setpoint is gradually moved from its old value to a newly specified value
using a linear or first order differential ramp function. This avoids the discontinuity present in a
simple step change.
Setpoint weighting
Setpoint weighting uses different multipliers for the error depending on which element of the
controller it is used in. The error in the integral term must be the true control error to avoid
steady-state control errors. This affects the controller's setpoint response. These parameters do not
affect the response to load disturbances and measurement noise.
[edit] History
This section requires expansion.
[edit] Linearity
Another problem faced with PID controllers is that they are linear, and in particular symmetric. Thus,
performance of PID controllers in non-linear systems (such as HVAC systems) is variable. For
example, in temperature control, a common use case is active heating (via a heating element) but
passive cooling (heating off, but no cooling), so overshoot can only be corrected slowly – it cannot be
forced downward. In this case the PID should be tuned to be overdamped, to prevent or reduce
overshoot, though this reduces performance (it increases settling time).
[edit] Noise in derivative
A problem with the derivative term is that small amounts of measurement or process noise can cause
large amounts of change in the output. It is often helpful to filter the measurements with a low-pass
filter in order to remove higher-frequency noise components. However, low-pass filtering and
derivative control can cancel each other out, so reducing noise by instrumentation means is a much
better choice. Alternatively, a nonlinear median filter may be used, which improves the filtering
efficiency and practical performance [9]. In some case, the differential band can be turned off in many
systems with little loss of control. This is equivalent to using the PID controller as a PI controller.
[edit] Improvements
[edit] Feed-forward
The control system performance can be improved by combining the feedback (or closed-loop) control
of a PID controller with feed-forward (or open-loop) control. Knowledge about the system (such as the
desired acceleration and inertia) can be fed forward and combined with the PID output to improve the
overall system performance. The feed-forward value alone can often provide the major portion of the
controller output. The PID controller can be used primarily to respond to whatever difference or error
remains between the setpoint (SP) and the actual value of the process variable (PV). Since the feed-
forward output is not affected by the process feedback, it can never cause the control system to
oscillate, thus improving the system response and stability.
For example, in most motion control systems, in order to accelerate a mechanical load under control,
more force or torque is required from the prime mover, motor, or actuator. If a velocity loop PID
controller is being used to control the speed of the load and command the force or torque being applied
by the prime mover, then it is beneficial to take the instantaneous acceleration desired for the load,
scale that value appropriately and add it to the output of the PID velocity loop controller. This means
that whenever the load is being accelerated or decelerated, a proportional amount of force is
commanded from the prime mover regardless of the feedback value. The PID loop in this situation uses
the feedback information to change the combined output to reduce the remaining difference between
the process setpoint and the feedback value. Working together, the combined open-loop feed-forward
controller and closed-loop PID controller can provide a more responsive, stable and reliable control
system.
with
.
This form essentially consists of a PD and PI controller in series, and it made early (analog) controllers
easier to build. When the controllers later became digital, many kept using the interacting form.
[edit] Pseudocode
Here is a simple software loop that implements the PID algorithm in its 'ideal, parallel' form:
previous_error = 0
integral = 0
start:
error = setpoint - actual_position
integral = integral + (error*dt)
derivative = (error - previous_error)/dt
output = (Kp*error) + (Ki*integral) + (Kd*derivative)
previous_error = error
wait(dt)
goto start
[edit] PI controller
Basic block of a PI controller.
A PI Controller (proportional-integral controller) is a special case of the PID controller in which the
derivative (D) of the error is not used.
The controller output is given by
where Δ is the error or deviation of actual measured value (PV) from the set-point (SP).
Δ = SP - PV.
A PI controller can be modelled easily in software such as Simulink using a "flow chart" box involving
Laplace operators:
where
G = KP = proportional gain
G / τ = KI = integral gain
Setting a value for G is often a trade off between decreasing overshoot and increasing settling time.
The lack of derivative action may make the system more steady in the steady state in the case of noisy
data. This is because derivative action is more sensitive to higher-frequency terms in the inputs.
Without derivative action, a PI-controlled system is less responsive to real (non-noise) and relatively
fast alterations in state and so the system will be slower to reach setpoint and slower to respond to
perturbations than a well-tuned PID system may be.