0% found this document useful (0 votes)
223 views44 pages

PID Principle

The PID controller is a mechanism used in feedback control loops to automatically maintain a process parameter at a desired level. About 90% of all automatic control systems utilize this universal mechanism.

Uploaded by

Sudhir Shinde
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
223 views44 pages

PID Principle

The PID controller is a mechanism used in feedback control loops to automatically maintain a process parameter at a desired level. About 90% of all automatic control systems utilize this universal mechanism.

Uploaded by

Sudhir Shinde
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 44

PID Principle

https://www.integrasources.com/blog/basics-of-pid-controllers-design-applications/#:~:text=A%20PID%20controller
%20calculates%20the,the%20whole%20term%20becomes%20zero.
https://www.ni.com/en/shop/labview/pid-theory-explained.html?srsltid=AfmBOoodGLOResOd0xIjM_wsOUQDQWm-
VKZWl3Acjr3x6fUFk2N79w4U
https://www.omega.com/en-us/resources/how-does-a-pid-controller-work
https://www.zhinst.com/others/en/resources/principles-of-pid-controllers
https://www.elprocus.com/the-working-of-a-pid-controller/
https://en.wikipedia.org/wiki/Proportional%E2%80%93integral%E2%80%93derivative_controller
https://www.multispanindia.com/blog-detail.php/pid-controller-types-working-and-its-application
https://www.eurotherm.com/in/temperature-control-in/principles-of-pid-control-and-tuning/
https://www.youtube.com/watch?v=ZxoguZcmnT0&t=4s
Proportional–integral–derivative controllers have been in use since the
beginning of the 20th century. They find applications in almost any area
where automatic control is required. As of 2021, the global PID controller
market was estimated at $1.42 billion and is forecasted to reach
$1.94 billion by 2029. In this article, we will explain the popularity of this
mechanism and cover the basics of PID controllers: their working principle,
types, and applications. We will also touch upon their pros and cons,
implementation peculiarities, and alternatives.

What is a PID Controller?


PID controller is a mechanism used in feedback control loops to
automatically maintain a process parameter at a certain level. About 90%
of all automatic control systems have this universal mechanism.
In simple terms, the PID algorithm regulates a process variable by
calculating a control signal that is the sum of three terms: proportional,
integral, and derivative. Hence its name. As a result, it can return a
process variable into the acceptable range.
Our team has used this mechanism in many projects, as it is a simple and
affordable solution. If you need to design a device with a control
system, contact us to discuss whether this solution will suit your case.

How Does a PID Controller Work?


To understand how a PID controller works, one needs to see what is
happening inside a closed loop system first.
The PID controller is placed in the core of a closed loop system. It can be
a device or an algorithm running on a microcontroller.
The plant/system refers to the object under control which can be an
industrial furnace, a motor, or anything else. The plant is controlled with
an actuation device, which can be a motor drive, a heater, a cooler, or
anything else that can drive the system. The parameter that needs to be
controlled is called the process variable. It can be temperature, flow
rate, pressure, rotation speed, etc.
The process variable is measured with a sensor that sends the signal back
to the controller, thus providing feedback. The controller receives
a desired process value or set point. It is the value that the system
must achieve. This parameter is always set from outside – manually or
automatically by a high-level control system (e.g., MPC controllers in the
chemical industry).
The controller compares the measured process variable and the set point.
Based on the difference between them, the algorithm computes a control
signal and sends it to the actuation device. It, in turn, drives the plant to
the desired process value (set point). This is the basic working principle of
a PID controller.

A temperature
control system with a PID controller. It controls the temperature (process
variable) in the furnace (plant/system) with the help of the heater
(actuation device).
As the algorithm deals with numbers, it doesn’t matter to which kind of
process it is applied. That’s why the mechanism is widely used
in electronics development .

Proportional, Integral, and


Derivative Terms
A PID controller calculates the control signal based on three control terms:
proportional, integral, and derivative. To compute the output, the
algorithm simply multiplies each of them by a gain and sums these three
addends.

If a gain is set to zero, the whole term becomes zero. This way, the PID
mechanism can be turned into a P controller, a PI controller, and other
modifications.
Proportional term
The proportional term is the difference between the set point (SP) and the
measured process variable (PV) multiplied by the P gain (K p). This
difference is referred to as the error value, or e(t).
The error value represents how far the system is from the desired value.
The higher it is, the higher the value of the manipulated variable and the
faster the system will drive the process variable to the desired value. In
the heating process shown below, the manipulated variable drops as the
measured process variable (temperature) rises.

The proportional gain (K p) defines the speed of the control system


response. But if it is too large, the process variable starts to oscillate and
can even oscillate out of control.
In certain systems, using only the P term cannot reduce the error value to
zero. The remaining difference between the set point and process variable
is called the steady-state error. In such cases, we need to add the integral
term to the equation.
Integral term
The P term takes into account only the current error value. The integral
term is proportional to the time integral of the error value. It means the I
component considers the history of the error. The integral gain (K i )
increases the weight of this component in the actuating output.
If there is even a small error, the integral term will increase continuously
(or decrease if the error is negative) until the steady state error equals
zero. The plot below shows the work of a pure I controller.

A pure I
controller is very slow and typically causes the process variable to
overshoot the set point. That’s why engineers use PI or PID controllers
more often.
The plots below show the work of a P controller (on the left) and a PI
controller (on the right) with the same P gain. As you can see, the process
on the left causes a steady-state error. But adding the I term eliminates
the error (graph on the right).

By properly adjusting the gains, one can make a transient response


monotonic if required:
Or you can make a fast transient response with no oscillations. The
properties are defined by the requirements for the system.
Derivative term
The derivative term uses the difference between the current and previous
error values divided by the time between measurements (dt).

It is proportional to the rate of change of the process variable. While the P


term fixes the current error and the I term considers previous errors, the
derivative term takes into account future error values. The D component
compensates for the sharp fluctuations in the system, prevents it from
strong overshoot, and decreases oscillations. The derivative gain (K d)
changes the weight of this component in the control signal.

Adding the
derivative term and setting the K d to 1 decreases the oscillations in the
process.
The D term is important for systems that face violent changes, such as
quadcopters. At the same time, it amplifies measurement noise and
external disturbances. Often, the D term is left out when dealing with slow
systems.

Basics of PID Controllers:


Applications
Universal PID controllers can quickly drive the process variable into the
acceptable range, keep this value at the desired level, and respond to
disturbances quickly. In some cases, applying a P-only controller or a PI
controller is enough. But when you need better stability or tracking, which
requires eliminating undesirable overshoot, the use of a PID controller is a
better option. Contact our team to tell us about your project, and we will
find the most suitable solution.
These features make PID controllers good for a variety of applications.
 Manufacturing
The algorithm allows for regulating various parameters in manufacturing
equipment, such as pressure, flow rate, voltage, etc. The use of PID
controllers for temperature control is especially important in the
metallurgical industry. Heat treatment of metals often requires high
precision.
 Chemical and pharmaceutical industries
Here, the mechanism allows chemists to regulate pressure, temperature,
PH, and humidity in different chemical processes. It is also used to control
the flow rate of fluids to achieve the desired concentration of chemicals.
 Autopilot
Any self-driving vehicle, from a car to a plane, can’t move with perfect
precision. Its trajectory is affected by the environment, so the vehicle
needs corrections. This need explains the use of PID controllers in the
aircraft and automobile industries. The cruise control system of a car is a
good example of basic PID control. The mechanism also finds applications
in hoverboards, quadcopters, as well as plane and drone autopilots.
We used a PID controller as part of a drone autopilot system – one of
our embedded hardware design projects. We needed to control the spatial
attitude of the drone. Otherwise, it would drift away or start rotating. To
do that, we implemented the PID algorithm on the drone’s microcontroller.
The process variable is calculated by a direction cosine matrix (DCM)
based on the data from the gyroscope and accelerometer. The PID
controller increases or decreases the motors’ thrust, thus stabilizing the
drone’s spatial attitude and its airframe dynamics.
We used the same PID mechanism for our ready-to-fly quadcopter project.
 Robotics
