The PID learning process

While there are many excellent loop tuning methods available, many practitioners prefer tweaking proportional-integral-derivative (PID) tuning constants or using rules-of-thumb rather than doing the required step test and data analysis. But having knowledge about how the individual PID components interact can go a long way to learning proper tuning theory and methods.

03/06/2017


Table of helpful PID abbreviations. Courtesy: SasolPID control consists of proportional, integral, and derivative actions. The interrelationship between these three components often is misunderstood. This is further aggravated by different implementations of the basic PID algorithm, namely PI-D or I-PD (see Table "Helpful abbreviations").

To address these issues, a PID simulator was developed in Excel that shows how the different PID components interact. This idea was then converted to an online tool that will run parallel to the PID equations in the plant, showing the contributions of proportional, integral, and derivative actions separately. This is an excellent training tool for teaching new control engineers the interactions between the proportional, integral, and derivative components. It also is useful to assist practitioners with closed-loop PID troubleshooting and tuning. 

Background

Figure 1: Offline proportional-integral-derivative (PID) simulator. Courtesy: SasolWhile it is ideal to tune loops by first applying a manual step test, determining the process dynamics, and then calculating tuning constants using an appropriate rule, this is often not practical. An operator may not be comfortable with putting certain loops in manual (even if the tuning is not ideal) and even more so with step tests. Inevitably, many loops are still tuned closed-loop by trial and error. It may take a very long time to find good tuning by making small adjustments to the tuning constants. But making larger adjustments can be riskier and easily lead to oscillating loops and subsequent plant upsets.

While experienced practitioners are able to get good results with this method, it is usually a very time consuming process. For novices who do not fully understand how the proportional, integral, and derivative components of a PID loop interact with each other, it can be much more difficult to find optimal tuning constants.

Figure 2: Real-time proportional-integral-derivative (PID) spreadsheet graphs. Courtesy: SasolTo address this issue, an offline PID simulator was developed in Excel. This used the different PID algorithms (PID, P-ID, and I-PD) and showed changes in setpoint (SP), process variable (PV), and controller output (OP) on a chart. At the same time, a second chart showed the proportional, integral, and derivative components separately (see Figure 1).

This simulator was used as a training tool to enable novice engineers to better understand the complexities regarding PID control, including tuning different PID algorithms.

Figure 3: proportional-integral-derivative (PID) parameters acquired from the distributed control system (DCS) via OPC. Courtesy: SasolIt was then decided to deploy a real-time version on a distributed control system (DCS) controlling a live plant. The idea was to create a tool that could, in real time, split the output of an actual PID controller into the proportional part, the integral part, and the derivative part in real time and provide trends of these. This was done by replicating the PID algorithms used on the DCS in Excel. The trends shown in Figure 2 clearly show the different contributions of the components of PID and aid the control engineer in determining which tuning parameters need adjustment as well has how much to adjust them. They also aid novice engineers in understanding the exact impact of changing tuning parameters. 

Implementation of software

From the beginning of the software development, it was decided that the solution should not require purchasing any additional software, be easy to use, and be as general as possible. For these reasons, it was decided to implement the software in Excel using a Visual Basic for Applications (VBA) script and a free OPC library.

For initial setup, the OPC library should be installed and the Excel spreadsheet containing the code must be copied onto the machine. The user then should insert the name of the server where the tags are stored, the OPC server name, and the tag name of the loop being tuned into the spreadsheet and begin the data collection. All the other necessary information (process variable range, tuning constants, controller mode, etc.) is automatically acquired by the software (see Figure 3).

The calculation of the proportional, integral, and derivative parts is done using vendor-specific equations to ensure complete accuracy. Tuning changes are then made while monitoring the control loop with the software.

Note that six trends are provided to assist with the loop tuning. Setpoint and process variable are trended together, with controller output below. Proportional, integral, and derivative parts of the controller output are trended together with tuning constant values below. This means the engineer does not need to keep track of tuning changes as it is done automatically. Finally, controller output variance is shown below the controller output and integral of squared error (ISE) and integral over time of absolute error (ITAE) are trended together. The values for the last two trends are calculated over a configurable moving time window, and provide quantitative indications of the performance of the loop.

Figure 4: Various tuning rules. Courtesy: Sasol

On a separate worksheet shown in Figure 4, several basic loop tuning rules are provided. The engineer simply enters values for the process dynamics (if they are known) and tuning constants are calculated automatically. The engineer also can include additional tuning rules if desired.

After tuning is completed, the engineer can save the Excel document with a new filename and then have a record of the tuning changes done along with the improvement of the loop's performance.

