Exploring the Principles of PID Controllers

Feedback loops have been used in self-regulating systems (otherwise known as the routing back of the output of a system to its input) for some years and have become an integral part of modern technology. James Clark Maxwell’s article, On Governors, was one of the earliest attempts to rigorously describe control loops using feedback.1

In the context of control strategies, an open-loop control system is the term given to a controller whose action is determined based on predetermined input values without considering feedback.

A closed-loop controller, in contrast, incorporates continuous feedback, facilitating real-time adjustments to enhance stability, precision, and robustness and ultimately making it more suitable to help attain the desired control objectives in changing conditions.

The most widespread type of closed-loop control system today is the Proportional–Integral–Derivative (PID) controller. The output of a system is continuously measured and adjusted by these types of controllers to match a desired setpoint, that is, a given target condition for the system or process under consideration.

PID controllers are extremely versatile, require little prior knowledge or model of the system, and are relatively cost-effective and straightforward to implement. This makes them ideal to implement in various systems: from pneumatics and hydraulics to analog and digital electronics.

For this reason, PID controllers have become extensively used in various industries and research applications, with uses in photonics, manufacturing, material science, sensors, and nanotechnology.

PID control loops are utilized in several aspects of industrial automation and everyday life, with uses ranging from ovens used for cooking food or samples, flow controllers in pipes, the gyroscopes found in self-navigating cars and smartphones, and even in the management of daily road traffic.

Along with this ubiquitous use, the presence of PID control loops can be noted in more advanced research fields as well: for instance, in closed-loop control of MEMS-based (micro-electromechanical systems) gyroscopes, in the stabilization of laser cavities and interferometers in photonics and optics, and in the characterization of mechanical resonators in scanning probe microscopy (SPM).

This article presents PID control loops' fundamental principles and functions: outlining their strengths and limitations, analyzing their basic building blocks, and considering their tuning and designing strategies before detailing how they can be easily implemented with Zurich Instruments’ lock-in amplifiers.

PID Working Principle and Building Blocks

The principal 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 particular system.

It is essential to reflect on the exemplary scheme shown in Figure 1. The output of the system y(t) is looped back and measured against the setpoint r(t) by the comparator as a first step, which generates the time-dependent error signal e(t) = r(t) - y(t).

The loop filter then minimizes this error signal and is subsequently used to generate the control signal u(t) that drives the system's output, which initiates closed-loop operation. To minimize the error, these steps are continuously executed.

In addition to considering the current error, it is also important to consider both its accumulation over time (represented by the integral) and its future tendency (represented by the derivative at time t), as depicted 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 integral, proportional, and derivative terms. The complete control function in its most general form can mathematically be written as the sum of the three individual contributions:

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

The proportional term is based on the current error between the setpoint and the measured output of the system and is denoted with P. This term applies a correction proportional to the amplitude of the error and helps to take the output of the system back to the setpoint, leading to a reduction of the rise time of the correction signal (as depicted in Figure 3).

The larger the error with a fixed Kp, the larger uP(t) – or, in other words, the larger the error, the larger the correction applied by the proportional term.

The P term cannot nullify the error by itself, as it always requires a non-zero error to generate its output. An equilibrium is reached in steady-state system conditions, which includes a steady-state error.

Schematic representation of a general PID control loop in its most general form

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

Example of error function with the highlighted contributions of the P, I and D terms

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

The Integral Term

The integral term is denoted with I and applies a correction proportional to the time integral of the error (in other words, the history of the error). For instance, the integral term increases if the error lingers over time, resulting in a more significant correction applied to the system's output.

Unlike the proportional term, the integral term renders it possible for the controller to generate a non-zero control signal - even under a zero-error condition. This property allows the controller to take the system to the required setpoint. The effect of this is depicted in Figure 4.

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

However, if too much error is accumulated, increasing the integral term too significantly can lead to an oscillating output, which causes the control signal to overshoot and create oscillations around the setpoint. This phenomenon is sometimes known as integral windup.2

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

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. Image Credit: Zurich Instruments

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)

Figure 4. Effect of the integral action with constant Kp = 1. Increasing Ki, the response will be faster, leading to larger oscillations and overshoot if the value rises too much (green curve). Image Credit: Zurich Instruments

The Derivative Term

The derivative term is denoted with D and provides control over the error tendency (in other words, its future behavior) with the application of a correction proportional to the time derivative of the error. This facilitates a reduction in the error rate change and consequently helps improve the responsiveness and stability of the control loop.

The goal is to be able to anticipate the changes in the error signal: if the error displays an upward trend, the derivative action tries to compensate without waiting for the error to become significant (proportional action) or for it to remain for some time (integral action).

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

Prior low-pass filtering of the error signal is often used as a mitigation strategy to improve stability. However, only limited filtering is possible as low-pass filtering and derivative control neutralize one another.

The derivative action can give a decisive contribution to the controller performance if properly calibrated and the system is sufficiently "tolerant". Figure 5 shows the effect of the derivative term.

The system’s characteristics determine the effect of each term on the system's response.

Therefore, it is possible to adjust the weighting of the Kp, Ki, and Kd gains to fine-tune the control loop's performance and achieve the preferred accuracy and responsiveness.

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