The use of PID controllers in robotics development allows achieving high
accuracy of movement. Depending on the application, it can be sufficient
to apply a P-only or a PI modification.
Using a PID controller for DC motor control is another frequent application.
Our team applied this algorithm when developing a DC motor controller for a
company that makes robots and robot kits.
The PID algorithm was implemented on the microcontroller of the device.
Its task was to regulate the rotation speed of DC motors. The process
variable is measured with a quadrature encoder. The solution allows for a
smooth start/stop, stabilizes the speed of a robot, and even provides
distance control.
Since the DC motor controller was supposed to be used with different
robot models, we also created a desktop application for setting the
parameters of the device. The app also allows for tuning the PID gains.
 Power conversion
The PID algorithm can be incorporated into power converters to make
energy consumption more efficient by regulating the output voltage.
That’s why it is used both in consumer-grade solutions and industrial power
electronics development .
 Photovoltaics
The power output of solar panels depends on the weather. Tracking the
highest power point of a PV cell allows for maintaining stable current and
voltage. PID controllers reduce the response time of the system.
Basics of PID Controllers:
Advantages and Disadvantages
The PID algorithm is universal. It suits almost any kind of process as long
as the desired effect can be achieved by forcing the process variable to
match the desired value sooner or later. Here are some of the key
advantages of this control technique:
 PID provides greater accuracy than simpler on/off controllers.
 The algorithm is more energy efficient.
 It isn’t heavy on hardware, so devices with PID controllers are mostly
cheap.
 The algorithm can be implemented as analog electronics, digital
electronics, and mechanical solutions. Today, engineers mostly use
digital PID controllers, but there are also pneumatic, hydraulic, and
mechanical PID controllers.
 The P, I, and D components can be tuned intuitively, by trial and error.
Even if tuning the PID controller in a control system does require a
specialist, one session should last for years.
 More advanced controllers will probably require stopping the process
for re-tuning. But a universal PID controller can often be re-tuned while
the process is still running, which is often more convenient.
 Unlike simpler solutions, the PID algorithm can substantially extend the
life of an actuation device.
 While advanced controllers are more efficient, using them may not be
worth the expense and effort.
 Unlike model-based controllers, the PID algorithm responds to
unmeasured disturbances better due to having proportional and
derivative actions.
 The PID algorithm has been in use for over 70 years, so engineers have
found workarounds for many of the existing problems.
At the same time, there are situations when a PID controller is not the best
choice.
 If not tuned properly, the algorithm can make the system unstable and
even damage it.
 PID controllers amplify the high-frequency content of the error signal.
This boosts the noise component of the control output, which
destabilizes the system.
 The PID technique suits single input, single output (SISO) systems. But
classic PID controllers don’t do well if there’s a need to control more
than one parameter.
 The unmodified PID algorithm performs poorly when the delay between
the output and the process response is too long. But the problem can
be solved by augmenting the mechanism with additional intelligence.
Our team has great experience in this field. Often, we used the PID
algorithm as part of an advanced control system by combining it with
other techniques. Feel free to contact us and ask any questions about the
device you want to create.
Types of PID Controllers
PID controllers use proportional, integral, and derivative components to
regulate a process. By setting a gain to zero, one eliminates the term from
the equation. Such types of PID controllers are called PID modifications.
Engineers generally use the following modifications:

- A proportional controller reduces the rise time (time required for the
process variable to reach the set point) and speeds up the response.
When our team developed hardware and software for an autonomous lawn
mower , it decided to use a P controller for regulating the robot’s movement
speed. Stable speed allowed the mower to cut grass more efficiently.
The motor of the lawn mower is equipped with a quadrature encoder. The
data from this sensor is fed to the PID algorithm implemented on the
microcontroller of the device. The control signal regulates the voltage
applied to the motor, thus controlling the speed. In this project, we didn’t
need high accuracy, and even a small steady-state error was not a
problem. That’s why the team didn’t use the I and D terms.
The same solution was applied to the recharging system of the lawn
mower.
- A derivative controller minimizes the overshoot and oscillations in the
output of the system.
- An integral controller reduces the time-invariant error and lags the
output phase.
- A PI controller allows for reducing the rise time and eliminating the
steady state error.
- A PD controller reduces the rise time, overshoot, and oscillations in the
plant.
Apart from these modifications, there are types of PID controllers
augmented with more complicated algorithms. They can perform tasks
with which the classical PID algorithm cannot cope.

Basics of PID Controllers: Real-Life


Implementation
The working principle described above is a theoretical idealization of the
process. In actual embedded electronics development , one has to take into
account real-life working conditions, limitations, and various features of
the environment. Engineers generally face the following problems.
1. In a mathematical model, the actuation device would change the
process variable within any range of values defined by the control signal
from the PID controller. But, in reality, the dynamic range of physical
variables is finite. A motor has limited power, a valve has limited
throughput, etc.
2. In real life, a control system may be unable to change the sign of the
manipulated variable. For instance, many temperature regulation systems
don’t have cooler devices. So, if the control signal is less than zero, the
system can only turn the heater off.
3. The limited accuracy of measurements requires additional efforts so
that differentiation operations could be performed with permissible error.
4. Almost any system has nonlinearities: saturation, the rate of rise
limitation, hysteresis, and slacks.
5. Parameter spread and random parameter variations of the controller
and plant.
6. Discrete implementation of the controller.
7. The need for bumpless switching between control modes.

Alternatives to PID Controllers


Many control techniques can serve as alternatives to the PID algorithm.
While some of them offer higher efficiency, such solutions are usually
more expensive.
 On-off controllers
They can execute only two types of outputs: fully on (when the process
variable is not reached) and fully off (when the error is zero or negative).
Such solutions are cheap and simple but offer poor accuracy. They often
can’t keep the process variable at a certain level due to inertia. The
parameter will go above and below the set point all the time (this effect is
called “hunting”). But on-off controllers suit systems where precise control
is not required.

 Fuzzy logic controllers


Digital logic uses discrete values (0 or 1). Fuzzy logic operates on
continuous values between 0 and 1. In practice, most FLCs are PID
controllers modified with fuzzy logic to schedule the gains. Variable gains
work better for nonlinear processes. This solution suits complicated
systems that have lots of uncertainties or variability.
 Optimal control techniques
Optimal controllers include a wide range of types: model predictive,
linear–quadratic–Gaussian (LQG), H-infinity controllers, and many
nonlinear optimal controllers, including sliding mode controllers according
to some specialists. Optimal controllers are more efficient than the PID
algorithm. On the other hand, implementing them is much more
complicated and expensive, which is why they are mostly applied to
complicated MIMO systems.

Conclusion
A PID controller is a closed feedback loop system that can control a plant
based on the measurement of the process variable. Since it deals with
numbers only, it can be applied to almost any process.
The PID algorithm has been in use for over 70 years. Despite that, it
remains the most popular solution in almost any industry. PID controllers
are used in metallurgy, chemical, pharmaceutical, and automotive
industries, as well as in robotics, power conversion, photovoltaics, and
other spheres.
Although there are many advanced alternatives, the basics of PID
controllers are easier to understand. These solutions are affordable and
easy to implement. The PID gains can often be tuned by trial and error.
Unless optimized efficiency is a must, a proportional–integral–derivative
controller should be sufficient. Our team has used PID controllers in many
projects that required a control system. We have enough experience to
understand when and how to use it, or how to modify it to achieve the
highest efficiency. Contact us directly to discuss your project and possible
solutions.
The PID Controller & Theory
Explained
Updated Sep 9, 2024

Overview
Proportional-Integral-Derivative (PID) control is the most common control algorithm used in
industry and has been universally accepted in industrial control. The popularity of PID
controllers can be attributed partly to their robust performance in a wide range of operating
conditions and partly to their functional simplicity, which allows engineers to operate them
in a simple, straightforward manner.

As the name suggests, PID algorithm consists of three basic coefficients; proportional,
integral and derivative which are varied to get optimal response. Closed loop systems, the
theory of classical PID and the effects of tuning a closed loop control system are discussed in
this paper. The PID toolset in LabVIEW and the ease of use of these VIs is also discussed.

Contents
 PID Control System
 PID Theory
 Tuning
 NI LabVIEW and PID
 Summary
 References

PID Control System


