How to Model a PID Loop

As stated in a previous post, tuning PID controllers is a multi-step process. After you gather your data from your step test, the next step in the process is fitting a model to your Process Data. Fitting a model involves the analysis of bump test data and the calculation of tuning parameters that are specific to both your controller and your control objective. This post highlights some industry best practices for fitting a model to your test data.


Before you can even start to model your data, you need to have caused a clear change. This can be done by performing a step test. If you need to brush up on how to perform a step test, you can read our previous post here.


A good model should accurately describes three (3) things: How Far, How Fast, and How Much Delay. The how far variable, also known as Process Gain, describes how far the Process Variable will travel in response to a given change in Controller Output. The how fast variable is also known as the Process Time Constant. This variable describes how quickly the Process Variable moves in response to a change in the Controller Output. Finally, there is the Process Dead-Time which is the variable that represents how much delay exists in a process. More specifically Dead-Time is the delay from when a change in Controller Output is first initiated until the time that the measured Process Variable first begins to respond. The presence of Dead-Time is never a good thing in a control loop. While different processes have varying amounts of Dead-Time, when Dead-Time becomes equal or greater to your Process Time Constant, it can wreak havoc on your control objectives. Once you can understand these elements of your process data you are ready to create your model.


When modeling, it is best to have data at opposite extremes of the process. The picture above shows the bump tests performed for a temperature application.  The red bars cover the area where the process is “heating up” while the blue bar represents where the process is “cooling down”. Having data from both these events will allow you to see if there is a change in dynamics in one direction or another. When creating your model, capture several model segments around these “heating” and “cooling” sections so that you are able to compare and contrast. While the example of “heating” and “cooling” were used above, the thing to keep in mind it to capture models from opposite spectrums. If this example were changed to a valve, you would want to gather data from when the valve opened and when it closed.


A question that we see a lot is: “What constitutes a good model?”. The best way to determine a good model is looking at how accurately the model describes the underlying data. In the picture above, there are two models shown, one poorly fitted model and one well fitted model. The model on the left, which is illustrated by a red line, doesn’t track anywhere close to the black line which represents the Process Data. It is safe to say that this is not a good model. The model on the right on the other hand is an example of a good model. Notice that the model closely follows the Process Data. Even though it seems simple enough, it is surprising how often not properly fitting a model can throw a wrench into the tuning process.

While many in the industry use software that allows for visual modeling, what do you do if you need to model manually? The most common way to model manually is by using the First Order Plus Dead -Time or FOPDT modeling. There are three (3) steps in this process. First, you must calculate the Process Gain.


This graphic demonstrates how to calculate the Process Gain. For more details, visit Control Guru. Next, you will need to calculate the Process Time Constant.


This graphic demonstrates how to calculate the Process Time Constant. For more details, visit Control Guru. Finally, you will need to find the amount of Dead-Time.


This graphic demonstrates how to calculate the Dead-Time. For more details, visit Control Guru. When you calculate the values for the Process Gain, Process Time Constant, and Dead-Time, you are ready to move on to the tuning stage.


One final thing you need to consider is software. As seen above, modeling can be done by hand. However, software provides more accurate and consistent results. Furthermore, you need software that is equipped to handle the oscillatory and noisy data that is often found in the “real-world”. The image above shows a model of highly dynamic, “real-world” data that was calculated with the help of software. Be forewarned, not all software is equipped with the ability to model data that is noisy and oscillatory. If you do decide to look for PID optimization software, be sure to look for software that can handle data at a Non-Steady State.

If you need additional guidance on how to perform a test or how to tune your PIDs for optimal performance, consider attending a training workshop that focuses on understanding process dynamics and the PID controller or contact us.

These resources offer related content:


Overview of Cascade Control

While Cascade Control is generally considered an advanced control strategy, it is only marginally more complex to implement than Single Loop Control.  More often than not it is applied to improve the performance of a slow process such as temperature that demonstrates sluggish behavior.  Essentially...
Industrial 4.0SMALL

What are the differences between Industry 4.0, Big Data and the IIoT?

A few buzzwords seem to dominate today’s manufacturing trade press. Big Data, the Industrial Internet of Things (IIoT), and Industry 4.0 are a few of the big ideas that are currently crowding out other topics. Unfortunately, all too often these three terms are being used...

What is the Moving Boxcar Method? How is Boxcar Averaging Applied to Control Loop Monitoring?

No surprise – advanced diagnostic tools like PlantESP constantly crunch data in order to uncover important trends and provide actionable insights. As the automation market’s leading controller performance monitoring solution PlantESP typically performs complex calculations on each PID control loop numerous times each day. Such...

Still looking for more?

Now that you’ve gotten the basics, connect with our team to learn how our people, processes and technologies can help you optimize.