Results of the offline tool

The offline tool was used mostly to teach new control engineers the complexities of PID control. In Figure 5, a typical view that is normally used to teach PID control can be seen.

Figure 5: Typical proportional-integral-derivative (PID) loop with a setpoint (SP) change and disturbance. Courtesy: Sasol

The PI-D algorithm was used and the loop subjected to a SP change and a disturbance of equal magnitude. What can be seen here is that:

  • The loop shows a reasonable response to SP changes and disturbances
  • PV noise influences the OP response.

Figure 6: P, I, and D components associated with Figure 5. Courtesy: Sasol

When the second chart in Figure 6 is considered, it also can be shown that:

  • Even though the PID algorithm used filters with the derivative action, most of the PV noise reflected in the response of the loop is because of the derivative action. Some of the noisy OP signal is because of the proportional action, and noise has very little impact on the integral component.
  • In Figure 6, the sharp OP response on the SP change would lead engineers to believe that the proportional action is dominant. When figure 6 is considered, it shows that integral action does most of the work.
  • Because of the noise, the interaction of the derivative component is hidden.

Fig 7: Proportional-integral-derivative (PID) response without process variable (PV) noise. Courtesy: Sasol

If the first example is repeated without any noise on the PV signal, the effect of derivative interaction can be examined more clearly.

Figure 8: P, I, and D components without noise. Courtesy: Sasol

Not much more can be learned when comparing Figure 7 to Figure 5. But when Figure 8 is compared with Figure 6, the following can be highlighted to students:

  • Note how the proportional component returns to 0 as PV error returns to 0. This can be used to explain why proportional action alone never can return a loop to setpoint.
  • Also note the interaction between proportional and integral. Proportional quickly increases the OP and then decreases it again as error starts decreasing. During this time, integral action must smoothly take over and keep the OP higher than before.
  • Note how the derivative action counteracts the proportional and integral action during the SP change, but assists during the disturbance rejection. Keep in mind that the PI-D algorithm was used.

The simulation also can be used to:

  • Allow trainees to experiment with and see the impact of different tuning constants.
  • Show the interactions between P, I, and D with different PID algorithms such as PID and I-PD.
  • Demonstrate tuning changes required to stop a cycle on a control loop.
  • Demonstrate the impact of valve stiction on loop tuning.
  • Show how algorithms such as I only or P only work.
  • Show the undesired derivative kick when making a SP change using the PID algorithm.
  • How P only can eliminate offset when controlling an integrating variable. 

Results of the online tool

Two examples where the software was used are shown. In Example 1, a cycling loop is shown. Expert control engineers will be able to discern that the cycle is caused by too aggressive integral action but a novice can use the trends shown in Figure 9. Here, it clearly shows that the major contributor to the control action is the integral action. After the integral time is increased, the cycle stops. Notice that even though only one tuning parameter was changed, all three components have changed.

Figure 9: Trends showing how changing the integral time affects the P, I, and D parts of controller output (OP) as well as controller performance. Courtesy: Sasol

This is due to the interactive nature of P, I, and D. By increasing integral time, we have decreased the OP movement, which in turn has decreased the PV movement (in this case). This then decreases the movement of all three components of the PID algorithm and the cycle stops. The effect on OP variance, ITAE, and ISE also is shown in Figure 10.

Figure 10: Effect of tuning change on controller output (OP) variance and error. Courtesy: Sasol

In Example 2, the output of the controller is excessively noisy. Figure 11 shows the cause of this is excessive derivative action. After decreasing the derivative time, the output is much less noisy. 

Figure 11: Effect of derivative on controller output (OP) noise. Courtesy: Sasol

Tuning in action

The interactions of P, I, and D can be complex to understand and the matter is made even more complicated by the various implementations of the PID algorithm by different vendors. Implementing software as described can be done by any control engineer with some programming experience, without any extra costs. The simulation provides a valuable training tool for new engineers learning about PID control that intuitively illustrates the effects and interactions of P, I, and D. The live tool can be used to aid an engineer in the tuning process as well as provide quantitative indications of control improvements. The use of vendor-specific equations further aids the control engineer to understand how their specific PID algorithms work.

Nic van der Mey is a control engineer working on ethylene separation and LAN units at Secunda Chemical Operations plant of Sasol, Secunda, South Africa. Gustaf Gous is a lead specialist in control engineering working at the Secunda Chemical Operations plant of Sasol, Secunda, South Africa. Edited by Jack Smith, content manager, CFE Media, Control Engineering, jsmith@cfemedia.com.