A PID controller is an instrument that receives input data from sensors, calculates the
difference between the actual value and the desired setpoint, and adjusts outputs to control
variables such as temperature, flow rate, speed, pressure, and voltage. It does this through
three mechanisms: proportional control, which reacts to current error; integral control, which
addresses accumulated past errors; and derivative control, which predicts future errors. The
PID controller sums those three components to compute the output. This architecture allows
PID controllers to efficiently maintain process control and system stability. Before we start to
define the parameters of a PID controller, let's discuss what a closed loop system is and
some of the terminologies associated with it.
Closed Loop System
In a typical control system, the process variable is the system parameter that needs to be
controlled, such as temperature (ºC), pressure (psi), or flow rate (liters/minute). A sensor is
used to measure the process variable and provide feedback to the control system. The set
point is the desired or command value for the process variable, such as 100 degrees Celsius
in the case of a temperature control system. At any given moment, the difference between
the process variable and the set point is used by the control system
algorithm (compensator), to determine the desired actuator output to drive the system
(plant). For instance, if the measured temperature process variable is 100 ºC and the
desired temperature set point is 120 ºC, then the actuator output specified by the control
algorithm might be to drive a heater. Driving an actuator to turn on a heater causes the
system to become warmer, and results in an increase in the temperature process variable.
This is called a closed loop control system, because the process of reading sensors to
provide constant feedback and calculating the desired actuator output is repeated
continuously and at a fixed loop rate as illustrated in figure 1.

In many cases, the actuator output is not the only signal that has an effect on the system.
For instance, in a temperature chamber there might be a source of cool air that sometimes
blows into the chamber and disturbs the temperature.Such a term is referred to
as disturbance. We usually try to design the control system to minimize the effect of
disturbances on the process variable.

Figure 1: Block diagram of a typical closed loop system.

Defintion of Terminlogies
The control design process begins by defining the performance requirements. Control
system performance is often measured by applying a step function as the set point
command variable, and then measuring the response of the process variable. Commonly,
the response is quantified by measuring defined waveform characteristics. Rise Time is the
amount of time the system takes to go from 10% to 90% of the steady-state, or final, value.
Percent Overshoot is the amount that the process variable overshoots the final value,
expressed as a percentage of the final value. Settling time is the time required for the
process variable to settle to within a certain percentage (commonly 5%) of the final value.
Steady-State Error is the final difference between the process variable and set point. Note
that the exact definition of these quantities will vary in industry and academia.

Figure 2: Response of a typical PID closed loop system.

After using one or all of these quantities to define the performance requirements for a
control system, it is useful to define the worst case conditions in which the control system
will be expected to meet these design requirements. Often times, there is a disturbance in
the system that affects the process variable or the measurement of the process variable. It
is important to design a control system that performs satisfactorily during worst case
conditions. The measure of how well the control system is able to overcome the effects of
disturbances is referred to as the disturbance rejection of the control system.

In some cases, the response of the system to a given control output may change over time
or in relation to some variable. A nonlinear system is a system in which the control
parameters that produce a desired response at one operating point might not produce a
satisfactory response at another operating point. For instance, a chamber partially filled with
fluid will exhibit a much faster response to heater output when nearly empty than it will
when nearly full of fluid. The measure of how well the control system will tolerate
disturbances and nonlinearities is referred to as the robustness of the control system.

Some systems exhibit an undesirable behavior called deadtime. Deadtime is a delay


between when a process variable changes, and when that change can be observed. For
instance, if a temperature sensor is placed far away from a cold water fluid inlet valve, it will
not measure a change in temperature immediately if the valve is opened or closed.
Deadtime can also be caused by a system or output actuator that is slow to respond to the
control command, for instance, a valve that is slow to open or close. A common source of
deadtime in chemical plants is the delay caused by the flow of fluid through pipes.

Loop cycle is also an important parameter of a closed loop system. The interval of time
between calls to a control algorithm is the loop cycle time. Systems that change quickly or
have complex behavior require faster control loop rates.

Figure 3: Response of a closed loop system with deadtime.

Once the performance requirements have been specified, it is time to examine the system
and select an appropriate control scheme. In the vast majority of applications, a PID control
will provide the required results
Back to top

PID Theory
Proportional Response
The proportional component depends only on the difference between the set point and the
process variable. This difference is referred to as the Error term. The proportional
gain (Kc) determines the ratio of output response to the error signal. For instance, if the error
term has a magnitude of 10, a proportional gain of 5 would produce a proportional response
of 50. In general, increasing the proportional gain will increase the speed of the control
system response. However, if the proportional gain is too large, the process variable will
begin to oscillate. If Kc is increased further, the oscillations will become larger and the
system will become unstable and may even oscillate out of control.
Figure 4: Block diagram of a basic PID control algorithm.

Integral Response
The integral component sums the error term over time. The result is that even a small error
term will cause the integral component to increase slowly. The integral response will
continually increase over time unless the error is zero, so the effect is to drive the Steady-
State error to zero. Steady-State error is the final difference between the process variable
and set point. A phenomenon called integral windup results when integral action saturates a
controller without the controller driving the error signal toward zero.
Derivative Response
The derivative component causes the output to decrease if the process variable is increasing
rapidly. The derivative response is proportional to the rate of change of the process variable.
Increasing the derivative time (Td) parameter will cause the control system to react more
strongly to changes in the error term and will increase the speed of the overall control
system response. Most practical control systems use very small derivative time (T d), because
the Derivative Response is highly sensitive to noise in the process variable signal. If the
sensor feedback signal is noisy or if the control loop rate is too slow, the derivative response
can make the control system unstable
Back to top

Tuning
The process of setting the optimal gains for P, I and D to get an ideal response from a
control system is called tuning. There are different methods of PID tuning of which the
“guess and check” method and the Ziegler Nichols method will be discussed.

The gains of a PID controller can be obtained by trial and error method. Once an engineer
understands the significance of each gain parameter, this method becomes relatively easy.
In this method, the I and D terms are set to zero first and the proportional gain is increased
until the output of the loop oscillates. As one increases the proportional gain, the system
becomes faster, but care must be taken not make the system unstable. Once P has been set
to obtain a desired fast response, the integral term is increased to stop the oscillations. The
integral term reduces the steady state error, but increases overshoot. Some amount of
overshoot is always necessary for a fast system so that it could respond to changes
immediately. The integral term is tweaked to achieve a minimal steady state error. Once the
P and I have been set to get the desired fast control system with minimal steady state error,
the derivative term is increased until the loop is acceptably quick to its set point. Increasing
derivative term decreases overshoot and yields higher gain with stability but would cause
the system to be highly sensitive to noise. Often times, engineers need to tradeoff one
characteristic of a control system for another to better meet their requirements.

The Ziegler-Nichols method is another popular method of tuning a PID controller. It is very
similar to the trial and error method wherein I and D are set to zero and P is increased until
the loop starts to oscillate. Once oscillation starts, the critical gain K c and the period of
oscillations Pc are noted. The P, I and D are then adjusted as per the tabular column shown
below.

ol P Ti

0.5Kc -

0.45Kc Pc/1.2

0.60Kc 0.5Pc

Table 1: Ziegler-Nichols tuning, using the oscillation method.

Back to top

NI LabVIEW and PID


LabVIEW PID toolset features a wide array of VIs that greatly help in the design of a PID
based control system. Control output range limiting, integrator anti-windup and bumpless
controller output for PID gain changes are some of the salient features of the PID VI. The PID
Advanced VI includes all the features of the PID VI along with non-linear integral action, two
degree of freedom control and error-squared control.

Figure 5: VIs from the PID controls palette of LabVIEW

PID palette also features some advanced VIs like the PID Autotuning VI and the PID Gain
Schedule VI. The PID Autotuning VI helps in refining the PID parameters of a control system.
Once an educated guess about the values of P, I and D have been made, the PID Autotuning
VI helps in refining the PID parameters to obtain better response from the control system.

Figure 6: Advanced VIs from the PID controls palette of LabVIEW

The reliability of the controls system is greatly improved by using the LabVIEW Real Time
module running on a real time target. NI provides data acquisition devices that provide
higher accuracy and better performance than an average control system
Figure 7: A typical LabVIEW VI showing PID control with a plug-in NI data acquisition device

The tight integration of these data acquisition devices with LabVIEW minimizes the
development time involved and greatly increases the productivity of any engineer. Figure 7
shows a typical VI in LabVIEW showing PID control using the NI-DAQmx driver API, which is
included with NI data acquisition hardware.
Back to top

Summary
The PID control algorithm is a robust and simple algorithm that is widely used in the
industry. The algorithm has sufficient flexibility to yield excellent results in a wide variety of
applications and has been one of the main reasons for the continued use over the years. NI
LabVIEW and NI plug-in data acquisition devices offer higher accuracy and better
performance to make an excellent PID control system.
Back to top

