# What is the Best PID Execution Time?

An execution time that is too slow can degrade control loop performance. An execution time too fast can unnecessarily increase the loading in the distributed control system (DCS) or programmable logic controller (PLC). Less recognized is an excessively fast module execution time can cause the module to run out of free time, decrease the signal to noise ratio, and increase valve packing wear.

While we may understand that too slow of an execution time can cause poor control, there has been typically a lot of confusion on the quantification of the effect. Greg Shinskey did the best job of quantifying the effect by developing an equation that shows the integrated error for an unmeasured disturbance is proportional to the sum of the integral time plus the PID execution time and signal filter time. Shinskey's equation with a translation from controller output required to open loop error is Equation 1 in the resource file Effect-of-PID-Execution-Time.pdf and Equation 2 in the online article "**PID tuning rules**"

The equations reveal that the exact effect depends upon the tuning of the controller, and in particular the relative size of the execution time compared to the integral time and signal filter time. The integral time in controllers varies widely due to tuning rules. If we consider just self-regulating loops, Lambda tuning sets the integral time equal to the open loop time constant, Fertik tuning rules sets the integral time proportional to the 63% response time (total loop deadtime plus open loop time constant), and maximum disturbance rejection tuning sets the integral time proportional to the total loop deadtime. Since the open loop time constant (largest time constant in the loop), varies considerably from hours in column temperature to milliseconds in liquid pressure loops, and this time constant can be more than 100 times the loop deadtime in vessel temperature control, we end up with integral times depending upon the tuning method that varies by more than an order of magnitude. Also since unmeasured disturbances are by nature largely unknown, users are not aware of the detrimental effect. Furthermore, the literature tends to focus on setpoint response for which other considerations such as PID structure and setpoint feedforward can make PID execution time effects inconsequential.

Even less unknown and appreciated is the degradation in the ultimate limit to loop performance for unmeasured disturbances. The addition deadtime from the PID execution time is ½ of the module execution time plus calculation time (latency) as shown in Equation 5 in the resource file. For a simple PID loop, the latency is nearly zero. For loops with minimal process and valve deadtime that are tuned with close to the maximum controller gain and minimum integral time (e.g. liquid pressure, furnace pressure, and surge control), the additional deadtime from the PID execution time is a concern. In most of these cases a PID execution time of 100 milliseconds is fast enough. However, I have seen some applications where the use of a variable speed drive eliminating the delays and lags of a control valve required a faster execution time as discussed in "Analog Control Holdouts" These loops have integral times faster than 1 second.

For rapid thermal processing in semiconductor manufacturing, the ramp rate is temperature can be as fast as 200 degC per sec demanding a sample rate of 100 Hz as discussed in the Control Talk column "**Ultimate Limits to Performance**"

If the PID execution time is less than 10% of the integral time less the signal filter time per Equation 3, the increase in loop deadtime is usually not a significant consideration.

An execution time too fast can decrease the signal to noise ratio if there is an appreciable quantization error (resolution limit) and a slow process. The1980s vintage DCS PLC often had 12 bit A/D thermocouple and RTD cards with wide temperature ranges. Since one bit was the sign bit leaving 11 bits for the measurement, the quantization error was approximately the card temperature span divided by 2 to the 11th power, which is some cases was about 0.25 degF. Since temperatures on vessels and columns change less than 0.25 degF per minute, process and sensor noise was often larger than the process response. The poor signal to noise ratio wore out valve packing, caused the user to reduce the controller gain and decrease or eliminate rate action, and add a large signal filter degrading performance.

To summarize the module execution time should be less than 10% of the integral time less the signal filter time as shown in Equation 3, greater than half the % quantization error divided by the maximum % rate of change of the process variable as shown in Equation 4, and greater than the period of noise causing fluctuations in the PID output to exceed the final control element deadband as shown in Equation 5.