Arun Ramamoorthy, PhD Wed Oct 10

Understanding PID Loop Process Control, Part 2

Part 1 of this series introduced the three components of a PID loop: Proportional (P), Integral (I), and Derivative (D), which are used to regulate a process so that it automatically adjusts to changes. Changes can occur in either the Process Variable (PV) or Setpoint (SP) and are regulated by adjusting the Control Variable (CV). In this blog post, we will explore the roles played by P, I, and D using simplified numeric examples and basic arithmetic.

Proportional Component

The Proportional (P) component simply multiplies the difference between where you want to be and where you are right now and passes it to the output, i.e. the Error (difference between SP and PV). A low P value means multiplying the Error by a small number, which results in a feeble reaction. The P value determines the responsiveness of your system. Interestingly, the same P value will produce different responses in different types of processes.

Example 1

Let's use a variable frequency drive (VFD) pump for our example. A VFD is used to maintain discharge pressure in a water distribution system. The discharge pressure created by the VFD is determined not only by its speed but also by the system demand.

For the following example, let's assume:

  • the desired discharge pressure (SP) is 50 psi
  • the measured discharge pressure (PV) is 40 psi
  • the PID parameters are P = 2, I = 0, and D = 0
  • the VFD speed command (CV) will be varied so that the PV is equal to the SP

The error in the system is calculated by subtracting the PV from the SP:

SP - PV = Error

Therefore:

50 - 40 = 10 psi

The speed of the VFD (CV) is calculated by multiplying the error in the system by the P:

CV = Error x P

Therefore:

10 x 2 = 20 Hz

Now imagine the measured pressure (PV) changes from 45 psi to 38 psi because of increased demand and the P term is set to 1. The change in VFD speed command is calculated as:

CVinitial = Error x P

CVfinal = Error x P

Change in CV = CVfinal - CVinitial

Therefore:

(50-45) x 1 = 5 Hz

(50-38) x 1 = 12 Hz

 12 – 5 = 7 Hz

In other words, setting the P term to 1 allows the CV to change proportionately to the change in Error.

Tips and tricks
  • If small changes in the CV cause rapid, large changes in the PV, then keep your P value small.
  • If the PV overshoots and oscillates around the SP value, then lower your P value.
  • If the PV reaches a stable state but is below the SP, then introduce the Integral term.

In the following diagram, the darker line is the CV as a response to change and the lighter line is the SP:

Increasing Proportional Action Diagram: https://www.researchgate.net/figure/Tuning-Map-for-Proportional-and-Integral-Effects-Harold-2004_fig4_319291946
Image source: https://www.researchgate.net/figure/Tuning-Map-for-Proportional-and-Integral-Effects-Harold-2004_fig4_319291946

Integral Component

The Integral (I) component looks at the amount and duration of Error. Consider the Integral term as something that makes up for what the P term could not achieve in a reasonable time. Historically, the Integral term is also known as the Reset. The Reset is measured in "repeats per minute" or "minutes per repeat." Another perspective is to view I (in units of minutes per repeat) as the time it takes the output to increase by the Proportional amount.

Example 2

For the next example, let's use the same VFD from Example 1. This time, let's assume:

  • the desired discharge pressure (SP) is 50 psi
  • the measured discharge pressure (PV) is 40 psi
  • the PID values are P = 2, I = 1 minute, and D = 0

The Proportional output would be calculated as:

CV = Error x P

Therefore:

(50 - 40) x 2 = 20 Hz

Since the Integral is set to 1 minute, the output will increase by 20 Hz in 1 minute. The output will continue to increase by 20 Hz per minute until it reaches the maximum limit.

Tips and tricks
  • The bigger the Integral value (in minutes per repeat), the slower the response will be. If the Integral is in repeats per minute, then the opposite is true.
  • The Integral is useful when a stable state is reached but it is not equal to the SP.
PID Increase Integral Action Diagram Tuning Map for Proportional and Integral Effects
Image source: https://www.researchgate.net/figure/Tuning-Map-for-Proportional-and-Integral-Effects-Harold-2004_fig4_319291946

Derivative Component

The Derivative (D) is a predictive component that works by evaluating the rate of change of the Error. The Derivative ensures a very quick response to a change in Error. However, a rapid response by the Derivative can become unstable if there is noise in the process variable or a large SP change.

EXAMPLE 3

Once again using the VFD example, let's assume:

  • the desired discharge pressure (SP) is 50 psi
  • the measured discharge pressure (PV) is 40 psi and is decreasing by 1 psi per minute
  • the PID parameters are P = 0, I = 0, and D = 10 minutes/repeat

The Derivative output would be calculated as such:

CV = rate of change of Error x D

Therefore:

(1 psi/1 minute) x 10 = 10 Hz

Thus, a 1 psi drop per minute will elicit a 10 Hz change in the VFD speed.

Keep in Mind

The above examples are simplified static scenarios presented in the interest of clarity. Real-life scenarios will be dynamic and the calculated parameters will change continuously. There are many more features of a PID control, such as integral windup and cascade control, which are beyond the scope of this blog post.

Tuning for Beginners

If you are new to managing PID loop process controls, follow these steps to tune your first PID loop (as long as it is safe to do so!):

  • Try to find the PID values for a similar process and use them as a starting point. If not, then:
  • Start with a small P and no I or D.
  • Change the SP and observe the PV.
  • If the PV reaches a stable state way below the SP, then slowly increase the P until you nearly reach the SP. (However, do not increase the P too quickly, otherwise the PV will start oscillating).
  • Start adding small amounts of Integral to increase the speed with which PV reaches SP and stays there.
  • Most systems should not need a D term. If your system needs one, I recommend you consult a professional!😊

Is your control system getting a little long in the tooth? Check out this white paper detailing five steps you can take to upgrade your system efficiently with minimal risk. 

Download the White Paper

Click here to go back and review part 1 of this series

This blog was originally published on October 10, 2018, and was last updated June 28, 2024.

avatar

Arun Ramamoorthy, PhD

Arun is a Senior Control Systems Integrator based in Ottawa, Canada. He joined Vertech in 2017 after 11 years in the Water/Wastewater controls industry, serving various customers in the southwest region of the USA. Arun loves the flexibility and power of the Ignition system and has earned Inductive Automation’s Gold certification to better serve the controls and business needs of his customers. In his personal life, he enjoys outdoor activities like hiking, ice skating, and astronomy.

COMMENTS

RELATED ARTICLES

SUBSCRIBE TO OUR BLOG

Sign up to get the latest from Vertech delivered right to your inbox.