References
1. Classical PID Control
by Graham C. Goodwin, Stefan F. Graebe, Mario E. Salgado
Control System Design, Prentice Hall PTR
2. PID Control of Continuous Processes
by John W. Webb Ronald A. Reis
Programmable Logic Controllers, Fourth Edition, Prentice Hall PTR
Principles of PID Controllers
Principles of PID Controllers
Download the White Paper as PDF
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:
u(t)=uP(t)+uI(t)+uD(t)=Kpe(t)+Ki∫0te(τ)dτ+Kdddte(t)
where Kp, Ki and Kd are the gain coefficients related to the proportional, integral, and
derivative terms, respectively.

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

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 K p, 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.

Figure 3: Effect of the proportional action. Increasing the K p 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].

Figure 4: Effect of the integral action with constant K p = 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.

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.
Derivation of an initial set of parameters (Tuning)
One of the main advantages of PID controllers is that they can be implemented without
knowledge or a detailed model of the system. Thanks to heuristic calibration procedures,
it is possible to calculate coefficients based only on simple experimental tests to be
carried out directly on the process. Nevertheless, the initial tuning of the PID parameters
can be a delicate task.
There exist several well-established methods to derive an initial set of coefficients, many
of them involving the measurement of some open-loop parameters of the system.
As pointed out in the introduction, open-loop refers to the behavior of the system
without any feedback control, where an input signal is applied to the system and the
resulting output is just measured, but not fed back to the input. The input signal can be
a step function, a ramp, a sine wave, or any other type of signal that is appropriate for
the system being controlled. The output of the system is then recorded as a function of
time and can be analyzed to determine the system's response characteristics, such as
its time constant, natural frequency, and damping ratio.
The general strategy to find initial parameters involves typically three steps:
1. Obtain the open-loop response of the system and measure some of the characteristic parameters – e.g., the oscillation
period of the system output and the process delay.
2. Calculate coarse values of the gain coefficients Kp, Ki and Kd based on the measured parameters.
3. Tune the PID gain coefficients to optimize for noise, speed, or robustness.
Some of the most widespread techniques to achieve coarse tuning are the Ziegler-
Nichols method [3], the Cohen-Coon method [4], the relay method [5] and the Tyreus-
Luyben method [6].
In Table 1, a practical example of an initial tuning procedure is outlined, constructed
from the Ziegler-Nichols method.
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 (K u).

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.

Table 1: Step-by-step procedure for the Initial tuning of a PID controller, based on the
Ziegler-Nichols method.
Analog and Digital PID Controllers
In recent times, thanks to the advent of field-programmable gate array (FPGA)
technology, microprocessors and digital signal processing techniques, the digital
implementation of PID controllers – together with many other tools -- has outperformed
its analog counterpart in a number of aspects. In particular, the digital form of PID
control has the great advantage that it can be easily implemented as an algorithm and
executed by a microcontroller device. This vastly increases its flexibility, performance,
and the number of addressable applications.
Digital and analog PID controllers differ in the way they process signals and perform
control actions. Analog controllers use continuous signals and analog components such
as operational amplifiers and resistors to perform computations and generate control
signals. Conversely, digital PID controllers sample and digitize signals, perform
calculations and output discrete control signals. The use of digital signal processing
techniques allows digital controllers to execute more complex control algorithms without
adding extra analog circuitry whose physical properties might drift and thus degrade the
quality of the control action over time.
Furthermore, the storing/recalling of settings and the integration with other digital
systems can be easily achieved with digital controllers, thereby increasing their
adaptability to many more control problems and applications.
As with all implementations of digital signals, the most common issues of digital PID
controllers are related to quantization and sampling. Operating at discrete time
intervals, selecting the sampling rate is critical to avoid artifacts such as aliasing and
ensure accurate control. Furthermore, the implementation of the algorithms on digital
platforms (e.g. on FPGAs or microprocessors) might be more costly and require
additional technical expertise and careful evaluation of the corresponding numerical
methods used for signal calculation and conditioning.
Ultimately, the choice between analog and digital controllers often depends on the
application requirements, the available resources, and the desired performance.
Table 2 provides an overview of the advantages and disadvantages of the two
approaches.
Feature Analog PID Controller Digital PID Controller
Cost + (less expensive) - (more expensive)
Precision - (limited precision) + (high precision)
Flexibility - (difficult to modify) + (easy to modify)
Ease of + (simple to - (may require technical
implementation implement) expertise)
- (more sensitive to
Noise sensitivity noise) + (less sensitive to noise)
Dynamic range - (limited) + (wide)
Stability - (prone to drifting) + (stable)
-/+ (can be made faster with
faster processors, but
generally
Response time + (fast) not as fast as analog ones)

Table 2: Comparison between analog and digital PID control loops.


Zurich Instruments offers digital PID controllers as upgrade options for its Lock-in
Amplifiers, Impedance Analyzers and Boxcar Averagers. The integrated architecture of
the instruments allows the user to choose from many different inputs and outputs
signals for the PIDs. Additionally, by integrating demodulated signals as input choices for
PID controllers, the users can benefit from several advantages:
 Enhanced signal-to-noise ratio and stability: demodulation isolates the desired signal from noise and interference,
resulting in a cleaner input signal for the controller.
 Increased sensitivity and improved system response: lock-in detection amplifies weak signals, enabling finer
adjustments and enhancing the PID controller's ability to respond to subtle changes.
 Elimination of unwanted frequency components: demodulation filters out unwanted frequency components present in
the original signal, leading to more accurate and efficient control.
As depicted in Figure 6, the set of signal choices includes amplitude, phase (thereby
effectively setting up what is known as a phase-locked loop, or PLL for short [7]),
quadrature and in-phase components of demodulated signals, boxcar outputs, as well as
auxiliary inputs and outputs. The integrated digital signal processing guarantees
maximum signal-to-noise ratio, minimal feedback loop latency and closed-loop operation
with high stability. The feedback signal is then available as an analog output and can
also be directly applied to an internal signal generator output to control its amplitude,
frequency, offset and phase.

Figure 6: Architecture of the digital implementation of the PID controllers in Zurich


Instruments Lock-in Amplifiers. Depending on the specific application, different input and
output signals can be used.
The digital implementation makes it possible to embed multiple PID controllers on the
same instrument, whose inputs and outputs can be either cascaded in a sequential
fashion or used in a parallel configuration, that is, independently of one another.
Thanks to the type of architecture depicted in Figure 6, the PID option embedded in lock-
in amplifiers enhances the versatility of the instruments, making them benefit a large
variety of applications – even though the specific application needs might significantly
differ from one another.
As previously mentioned, determining appropriate starting conditions for a PID controller
and its optimization can be a challenging task. LabOne® control software, the software
of Zurich Instruments interfacing with the hardware, offers a kit of several tools to
streamline the process of setting up and optimizing a PID controller, making the task
more efficient and straightforward.
LabOne tools like the Sweeper, the PID Advisor and Autotune can help the user with the
implementation of PID control loops, providing intuitive adjustability of the bandwidth,
speed and initial tuning parameters, according to the desired performance.
For example, the Sweeper can be used to obtain the open-loop response of the device
under test (DUT) through signal sweeping, then the PID Advisor selects initial feedback
gain parameters based on predefined transfer functions and the DUT open-loop
parameters obtained with the Sweeper measurement. After closing the loop, to minimize
residual error signal and enhance control performance, the Auto Tune feature can be
applied to the feedback signal to dynamically adjusts feedback gain parameters.
Additionally, thanks to LabOne’s support for the most popular programming languages
(Python, C/C++, MATLAB®, LabVIEW™ and .NET), maximum versatility is ensured when
setting up a control loop and its successive optimization and refinement.
Challenges and Trade-offs
While their versatility and simplicity allow PID controllers to be applied to numerous
control problems, they are subject to some limitations and cannot deliver so-called
optimal control. Optimal control refers to the set of control signals that minimize or
maximize a certain criterion (sometimes known as cost function) used to measure the
performance of the controlled system, e.g. minimizing energy consumption.
Specifically, the PID controllers’ reactive nature, i.e., the fact that no explicit knowledge
of the system is used to generate the control coefficients, makes them sensitive to
changes in the system dynamics and may require careful tuning to achieve the desired
performance. Some typical shortcomings may include:
 Performance degradation if the system has a complex or non-linear transfer function. In these cases, more advanced