MORE ADVICE

Key concepts

  • A proportional-integral-derivative (PID) training simulator was developed in Excel that shows how the different PID components interact then converted to an online tool that runs parallel to the PID equations in the plant, showing the contributions of proportional, integral, and derivative actions separately.
  • The calculation of the proportional, integral, and derivative parts is done using vendor-specific equations to ensure complete accuracy. Tuning changes are then made while monitoring the control loop with the software.
  • The use of vendor-specific equations further aids the control engineer to understand how their specific PID algorithms work.

Consider this

How adept at tuning PID loops are the control engineers in your plant?

ONLINE extra

See related stories about PID linked below.



Engineers' Choice Awards
The Engineers' Choice Awards highlight some of the best new control, instrumentation and automation products as chosen by Control Engineering subscribers.
System Integrator Giants
The System Integrator Giants program lists the top 100 system integrators among companies listed in CFE Media's Global System Integrator Database.
System Integrator of the Year
Each year, a panel of Control Engineering and Plant Engineering editors and industry expert judges select the System Integrator of the Year Award winners in three categories.
How to Maximize Factory Automation Efficiency with Low Cost Machine Vision
This eGuide illustrates solutions, applications and benefits of machine vision systems.
Wireless Reliability in Harsh Environments
Learn how to increase device reliability in harsh environments and decrease unplanned system downtime.
Human Factors and the Impact on Plant Safety
This eGuide contains a series of articles and videos that considers theoretical and practical; immediate needs and a look into the future.
August 2018
Augmented reality and virtual reality education, autotuning PID control, cybersecurity advice, educating engineers
July 2018
Ladder logic best practices and object-oriented programming, safety instrumented systems, enclosure design issues and challenges, process control advice
June 2018
Discrete and process sensor fundamentals, autotuning controls, system integrator roundtable
Edge Computing
This article collection contains several articles on how today's technologies heap benefits onto an edge-computing architecture such as faster computing, better networking, more memory, smarter analytics, cloud-based intelligence, and lower costs.
Data Center Design
Data centers, data closets, edge and cloud computing, co-location facilities, and similar topics are among the fastest-changing in the industry.
PLCs
Programmable logic controllers (PLCs) represent the logic (decision) part of the control loop of sense, decide, and actuate. Featured articles in this digital report compare PLCs and programmable automation controllers (PACs), industrial PCs, and robotic controllers.
SIDB

Find and connect with the most suitable service provider for your unique application. Start searching the Global System Integrator Database Now!

August 2018
SCADA standardization, capital expenditures, data-driven drilling and execution
June 2018
Machine learning, produced water benefits, progressive cavity pumps
April 2018
ROVs, rigs, and the real time; wellsite valve manifolds; AI on a chip; analytics use for pipelines
John O. Ayuk, PE, CFSE, PMP, CAP
Automation Engineer; Wood Group
Doug Baker
System Integrator; Cross Integrated Systems Group
Jose S. Vasquez, Jr.
Jose S. Vasquez, Jr.
Fire & Life Safety Engineer; Technip USA Inc.
Data Centers: Impacts of Climate and Cooling Technology
This course focuses on climate analysis, appropriateness of cooling system selection, and combining cooling systems.
Safety First: Arc Flash 101
This course will help identify and reveal electrical hazards and identify the solutions to implementing and maintaining a safe work environment.
Critical Power: Hospital Electrical Systems
This course explains how maintaining power and communication systems through emergency power-generation systems is critical.
Engineers' Choice Awards
The Engineers' Choice Awards highlight some of the best new control, instrumentation and automation products as chosen by Control Engineering subscribers.
System Integrator Giants
The System Integrator Giants program lists the top 100 system integrators among companies listed in CFE Media's Global System Integrator Database.
System Integrator of the Year
Each year, a panel of Control Engineering and Plant Engineering editors and industry expert judges select the System Integrator of the Year Award winners in three categories.
How to Maximize Factory Automation Efficiency with Low Cost Machine Vision
This eGuide illustrates solutions, applications and benefits of machine vision systems.
Wireless Reliability in Harsh Environments
Learn how to increase device reliability in harsh environments and decrease unplanned system downtime.
Human Factors and the Impact on Plant Safety
This eGuide contains a series of articles and videos that considers theoretical and practical; immediate needs and a look into the future.
August 2018
Augmented reality and virtual reality education, autotuning PID control, cybersecurity advice, educating engineers
July 2018
Ladder logic best practices and object-oriented programming, safety instrumented systems, enclosure design issues and challenges, process control advice
June 2018
Discrete and process sensor fundamentals, autotuning controls, system integrator roundtable
Edge Computing
This article collection contains several articles on how today's technologies heap benefits onto an edge-computing architecture such as faster computing, better networking, more memory, smarter analytics, cloud-based intelligence, and lower costs.
Data Center Design
Data centers, data closets, edge and cloud computing, co-location facilities, and similar topics are among the fastest-changing in the industry.
PLCs
Programmable logic controllers (PLCs) represent the logic (decision) part of the control loop of sense, decide, and actuate. Featured articles in this digital report compare PLCs and programmable automation controllers (PACs), industrial PCs, and robotic controllers.
SIDB

