Principles of PID Controllers

Principles of PID Controllers

7 minutes, 22 seconds Read

Introduction

Self-regulating systems using feedback loops, i.e. the routing back of the output of a system to its input, have existed since antiquity and have nowadays become an integral part of modern technology. One of the first attempts to rigorously describe control loops using feedback traces back to more than 150 years ago with James Clark Maxwell’s article, On Governors[1].

In the context of control strategies, an open-loop control system refers to a controller whose action is determined based on predetermined input values without considering feedback. In contrast, a closed-loop controller incorporates continuous feedback, enabling real-time adjustments to enhance precision, stability, and robustness, making it more suitable for achieving desired control objectives in changing conditions.

Today, the most widespread type of closed-loop control systems is the Proportional–Integral–Derivative (PID) controller. These types of controllers continuously measure and adjust the output of a system to match a desired setpoint, that is, a given target condition for the system or process under consideration. Requiring little prior knowledge or model of the system, PID controllers are extremely versatile, relatively cost effective and straightforward to implement, making their realization possible in a large variety of systems: from hydraulics and pneumatics to analog and digital electronics.

For this reason, they have become extensively used in a variety of industries and research applications, including manufacturing, photonics, sensors, material science and nanotechnology.

PID control loops are widely employed in various aspects of everyday-life and industrial automation, such as the gyroscopes found in smartphones and self-navigating cars, ovens used for cooking food or samples, flow controllers in pipes, and even in managing the daily vehicle traffic.

At the same time, their presence stands out in more advanced research fields as well, for example in the stabilization of laser cavities and interferometers in optics and photonics, in closed-loop control of MEMS-based (micro-electromechanical systems) gyroscopes, and in the characterization of mechanical resonators in scanning probe microscopy (SPM).

This white paper presents the key functions and principles of PID control loops by analyzing their basic building blocks, by describing their strengths and limitations, and by outlining the tuning and designing strategies and how they can be easily implemented with Zurich Instruments’ lock-in amplifiers.

PID Working Principle and Building Blocks

The goal of a PID controller is to produce a control signal that can dynamically minimize the difference between the output and the desired setpoint of a certain system.

Let’s consider the exemplary scheme depicted in Figure 1. As a first step, the output of the system y(t) is looped back and measured against the setpoint r(t) by the comparator, thereby generating the time-dependent error signal e(t) = r(t) – y(t). Subsequently, this error signal is minimized by the loop filter and then used to generate the control signal u(t) that drives the output of the system, initiating closed-loop operation. These steps are continuously executed to minimize the error; hence, apart from considering the current error, it is also relevant to consider its accumulation over time (represented by the integral) and its future tendency (represented by the derivative at time t), as shown in Figure 2.

In the most general case, error minimization is accomplished by means of the three primary components of the PID controller loop filter: the proportional, integral, and derivative terms.

Mathematically, the complete control function in its most general form can be written as the sum of the three individual contributions:

(mathrm{u(t) =u_P(t) + u_I(t) + u_D(t)} \ = mathrm{K_p e(t) + K_iint_{0}^{t}{e(tau)dtau} + K_dfrac{d}{dt}e(t)})

where Kp, Ki and Kd are the gain coefficients related to the proportional, integral, and derivative terms, respectively.

White Paper PID Figure 1

Figure 1: Schematic representation of a general PID control loop in its most general form.


White Paper PID Figure 2

Figure 2: Example of error function with the highlighted contributions of the P, I and D terms.

The proportional term

The proportional term, denoted with P, is based on the current error between the setpoint and the measured output of the system. This term helps bring the output of the system back to the setpoint by applying a correction that is proportional to the amplitude of the error, leading to a reduction of the rise time of the correction signal, see Figure 3. The larger the error, the larger the correction applied by the proportional term — that is, the larger the error with a fixed Kp, the larger uP(t). Since the P term always requires a non-zero error to generate its output, it cannot nullify the error by itself. In steady-state system conditions, an equilibrium is reached, which includes a steady-state error.

White Paper PID Figure 3

Figure 3: Effect of the proportional action. Increasing the Kp coefficient reduces the rise time, but the error never approaches zero. Additionally, a too high value of the proportional gain might lead to an oscillating output.

The integral term

The integral term, denoted with I, applies a correction that is proportional to the time integral of the error, i.e. the history of the error. For example, if the error persists over time, the integral term continues to increase, resulting in a larger correction applied to the output of the system. Unlike the proportional term, the integral term makes it possible for the controller to generate a non-zero control signal even under a zero-error condition at present. This property enables the controller to bring the system exactly to the required setpoint. Its effect is illustrated in Figure 4.

Increasing the value of the integral gain coefficient increases the contribution of the accumulated error over time to the control signal. This means that if there is a steady-state error, an integral term with a large gain coefficient will drive the control signal to eliminate the error faster than a smaller integral term.

However, increasing the integral term too much can lead to an oscillating output if too much error is accumulated, causing the control signal to overshoot and create oscillations around the setpoint. This phenomenon is sometimes called integral windup [2].

White Paper PID Figure 4

Figure 4: Effect of the integral action with constant Kp = 1. Increasing Ki, the response will be faster but also lead to larger oscillations and overshoot if the value increases too much (green curve).

The Derivative Term

The derivative term, denoted with D, provides a control over the error tendency, i.e. its future behavior, by applying a correction proportional to the time derivative of the error. This allows to reduce the rate of change of the error and so helps improve the stability and responsiveness of the control loop. The aim is to anticipate the changes in the error signal: if the error shows an upward trend, the derivative action tries to compensate without waiting for the error to become significant (proportional action) or for it to persist for some time (integral action).

In real-world implementations of PIDs, the derivative action is sometimes omitted due to its high sensitivity to the quality of the input signal. When the reference value changes rapidly, as in the case of a very noisy control signal, the derivative of the error tends to become very large, causing the PID controller to undergo an abrupt change that can result in instabilities or oscillations in the control loop.

To improve the stability, prior low-pass filtering of the error signal is often used as a mitigation strategy; however, low-pass filtering and derivative control neutralize one another, hence only a limited amount of filtering is possible.

If it is properly calibrated and if the system is “tolerant” enough, the derivative action can give a decisive contribution to the controller performance. The effect of the derivative term is shown in Figure 5.

The effect of each term on the system’s response depends strongly on the system’s characteristics.

Therefore, the weighting of the Kp, Ki, and Kd gains can be adjusted to fine-tune the performance of the control loop and achieve the desired responsiveness and accuracy.

White Paper PID Figure 5

Figure 5: The purpose of the derivative action is to increase the damping of the system; however, too large values of Kd might make the system unstable or oscillatory, as described in the text. The curves are obtained keeping the proportional and integral gain constant (Kp = 4 and Ki = 1 s-1).

Some applications or simple systems may only require one or two of the three control terms provided by a PID controller. To operate the controller with only a subset of these terms, the unused terms can be set to zero, thus resulting in a PI, PD, P, or I controller. 

For instance, the use of a PI controller is common in applications that prioritize steady-state error elimination and stability, rather than fast response times, due to their slow dynamics. A typical example is the control of an oven’s temperature, where a PI controller is normally employed to ensure precise temperature regulation and eliminate any steady-state offset, considering the oven’s relatively slow response characteristics.

Read More

Similar Posts