and computationally heavy model-based control methods, such as state-space control or H-infinity control [8], may be
needed.
 Considerable sensitivity to noise and disturbance signals of the D term , affecting the stability and accuracy of the
control loop. Mitigation strategies can be applied to partly address these issues – e.g. omission or low-pass filtering of
the D component.
 Sensitivity to deadtime or phase delay, i.e., the time it takes for the control loop to respond to a change in the system or
the setpoint. If the phase delay is too large, the control loop may become unstable and start to oscillate or exhibit other
undesirable behaviors.
 Process saturation: this phenomenon affects physical systems by introducing nonlinearities in the process due to the
saturation of the actuators (e.g., a motor cannot supply more than its maximum torque). Techniques such as anti-
windup or setpoint weighting can help mitigate these issues with relatively minor modifications to the control loop [9].
Loop Bandwidth
Another important factor to consider when designing a PID controller is the bandwidth of
the loop or the closed-loop bandwidth. This bandwidth specifies the range of frequencies
over which the loop can effectively control the system. A wide-bandwidth loop responds
rapidly to changes in the setpoint or the system but may also be more prone to
oscillation and overshoot. A narrow-bandwidth loop, in contrast, is less sensitive to
changes in the setpoint and can deliver a cleaner and more accurate control signal at
the expense of a slower response time.
Given this tradeoff between speed and precision, it is important to understand the
requirements of the considered application to select an appropriate loop bandwidth. A
wide-bandwidth loop may be preferred in applications where a rapid response is
required, such as in the control of motors or other mechanical systems. Conversely, a
narrow-bandwidth loop may be best in applications where stability is more important,
such as in the control of chemical processes or for other systems with long time delays.

Conclusion
Thanks to their ability to adjust the system’s output accurately and quickly without
detailed knowledge about its dynamics, PID control loops stand as a powerful and widely
used tool for maintaining a stable and predictable output in a variety of applications. In
this paper, we have reviewed the fundamental principles and characteristics of these
control systems, providing insight into their functioning, tuning strategies, advantages
and trade-offs.
As a result of their integrated architecture, Zurich Instruments’ lock-in amplifiers allow
users to make the most of all the advantages of digital PID control loops, so that their
operation can be adapted to match the needs of different use cases.
What is a PID Controller : Working & Its
Applications
As the name suggests, this article is going to give a precise idea about the structure and
working of the PID controller. However going into details, let us get an introduction about
PID controllers. PID controllers are found in a wide range of applications for industrial
process control. Approximately 95% of the closed-loop operations of the industrial
automation sector use PID controllers. PID stands for Proportional-Integral-Derivative.
These three controllers are combined in such a way that it produces a control signal. As a
feedback controller, it delivers the control output at desired levels. Before microprocessors
were invented, PID control was implemented by the analog electronic components. But
today all PID controllers are processed by the microprocessors. Programmable logic
controllers also have the inbuilt PID controller instructions. Due to the flexibility and
reliability of the PID controllers, these are traditionally used in process control
applications.

What is a PID Controller?


The term PID stands for proportional integral derivative and it is one kind of device used
to control different process variables like pressure, flow, temperature, and speed in
industrial applications. In this controller, a control loop feedback device is used to regulate
all the process variables.
This type of control is used to drive a system in the direction of an objective location
otherwise level. It is almost everywhere for temperature control and used in scientific
processes, automation & myriad chemical. In this controller, closed-loop feedback is used
to maintain the real output from a method like close to the objective otherwise output at
the fixe point if possible. In this article, the PID controller design with control modes used
in them like P, I & D are discussed.
History
The history of the PID controller is, In the year 1911, the first PID controller was
developed by Elmer Sperry. After that, TIC (Taylor Instrumental Company) was
implemented a former pneumatic controller with completely tunable in the year1933. After
a few years, control engineers removed the error of steady-state that is found within
proportional controllers through retuning the end to some false value until the error wasn’t
zero.
This retuning included the error which is known as the proportional-Integral controller.
After that, in the year 1940, the first pneumatic PID controller was developed through a
derivative action to reduce overshooting problems.
In 1942, Ziegler & Nichols have introduced tuning rules to discover and set the suitable
parameters of PID controllers by the engineers. At last, automatic PID controllers were
extensively used in industries in the mid of 1950.
PID Controller Block Diagram
A closed-loop system like a PID controller includes a feedback control system. This
system evaluates the feedback variable using a fixed point to generate an error signal.
Based on that, it alters the system output. This procedure will continue till the error
reaches Zero otherwise the value of the feedback variable becomes equivalent to a fixed
point.
This controller provides good results as compared with the ON/OFF type controller. In the
ON/OFF type controller, simply two conditions are obtainable to manage the system.
Once the process value is lower than the fixed point, then it will turn ON. Similarly, it will
turn OFF once the value is higher than a fixed value. The output is not stable in this kind
of controller and it will swing frequently in the region of the fixed point. However, this
controller is more steady & accurate as compared to the ON/OFF type controller.

Working of PID controller


Working of PID Controller
With the use of a low cost simple ON-OFF controller, only two control states are possible,
like fully ON or fully OFF. It is used for a limited control application where these two
control states are enough for the control objective. However oscillating nature of this
control limits its usage and hence it is being replaced by PID controllers.
PID controller maintains the output such that there is zero error between the process
variable and setpoint/ desired output by closed-loop operations. PID uses three basic
control behaviors that are explained below.
P- Controller
Proportional or P- controller gives an output that is proportional to current error e (t). It
compares the desired or set point with the actual value or feedback process value. The
resulting error is multiplied with a proportional constant to get the output. If the error value
is zero, then this controller output is zero.

P-controller
This controller requires biasing or manual reset when used alone. This is because it never
reaches the steady-state condition. It provides stable operation but always maintains the
steady-state error. The speed of the response is increased when the proportional
constant Kc increases.

P-Controller Response
I-Controller
Due to the limitation of p-controller where there always exists an offset between the
process variable and setpoint, I-controller is needed, which provides necessary action to
eliminate the steady-state error. It integrates the error over a period of time until the error
value reaches zero. It holds the value to the final control device at which error becomes
zero.
PI controller
Integral control decreases its output when a negative error takes place. It
limits the speed of response and affects the stability of the system. The speed
of the response is increased by decreasing integral gain, Ki.

PI Controller Response
In the above figure, as the gain of the I-controller decreases, the steady-state error also
goes on decreasing. For most of the cases, the PI controller is used particularly where the
high-speed response is not required.
While using the PI controller, I-controller output is limited to somewhat range to overcome
the integral wind up conditions where the integral output goes on increasing even at
zero error state, due to nonlinearities in the plant.
D-Controller
I-controller doesn’t have the capability to predict the future behavior of error. So it reacts
normally once the setpoint is changed. D-controller overcomes this problem by
anticipating the future behavior of the error. Its output depends on the rate of change of
error with respect to time, multiplied by derivative constant. It gives the kick start for the
output thereby increasing system response.

PID controller
In the above figure response of D, the controller is more, compared to the PI controller,
and also settling time of output is decreased. It improves the stability of the system by
compensating for phase lag caused by I-controller. Increasing the derivative gain
increases the speed of response.

PID Controller Response