Find and connect with the most suitable service provider for your unique application. Start searching the Global System Integrator Database Now!

August 2018
SCADA standardization, capital expenditures, data-driven drilling and execution
June 2018
Machine learning, produced water benefits, progressive cavity pumps
April 2018
ROVs, rigs, and the real time; wellsite valve manifolds; AI on a chip; analytics use for pipelines
John O. Ayuk, PE, CFSE, PMP, CAP
Automation Engineer; Wood Group
Doug Baker
System Integrator; Cross Integrated Systems Group
Jose S. Vasquez, Jr.
Jose S. Vasquez, Jr.
Fire & Life Safety Engineer; Technip USA Inc.
Data Centers: Impacts of Climate and Cooling Technology
This course focuses on climate analysis, appropriateness of cooling system selection, and combining cooling systems.
Safety First: Arc Flash 101
This course will help identify and reveal electrical hazards and identify the solutions to implementing and maintaining a safe work environment.
Critical Power: Hospital Electrical Systems
This course explains how maintaining power and communication systems through emergency power-generation systems is critical.
Engineers' Choice Awards
The Engineers' Choice Awards highlight some of the best new control, instrumentation and automation products as chosen by Control Engineering subscribers.
System Integrator Giants
The System Integrator Giants program lists the top 100 system integrators among companies listed in CFE Media's Global System Integrator Database.
System Integrator of the Year
Each year, a panel of Control Engineering and Plant Engineering editors and industry expert judges select the System Integrator of the Year Award winners in three categories.
How to Maximize Factory Automation Efficiency with Low Cost Machine Vision
This eGuide illustrates solutions, applications and benefits of machine vision systems.
Wireless Reliability in Harsh Environments
Learn how to increase device reliability in harsh environments and decrease unplanned system downtime.
Human Factors and the Impact on Plant Safety
This eGuide contains a series of articles and videos that considers theoretical and practical; immediate needs and a look into the future.
August 2018
Augmented reality and virtual reality education, autotuning PID control, cybersecurity advice, educating engineers
July 2018
Ladder logic best practices and object-oriented programming, safety instrumented systems, enclosure design issues and challenges, process control advice
June 2018
Discrete and process sensor fundamentals, autotuning controls, system integrator roundtable
Edge Computing
This article collection contains several articles on how today's technologies heap benefits onto an edge-computing architecture such as faster computing, better networking, more memory, smarter analytics, cloud-based intelligence, and lower costs.
Data Center Design
Data centers, data closets, edge and cloud computing, co-location facilities, and similar topics are among the fastest-changing in the industry.
PLCs
Programmable logic controllers (PLCs) represent the logic (decision) part of the control loop of sense, decide, and actuate. Featured articles in this digital report compare PLCs and programmable automation controllers (PACs), industrial PCs, and robotic controllers.
SIDB

Find and connect with the most suitable service provider for your unique application. Start searching the Global System Integrator Database Now!

August 2018
SCADA standardization, capital expenditures, data-driven drilling and execution
June 2018
Machine learning, produced water benefits, progressive cavity pumps
April 2018
ROVs, rigs, and the real time; wellsite valve manifolds; AI on a chip; analytics use for pipelines
John O. Ayuk, PE, CFSE, PMP, CAP
Automation Engineer; Wood Group
Doug Baker
System Integrator; Cross Integrated Systems Group
Jose S. Vasquez, Jr.
Jose S. Vasquez, Jr.
Fire & Life Safety Engineer; Technip USA Inc.
Data Centers: Impacts of Climate and Cooling Technology
This course focuses on climate analysis, appropriateness of cooling system selection, and combining cooling systems.
Safety First: Arc Flash 101
This course will help identify and reveal electrical hazards and identify the solutions to implementing and maintaining a safe work environment.
Critical Power: Hospital Electrical Systems
This course explains how maintaining power and communication systems through emergency power-generation systems is critical.
click me