PID Loop Simulator
PID Loop Simulator
Download
PID_Loop_Simulator.xlsx
How to use
The First Order Time Delay (FOTPD) process has 3 parameters – Process Gain, Lag Time and Delay Time. (Details of these
parameters are given in the "Process Model" section below.) These parameters should be entered under the “Process”
section of the Simulator.
Enter the controller values in the "Controller" section. These parameters are the controller gain, integral time in seconds and
the derivative time in seconds.
Choose the “Open Loop” option to view the open loop response. In this mode, the controller is not used. The chart shows the
effect of a step change in the manipulated variable (such as a control valve) on the process value.
The tool simulates the parallel form of the PID equation, this is form that is widely used in academic environments
where:
t = Time
MV = Manipulated Value
K = Controller Gain
T i = Integral Time
T d = Derivative Time
nolimit-digitalcontent
Torcuato Fernandez pointed out an error in original version, which has since has been corrected. I would like to thank
Torcuato for pointing out the error.
I would also like to thank Hannu Lehmuskuja for pointing out an error related to the delay.
Jose Maria, has shared some of his work with me and has kindly agreed to let me share it with others through this site. He
has added scrollbars to the tool, which assist the user understand how the controller settings affect the loop.
Process Model
To use the simulator, we need a model of the process. Obtaining the process parameters is known as System Identification.
Most chemical processes fall into one of 2 categories - first order process with dead time (FOPDT) and integrating processes
with dead time. This app works with the former.
1. Process Gain - the ratio of the change in process variable to the ratio of the change in manipulated variable
3. Dead time - time between moving the manipulated variable and start of the process response
One of the most common ways of obtaining these parameters is by doing a step test. To do this, wait for the process to be
steady and then step the Manipulated Variable (MV). The process variable (PV) will move as shown below.
Time constant = Time taken for the PV to change by 63.2% of the final change
Dead time = Time for the PV to start moving after the change in the MV
For the step response shown in the figure above, Dimensionless Gain = (10/200)/(5/100), where PV range = 200 units and
MV range = 100 units
Key in these parameters into the simulator and study the effects of changing the tuning parameters on the response of the
system.
Why 63.2% ?
The response of a delay free first order system is described by:
Since the final change in PV = Process gain x Change in MV, this equation can be written as
Change in PV = Final Change in PV x (1 - exp(-Time/Time Constant))
Change in PV = (1 - exp(-1)) x Final Change in PV = 0.632 x Final Change in PV or 63.2% of the final change in the PV
How it works
There are 2 worksheets in the Excel file, the calculations required for the simulation are done on the sheet "PID Calculations".
The first order process is calculated using a difference equation, given by:
Process Value = b x (Output at time offset by delay time) - a x Last PV; where
b = Process Gain x (1 + a)
The error is calculated by taking the difference between the PV and SP values. The error values are accumulated in column
F for the integral term calculation and the derivative term is calculated by taking the difference between the current error and
the last error. The PID calculation determines the next output value. The PID calculation is:
Controller Gain x error + Accumulated error / Integral time + Derivative x (Current error - Previous error)
The calculations are repeated at every second to obtain the response, which is plotted on the chart on the first sheet.