So finally we observed that by combining these three controllers, we can get the desired
response for the system. Different manufacturers design different PID algorithms.
Types of PID Controller
PID controllers are classified into three types like ON/OFF, proportional, and standard
type controllers. These controllers are used based on the control system, the user can be
used the controller to regulate the method.
ON/OFF Control
An on-off control method is the simplest type of device used for temperature control. The
device output may be ON/OFF through no center state. This controller will turn ON the
output simply once the temperature crosses the fixed point. A limit controller is one
particular kind of ON/OFF controller that uses a latching relay. This relay is reset manually
and used to turn off a method once a certain temperature is attained.
Proportional Control
This kind of controller is designed to remove the cycling which is connected through
ON/OFF control. This PID controller will reduce the normal power which is supplied
toward the heater once the temperature reaches the fixed point.
This controller has one feature to control the heater so that it will not exceed the fixed
point however it will reach the fixed point to maintain a steady temperature.
This proportioning act can be achieved through switching ON & OFF the output for small
time periods. This time proportioning will change the ratio from ON time to OFF time for
controlling the temperature.
Standard Type PID Controller
This kind of PID controller will merge proportional control through integral & derivative
control to automatically assist the unit to compensate modifications within the system.
These modifications, integral & derivative are expressed in time-based units.
These controllers are also referred through their reciprocals, RATE & RESET
correspondingly. The terms of PID must be adjusted separately otherwise tuned to a
specific system with the trial as well as error. These controllers will offer the most precise
and steady control of the 3 types of controller.
Real-Time PID Controllers
At present, there are various kinds of PID controllers are available in the market. These
controllers are used for industrial control requirements like pressure, temperature, level,
and flow. Once these parameters are controlled through PID, choices comprise utilize a
separate PID controller or either PLC.
These separate controllers are employed wherever one otherwise two loops are required
to be checked as well as controlled otherwise in the conditions wherever it is complex to
the right of entry through larger systems.
These control devices provide different choices for solo & twin loop control. The
standalone type PID controllers provide several fixed-point configurations to produce the
autonomous several alarms.
These standalone controllers mainly comprise PID controllers from Honeywell,
temperature controllers from Yokogawa, autotune controllers from OMEGA, Siemens, and
ABB controllers.
PLCs are used like PID controllers in most of the industrial control applications The
arrangement of PID blocks can be done within PACs or PLCs to give superior choices for
an exact PLC control. These controllers are smarter as well as powerful as compared with
separate controllers. Each PLC includes the PID block within the software programming.
Tuning Methods
Before the working of the PID controller takes place, it must be tuned to suit with
dynamics of the process to be controlled. Designers give the default values for P, I, and D
terms, and these values couldn’t give the desired performance and sometimes leads to
instability and slow control performances. Different types of tuning methods are developed
to tune the PID controllers and require much attention from the operator to select the best
values of proportional, integral, and derivative gains. Some of these are given below.
PID controllers are used in most industrial applications but one should know the settings
of this controller to adjust it correctly to generate the preferred output. Here, tuning is
nothing but the procedure of receiving an ideal reply from the controller through setting
best proportional gains, integral & derivative factors.
The desired output of the PID controller can be obtained by tuning the controller. There
are different techniques available to get the required output from the controller like trial
&error, Zeigler-Nichols & process reaction curve. The most frequently used methods are
trial & error, Zeigler-Nichols, etc.
Trial and Error Method: It is a simple method of PID controller tuning. While the system
or controller is working, we can tune the controller. In this method, first, we have to set Ki
and Kd values to zero and increase the proportional term (Kp) until the system reaches
oscillating behavior. Once it is oscillating, adjust Ki (Integral term) so that oscillations stop
and finally adjust D to get a fast response.
Process Reaction Curve Technique: It is an open-loop tuning technique. It produces a
response when a step input is applied to the system. Initially, we have to apply some
control output to the system manually and have to record the response curve.
After that, we need to calculate slope, dead time, the rise time of the curve, and finally
substitute these values in P, I, and D equations to get the gain values of PID terms.

Process reaction curve


Zeigler-Nichols method: Zeigler-Nichols proposed closed-loop methods for tuning the
PID controller. Those are the continuous cycling method and damped oscillation method.
Procedures for both methods are the same but oscillation behavior is different. In this,
first, we have to set the p-controller constant, Kp to a particular value while Ki and Kd
values are zero. Proportional gain is increased till the system oscillates at a constant
amplitude.
Gain at which system produces constant oscillations is called ultimate gain (Ku) and the
period of oscillations is called the ultimate period (Pc). Once it is reached, we can enter
the values of P, I, and D in the PID controller by Zeigler-Nichols table depends on the
controller used like P, PI or PID, as shown below.

Zeigler-Nichols table
PID Controller Structure
PID controller consists of three terms, namely proportional, integral, and derivative
control. The combined operation of these three controllers gives a control strategy for
process control. PID controller manipulates the process variables like pressure, speed,
temperature, flow, etc. Some of the applications use PID controllers in cascade networks
where two or more PID’s are used to achieve control.

Structure of PID Controller


The above figure shows the structure of the PID controller. It consists of a PID block
which gives its output to the process block. Process/plant consists of final control devices
like actuators, control valves, and other control devices to control various processes of
industry/plant.
A feedback signal from the process plant is compared with a set point or reference signal
u(t) and the corresponding error signal e(t) is fed to the PID algorithm. According to the
proportional, integral, and derivative control calculations in the algorithm, the controller
produces a combined response or controlled output which is applied to plant control
devices.
All control applications don’t need all three control elements. Combinations like PI and PD
controls are very often used in practical applications.
Applications
The PID controller applications include the following.
The best PID controller application is temperature control where the controller uses an
input of a temperature sensor & its output can be allied to a control element like a fan or
heater. Generally, this controller is simply one element in a temperature control system.
The entire system must be examined as well as considered while choosing the right
controller.
Temperature Control of Furnace
Generally, furnaces are used to include heating as well as holds a huge amount of raw
material at huge temperatures. It is usual for the material occupied to include a huge
mass. Consequently, it takes a high quantity of inertia & the temperature of the material
doesn’t modify rapidly even when huge heat is applied. This feature results in a
moderately stable PV signal & permits the Derivative period to efficiently correct for fault
without extreme changes to either the FCE or the CO.
MPPT Charge Controller
The V-I characteristic of a photovoltaic cell mainly depends on the range of temperature
as well as irradiance. Based on the weather conditions, the current and operating voltage
will change constantly. So, it is extremely significant to track the highest PowerPoint of an
efficient photovoltaic system. PID controller is used to finding MPPT by giving fixed
voltage and current points to the PID controller. Once the weather condition is changed
then the tracker maintains current and voltage stable.
The Converter of Power Electronics
We know that converter is an application of power electronics, so a PID controller is
mostly used in converters. Whenever a converter is allied through a system based on the
change within the load, then the converter’s output will be changed. For instance, an
inverter is allied with load; the huge current is supplied once loads are increased. Thus,
the parameter of voltage as well as the current is not stable, but it will alter based on the
requirement.
In this state, this controller will generate PWM signals to activate the IGBTs of the
inverter. Based on the change within the load, the response signal is provided to the PID
controller so that it will produce n error. These signals are generated based on the fault
signal. In this state, we can obtain changeable input & output through a similar inverter.
Application of PID Controller: Closed Loop Control for a Brushless DC motor
PID Controller Interfacing
The design and interfacing of the PID controller can be done using the Arduino
microcontroller. In the laboratory, the Arduino based PID controller is designed using the
Arduino UNO board, electronic components, thermoelectric cooler, whereas the software
programming languages used in this system are C or C++. This system is used to control
the temperature within the laboratory.
The parameters of PID for a specific controller are found physically. The function of
various PID parameters can be implemented through the subsequent contrast between
different forms of controllers.
This interfacing system can efficiently calculate the temperature through an error of ±
0.6℃ whereas a constant temperature regulates through simply a small difference from
the preferred value is attained. The concepts used in this system will provide inexpensive
as well as exact techniques to manage physical parameters in a preferred range within
the laboratory.
Thus, this article discusses an overview of the PID controller which includes history, block
diagram, structure, types, working, tuning methods, interfacing, advantages, and
applications. We hope we have been able to provide basic yet precise knowledge about
PID controllers. Here is a simple question for you all. Amongst the different tuning
methods, which method is preferably used to achieve an optimum working of the PID
controller and why?
You are requested to kindly give your answers in the comment section below.
Photo Credits
PID controller block diagram by wikimedia
PID controller structure, P-controller, P – controller response & PID controller
by blog.opticontrols
P – controller response by controls.engin.umich
PID Controller response by wikimedia
Zeigler-Nichols table by controls.engin
Principles of PID Control and Tuning
Control of temperature, humidity, pressure, flow rate,
level or Ph process variables
Eurotherm controllers will automatically control process variables such as temperature, humidity, pressure, flow
rate, level or Ph – in fact, almost any physical variable that can be represented as an analogue signal.
The example below assumes that the variable is temperature, which is the most common, but the principles are
equally applicable to all analogue variables.
The automatic control loop
The diagram shows an automatic temperature control ‘loop’.
It consists of a sensor to measure the temperature, a controller and a power regulator.
The controller compares the measured temperature with the desired temperature, called the ‘setpoint’, and
regulates the output power to make them the same.
The measured temperature is referred to as the Process Value, or ‘PV’ for short.
The difference between the setpoint and the measured value is called the ‘error signal’.