For example, it is common to find the use of a PI controller within applications that prioritize stability and steady-state error elimination as opposed to fast response times due to their slow dynamics.

The control of an oven's temperature is a typical example, in which a PI controller is typically utilized to eliminate any steady-state offset and ensure precise temperature regulation, as evidenced by the oven's relatively slow response characteristics.

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)

Figure 5. The purpose of the derivative action is to increase the system's damping; 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). Image Credit: Zurich Instruments

Derivation of An Initial Set of Parameters (Tuning)

One of the critical advantages of PID controllers is that they can be implemented without a detailed model or knowledge of the system. Thanks to heuristic calibration procedures, it is possible to calculate coefficients solely based on simple experimental tests to be carried out directly on the process. The initial tuning of the PID parameters can, nevertheless, be a delicate task.

Several well-established methods can be used to derive an initial set of coefficients, many of which involve the measurement of some open-loop parameters of the system.

As discussed in this article, open-loop is the term given to the behavior of the system without any feedback control, wherein an input signal is applied to the system and the resulting output is just measured but is not fed back to the input.

The input signal may be any other type appropriate for the controlled system, such as a step function, a ramp, or a sine wave. The output of the system is recorded as a function of time. It can be analyzed to determine specific response characteristics of the system, like its natural frequency, time constant, and damping ratio.

The strategy to find initial parameters typically involves three steps:

  1. The first is to obtain the open-loop response of the system and measure some of the characteristic parameters – for instance, the oscillation period of the system output and the process delay.
  2. The second step is to calculate coarse values of the gain coefficients Kp, Ki and Kd based on the measured parameters.
  3. The third step is to tune the PID gain coefficients to optimize for speed, noise, or robustness.

The Ziegler-Nichols method, the Cohen-Coon method, the relay method, and the Tyreus-Luyben method are some of the most widespread techniques to achieve coarse tuning.3,4,5,6

Table 1 depicts a practical example of an initial tuning procedure, which was constructed from the Ziegler-Nichols method.

Table 1. Step-by-step procedure for the Initial tuning of a PID controller, based on the Ziegler-Nichols method. Source: Zurich Instruments

Set the P,I, and D gain to zero
Increase the proportional (P) gain until the system starts to show consistent and stable oscillation. This value is known as the ultimate gain (Ku).
Measure the period of the oscillation (Tu).
Depending on the desired type of control loop (P, PI or PID) set the gains to the following values:
  Kp Ki Kd
P controller 0.5 Ku 0 0
PI controller 0.45 Ku 0.54 Ku / Tu 0
PID controller 0.6 Ku 1.2 Ku / Tu 0.075 Ku Tu
Test the response of the system and adjust the gains as necessary. If the response is too slow or sluggish, increase the P or I gain. If the response is too fast or oscillatory, decrease the P or I gain. If there is overshoot or ringing, increase the D gain.


Principles of PID Controllers

References and Further Reading

  1. Maxwell James Clerk 1868. On governors, Proc. R. Soc. Lond.16270–283
  2. Y. Tian and D.P. Atherton. Analysis and Design of Reset Control Systems. Institution of Electrical Engineers, 2004.
  3. Ziegler, J. G., & Nichols, N. B. (1942). Optimum settings for automatic controllers. Transactions of the ASME, 64(6), 759-768.
  4. Cohen, H., & Coon, G. A. (1953). A linear operator approach to the analysis of closed-loop servomechanisms. Journal of the Franklin Institute, 256(6), 489-512
  5. Åström, K. J., & Hägglund, T. (1995). PID controllers: Theory, design, and tuning (2nd ed.). Instrument Society of America.
  6. Luyben, W. L. (1990). Plantwide control: Some practical considerations. Chemical Engineering Progress, 86(4), 49-53.

This information has been sourced, reviewed and adapted from materials provided by Zurich Instruments.

For more information on this source, please visit Zurich Instruments.


Please use one of the following formats to cite this article in your essay, paper or report:

  • APA

    Zurich Instruments AG. (2023, September 04). Exploring the Principles of PID Controllers. AZoSensors. Retrieved on June 18, 2024 from https://www.azosensors.com/article.aspx?ArticleID=2850.

  • MLA

    Zurich Instruments AG. "Exploring the Principles of PID Controllers". AZoSensors. 18 June 2024. <https://www.azosensors.com/article.aspx?ArticleID=2850>.

  • Chicago

    Zurich Instruments AG. "Exploring the Principles of PID Controllers". AZoSensors. https://www.azosensors.com/article.aspx?ArticleID=2850. (accessed June 18, 2024).

  • Harvard

    Zurich Instruments AG. 2023. Exploring the Principles of PID Controllers. AZoSensors, viewed 18 June 2024, https://www.azosensors.com/article.aspx?ArticleID=2850.

Ask A Question

Do you have a question you'd like to ask regarding this article?

Leave your feedback
Your comment type

While we only use edited and approved content for Azthena answers, it may on occasions provide incorrect responses. Please confirm any data provided with the related suppliers or authors. We do not provide medical advice, if you search for medical information you must always consult a medical professional before acting on any information provided.

Your questions, but not your email details will be shared with OpenAI and retained for 30 days in accordance with their privacy principles.

Please do not ask questions that use sensitive or confidential information.

Read the full Terms & Conditions.