Input sensors
An automatic controller requires some means of measuring the process value.
Eurotherm controllers will accept an input from almost any type of sensor. Linearisation of the measured value, if
necessary, will be performed within the controller.
In temperature applications, either a thermocouple or resistance thermometer is typically used. The type will depend
on the temperature range and the environment in which it has to operate.
In applications where it is difficult to attach a fixed temperature sensor, non-contact temperature measurement can
be made using infra-red or optical pyrometers. Eurotherm controllers support inputs from a wide range of
pyrometers.
Eurotherm controllers will accept direct inputs from strain gauges and pressure, flow, or Ph transducers.
In large process control applications, signal conditioners are normally used to convert the sensor measurement into
a 4 to 20mA or 0 to 10Vdc signal for transmission to the controller. In Eurotherm controllers it is a simple matter to
scale these inputs to the desired display range.
Controller outputs
An automatic controller requires some means of varying the heating power, or flow rate, or pressure, to the process
under control.
The main output types are:
Relay, which is used to operate a contactor or solenoid valve in heating and cooling applications.
Logic, which is used to switch a solid state relay. The benefits are: long life, no maintenance and the ability to
rapidly switch heaters which have a small thermal mass.
Triac, Triacs are solid state switches primarily used to operate solenoid valves. They are also ideal for the
positioning of motorised gas burner valves.
DC milliamps or volts, used for positioning control valves and to drive analogue input thyristors (used in phase
angle and three phase heating applications).
Types of control
There are three main types of control:
 On/Off control
 PID control
 Motorised Valve Positioning
On/Off Control
On/Off control action is shown in the graph below. The heating power is either fully On when the temperature is
below setpoint or fully Off when it is above. As a result the temperature oscillates about the setpoint.
The amplitude and time period of the oscillation is a function of the thermal lag between the heating source and the
temperature sensor. To prevent the output ‘chattering’ as the measured temperature crosses the setpoint, the
controller does not turn On and Off at precisely the same point. Instead a small differential known as the ‘hysteresis’
is applied. A typical value is 1°C On/Off control is satisfactory for non-critical heating applications where some
oscillation in the temperature is permissible.

PID Control
Most industrial processes such as plastic extrusion, metals treatment or semiconductor processing require stable
‘straight-line’ control of the temperature as shown below. Eurotherm controllers employ advanced PID control
algorithms to provide exactly that.
PID control is also referred to as “Three-term” control. The three terms are:
P for Proportional
I for Integral
D for Derivative
The output of the controller is the sum of the above three terms. The combined output is a function of the magnitude
and duration of the error signal, and the rate of change of the temperature or process value.
Proportional term
The Proportional term delivers an output which is proportional to the size of the error signal. In the example below,
the proportional band is 10°C and an error of 3°C will produce an output of 30%.
Proportional only controllers will not, in general, control precisely at setpoint, but with an offset corresponding to the
point at which the output power equals the heat loss from the system.
Integral action
The Integral term removes steady state control offsets by ramping the output up or down in proportion to the
amplitude and duration of the error signal. The ramp rate (Integral time constant) must be longer than the time
constant of the process to avoid oscillations.
Derivative action
The Derivative term is proportional to the rate of change of the temperature or process value. It is used to prevent
overshoot and undershoot of the setpoint and to restore the process value rapidly to the setpoint if there is a sudden
change in demand, for example if an oven door is opened.
High and low cutback
While the PID parameters are optimised for steady state control at or near the setpoint, high and low cutback
parameters are used to reduce overshoot and undershoot for large step changes in temperature. They respectively
set the number of degrees above and below setpoint at which the controller will start to increase or cutback the
output power
Time Proportioning action
To obtain ‘straight-line’ temperature control, a PID controller requires some means of varying the power smoothly
between 0 and 100%.
Time proportioning varies the % on time of relay, triac and logic outputs to deliver a variable output power between
0 and 100%. The graphs below illustrate the principle.

The cycle time must be short enough to allow the thermal mass of the load to smooth out the switching pulses. 20
seconds is typical. Systems with a small thermal mass will need shorter cycle times than can be provided with a
relay. In these cases, a solid state relay is typically used with cycle times down to 0.2 seconds.
In practice Cycle Time may not be a constant, but vary with Power Demand, particularly at the extremes of the
range 0-100%.

Motorised Valve Positioning


Motorised valves have two windings, one for opening the valve and the other for closing it. Control is achieved by
sending raise or lower pulses to the appropriate winding. Some valves are fitted with a feedback potentiometer to
indicate their position, while others are not.
Eurotherm controllers provide a control algorithm specifically designed for use with motorised valves. This algorithm
works equally well with or without a position feedback potentiometer
TEMPERATURE CONTROLLER
PID Controller: Types, Working and its Application
 2024-04-13
Knowledge is power. And in today’s world, it is the key to opening doors of opportunity and advancement.
In this article, learn more about the structure and working of a PID controller. PID controllers have a wide
range of applications in industrial processes for process control. 95% of the closed-loop operations of the
industrial automation sector use PID controllers. Hence being in the know about PID controllers is of the
essence.
What is a PID controller?
Before getting into its nitty-gritties, let’s first understand what a PID controller really is. PID full form in
electrical and electronics is a Proportional-Integral-Derivative controller. The definition of a PID controller
is that it is a control loop mechanism that “continuously calculates an error value e(t)
as the difference between a desired setpoint (SP) and a measured process
variable (PV) and applies a correction based on proportional, integral and
derivative terms (denoted P, I, D respectively), hence the name.”
In other words, it is a versatile feedback compensator structure used to regulate temperature,
flow, pressure, speed and other process variables. It is easily understandable, quite
practical and the most accurate and stable controller. What makes it a simple yet sophisticated device is
that it is fundamentally easy enough for any engineer to understand as the root concepts are
differentiation and integration but it also performs the complex tasks of capturing the behavior of a system
and predicting its future behavior.
Working principle
The working principle of a PID controller is that the proportional, integral and derivative terms can be
adjusted or “tuned” separately. Based on the difference between these values, a correction factor is
calculated and applied to the input. This is done to get the values to meet the current requirement. The
work can be broken down into three steps:
PID controller block diagram
Here is the block diagram of a PID controller to help you visualize the working principle.

In the above block diagram, each part has been shown properly:
 Reference or Setpoint
 Proportional Action (P)
 Integral Action (I)
 Derivative Action (D)
 Plant Operation or Structure
 Actual Response or Output
 Feedback Path
 Summing Points
The function of a PID controller
The PID controller serves the purpose of providing feedback to match a setpoint. For example, forcing a
thermostat to turn on or off based on preset temperature. PID controllers are best used in systems which
have relatively small mass and those that display quick reactions to changes in energy added in the
process. It automatically compensates the amount of energy available or the mass to be controlled due to
frequent changes in setpoint and is hence recommended in systems where the load changes often.
How does the PID controller work?
The PID controller works in a closed-loop system, maintaining output such that there is zero error
between the process variable and setpoint/desired output.
Closed-loop system: a brief overview
To understand the working of the PID controller adequately, let’s first discuss how the closed-loop system
works. The output of a PID controller is equal to the control input to the plant. It is calculated from the
feedback error. The following equation describes the calculation in the time domain:
u(t) = Kp*e(t) + Ki*e(t)*dt + Kp*dedt
Here, e(t) is the tracking error, i.e. the difference between the desired output (r) and the actual output (y).
The actions taken by the PID controller broadly depend on this value. On receiving this value, the
controller computes both the derivative and the integral of this error with respect to time. The control
signal (u) is fed to the plant and the new output (y) is obtained. This new output (y) is then fed back and
compared to the reference to find the new error signal (e).
The controller takes this new error signal and computes an updated control input. This procedure
continues indefinitely. The transfer function of a PID controller is found by taking the Laplace transform:
Kp +Kis+Kd*s = Kd*s2 + Kp*s + Kis
The P, I, and D Terms
Let’s understand the proportional, integral and derivative terms (Kp, Ki and Kd).
The P term is represented by Kp and is the proportional gain. Upon increasing Kp, the control signal for
the same level of error increases proportionally. Additionally, it’ll reduce (but not eliminate) the steady-
state error.
The I term represents the integral term Ki. Upon the build-up of persistent steady error, increasing the
value of I drives the error down. The downside to this is that it can make the system slow-moving and
oscillatory since when the error signal changes sign, it may take a while for the integrator to adapt
accordingly.
The D term is the derivative term of the controller (Kd). It allows the controller to anticipate error. As
derivative control increases so does the error, that is, the signal can become large if the error begins to
slope upward even if the magnitude of the error itself is relatively small.
P-Controller
Proportional or P-controller reduces the rise time, increases the overshoot
and reduces the steady-state error. It gives an output that is proportional to
the current error value e(t). It compares the desired or setpoint with the
actual value or feedback process value. The resultant error is multiplied
with a proportional constant to get the output. If the error is zero, the
output is zero (however, this is practically never the case).
When used alone, the P-controller needs biasing or manual reset. This is because it never reaches the
steady-state condition. While it provides stable operation, it always maintains some value of steady-state
error, however minimal. The response speed is directly proportional to Kp.
I-Controller
As the P-controller is limited in its ability to eliminate steady-state error, there is an offset between the
process variable and setpoint. This is where the I-controller comes in. It integrates the error over a period
of time until the error value reaches zero and holds the value to the final control device at which the error
becomes zero.
If the error values are negative, the integral control decreases accordingly. This simultaneously limits the
response speed and the stability of the system. The response speed increases as Ki decreases. Hence,
the PI controller is mostly used in cases where high-speed response is not critical.
D-controller
While the I-controller anticipates error, D-controller has the ability to predict the future behavior of error.
Its output depends on the derivative of the error with respect to time, multiplied by the derivative constant
Kd.
In the D-controller, the settling time of output is decreased. It also improves the stability of the system by
compensating for phase lag caused by the I-controller. Derivative gain Kd is directly proportional to the
response speed.
Tuning Methods
“Tuning” refers to the process of finding the range of values of the interacting parameters for which
optimal performance can be achieved.
Depending on the process, different tuning settings are required to better suit the various facets of the
situation the PID controller is being used in. For example, in a furnace, airflow will vary, the high
temperatures will change fluid density and viscosity steadily and barometric pressure will vary over time.
Hence, all of these need to be taken into account while selecting the PID settings (the gain applied to the
correction factor called “reset” and the time used in the integral and derivative calculations called “rate”).
Manual Tuning
Manual tuning is done by setting the reset time to its maximum value and the rate to zero. Then the gain
is gradually increased until the loop oscillates at a constant amplitude. Once this value is reached, the
gain is set to half this value and the reset is adjusted so it corrects for any offset within an acceptable
period. The biggest drawback is this process is too complex, challenging and involves a lot of calculations
and effort.
Tuning Heuristics
First described by Ziegler and Nichols in 1942, their methods entail measuring the delay in response and
the time taken to reach a new output value. Then the period of a steady-state oscillation is established.
One of the issues with this method is it sometimes produces a response considered too aggressive in
terms of overshoot and oscillation. It can also be time-consuming.
Automated Tuning
To overcome the disadvantages of the previous two methods, auto-tuning is preferred. All of Multispan’s
PID controllers come equipped with auto-tuning. Basically, the PID controller “learns” to calculate the
appropriate PID settings. It can respond to a disturbance or change in set point by observing both the
delay and the rate with which the change is made. This allows us to deal with imprecision and nonlinearity
in complex control situations.
Types of PID Controllers
Depending upon the system to be controlled, controllers can be divided into three basic types:
On/Off Controller
An on/off PID controller is the most fundamental form of the temperature control device. It gives a binary
output of on or off with no middle state. This output changes only when the temperature crosses the
setpoint. A particular example of on/off control is the limit controller. It is used to terminate a process
when a preset value of temperature is exceeded.
Proportional Controller
The proportional control was designed to remove the cycling associated with on/off control. As the
temperature approaches the setpoint, it decreases the average power supplied to the heater. This
ultimately slows down the heater so that it will not surpass the setpoint but will approach the setpoint and
maintain a stable temperature. This proportioning action can be accomplished by turning the output on
and off for short time intervals. This "time proportioning" varies the ratio of "on" time to "off" time to control
the temperature.

Standard PID Controller


This kind of PID controller will merge proportional control through integral & derivative control to
automatically assist the unit to compensate modifications within the system. These modifications, integral
& derivative are expressed in time-based units. The terms of PID must be adjusted separately otherwise
tuned to a specific system with the trial as well as error. These controllers are also referred to through
their reciprocals, RATE & RESET correspondingly. These controllers will offer the most precise and
steady control of the three types of controllers.
Applications of PID Controller
PID controllers universally benefit almost every process control application. Hence, they can be seen in
use in a variety of industries and fields. The best PID controller application, however, has to be
temperature control where the controller uses an input of a temperature sensor and its output can be
allied to the element (fan, heater, furnace, etc.)
Metal Furnaces
During heat treatment of metals, like “Ramp and Soak” sequences, precise control is required to ensure
desired metallurgical properties are achieved. As the metal in the furnace is usually massive, its
temperature doesn’t change easily even when huge heat is applied. This feature results in a moderately
stable PV signal & permits the Derivative period to efficiently correct for fault without extreme changes to
either the FCE or the CO.
Drying solvents from painted surfaces
Drying or evaporating of solvents from freshly painted surfaces need to be carried out at specific
temperatures. Too high temperature conditions may cause damage to substrates while too low conditions
may result in product damage and poor finishing. The same goes for the curing of rubber or leather.
pH control
As certain processes need pH values to be precisely within a particular range, PID controllers can be
used for that too. Its behaviour may change according to the current operating range. The dynamics of pH
tend to be slow as the acidity increases.
Baking
Precise temperatures need to be maintained in commercial ovens to ensure the necessary catalysts take
effect and the desired reactions are carried out successfully.
Automatic Machine Control
PID controllers play an important role in the automatic machine control system too. Common processes
they are used in are production counting, cutting, etc.
Automobile Industry
PID controllers also see a great demand in the automobile industry and are widely used such as car
speed measurement, automatic driving or self-driving, etc.
MPPT Charge controller
Depending on weather conditions, the current and operating voltage of photovoltaic cells will change
constantly. So it is extremely significant to track the highest power point of an efficient photovoltaic
system. PID controller is used in MPPT (Maximum Power Point Tracking) by giving fixed voltage and
current points to the PID as inputs.
Power Electronics
PID controllers are mostly used in converters, an application of power electronics. In addition to that, they
are also used in inverters, voltage stabilizers, etc.
Apart from this their application is widespread such as plastic processing & testing machines, scientific
laboratory and testing equipment’s like BOD, COD, Incubator, sterilizer’s, etc.
Why should you invest in PID controllers?
Advantages
 P Controller stabilizes the gain but produces a constant steady-state error.
 I Controller reduces or eliminates the steady-state error.
 D Controller reduces the rate of change of error.
 PID controller provides a very high-efficiency steady-state output than normal on/off controllers.
 As the PID controller works in three modes, error minimizing and data validation are easily possible.
Disadvantages
 Some PID controlling systems are complex in design and expensive
 The only other disadvantage is the tuning methodology
While these are the disadvantages of PID controllers found generally in the market, Multispan, at all
times, strives to deliver innovative, affordable and user-friendly products for various industrial
applications. Having first introduced PID temperature controllers in 2003, Multispan is now a pioneer in
PID-based technology with solutions perfected over the years.
We offer PID controllers in the basic economic range which have a single display and single relay output
(TC-49, UTC-121P, UTC-221P, UTC-421P). We also provide dual display and dual output PID controllers
which are relatively higher in cost. These come in varied sizes to accommodate your needs (UTC-121G,
UTC-221G, UTC-421G, UTC-321P, UTC-1202G, UTC-2202G, UTC4202G, UTC-3202G). Lastly, we have
PID controllers with three outputs (UTC-4203, UTC-3203). All of these have elegant LED displays and
auto/self tuning.
The biggest advantage of our range of PID controllers is they come built-in with modifications to better
serve the exact situation they work in. Take the example of the plastics industry, we have PID controllers
with built-in Ampere indication, meaning there is no need for separate ampere meters.
Another highlight of our controllers is we have a wide range, to combat the disadvantage of PID
controllers being too expensive. We have models that are economically viable as well as premium ones
with additional features. With sophisticated yet minimalistic designs, affordable prices and auto/self tuning
methodology, these controllers make for premier choices when deciding where to buy from.
Hope this article allows you to make an educated decision while picking the PID controllers for your field
of application. Still feel like you’re stuck at some point? If you need clarification or help of any sort
regarding how to choose PID controllers, our team would be happy to help! Feel free to reach out to us at
marketing.multispanindia.com

You might also like