# The Dynamics of Process Control

**The Dynamics of Process Control **

by Ken Melvin

*Gain new insights into process control and find out how a specific process controller works*

How best does a process controller go about controlling the controlled variable at or very near set point at all times? At any given time, if the current set point and variable are the same and are changing at the same rate, then the controller is providing the correct output. If the two are not the same at a given time or if they are changing at different rates, then the controller needs to adjust its output so as to bring the variable to and maintain it at set point.

**Controlling the variable**

A controller could conceivably know the values for the current variable and the current set point at all times. A time base or clock is needed, however, for determining rates. Evaluating information, making calculations, and making changes takes time. Together, these time requirements imply a cycle of operation (i.e., one that is long enough to see changes and perform the necessary calculations).

Each cycle of operation, the "Melvin" controller (or simply the Controller) determines the current error and change in error and converts each to an equivalent output value. The Controller then adds the converted values to its previous output; thus, it provides the current output needed to control the variable at or very near the set point at all times. Or,

**(1)** O_{C} = O_{O }+ SCr [(E_{C} x t/SRT) + dE_{C}],

where O_{C} and O_{O} represent the current and previous controller output values, respectively, E_{C} and dE_{C} represent the current error value and change in error, respectively, and t represents the cycle time. The concepts behind the terms SCr and SRT, and the determination of their values, are dealt with later in this article.

**A controller-to-system closeup**

Now for a closer look at the controller's relationship to the system being controlled and at the dynamics of the system itself: The units of error and change in error are those of the variable. The units of controller output are usually percent. The variable's status is an input to the controller. The controller output controls an input to the system being controlled. The system output is the system load.

Controller output, measured in percent, controls the rate of a system input (e.g., gal/min, kW/s, and so on). The system output or load is also at a rate. If the controller output increases, the system input rate increases. Figure 1A shows that during a given time, if the system input rate exceeds that of system output, the variable will increase (e.g., the tank gets ever fuller, the motor runs ever faster, or the rocket goes ever faster). Likewise, if system output increases without a similar increase in input, the variable decreases.

Knowing all this, how can the error and the change in error, both in units of the variable, be converted to equivalent units of controller output units? The Controller uses the system characteristic ratio, SCr, where SCr is the ratio of a change in controller output, dCO, to that of the resultant change in the variable, dV.

Obvious? At first glance, the units of the ratio, dCO/dV, are those of the controller output to those of the variable (e.g., %/m) and multiplying same by an error having units of the variable (e.g., m) would give a result in units of the controller output (e.g., %). A closer look, however, reveals that while the controller output units may be measured in percent, the controller varies the rate of a system input to effect control of the variable. In terms of the system, this same ratio of a change in controller output to a resultant change in variable might be one of (liters/min)/m; or it might be (Btu/hr)/°C, (watts/sec)/rpm, and so on.

While system input is consistently at a rate, what, if anything, is consistent about variables? What commonality exists among variables where one has units of quantity (e.g., inches, °C, and so on), another has those of proportion (e.g., moles per liter), and yet another those of velocity (e.g., fps, mph, or gpm)?

The variable isn't a measure of system output or the rate thereof. Instead, the current *measured* variable seems to quantify some parameter representing the controlled system's status quo-be it level, energy, velocity, concentration, or some other parameter. This quantification might be a location on a scale of possible values (e.g., on a scale of possible values from 0-150 mph, the car's speed, the current variable, is 75). This value, 75 mph, doesn't tell the rate of system output or load. That depends on incline, wind, and so on. It does tell us, however, that the car is going 75/150 or 50% of full speed.

It is this position on a scale of possible values that we seek to control. Although diverse uses of certain terminology probably preclude calling the variable a quantitative measurement, the concept of the variable representing a current location on a scale of possible values, a status quo, seems to hold up.

**Figure 1a.** During a given time, if the system input rate exceeds that of system output, the variable will increase.

**Figure 1b.** This figure illustrates how a change in controller output, dCO, when written as system input, is a change in the rate of a system input.

**What are SRT and SCr? **

Figure 1B illustrates how a change in controller output, dCO, when written as system input, is a change in the rate of a system input. The system input rate's time base is the controller's cycle time, t. Following an increase in the system input rate, however, the change in the variable, dV, could, as noted, continue indefinitely. So, what time period should be used for measuring the change in variable, dV? And, when should the measurement begin?

Some time elapses between when a change in controller output is made and when the controller sees the resulting change in the variable (see Figure 1B). This time is the system response time, SRT. If the measurement of the change in variable, dV, begins after time equivalent SRT has elapsed and spans a time-equivalent SRT, then dV will be dV/SRT. The ratio of a given change in controller output to the resultant change in the process variable during a time equivalent SRT, dCO/(dV/SRT), is a ratio characteristic of the system, or the system characteristic ratio, SCr. This ratio for one cycle is dCO/(dV/dt).

Perforce, SRT is equal to or greater than the cycle time, t. Applications exist where it is many times greater. Figure 2 shows a plot of run data from an actual application with the Controller controlling the temperature of water in a beaker. The cycle time is 0.010 s, and SRT is approximately 20 s, so SRT is approximately 2,000 x t. When SRT is greater than the cycle time, t, the Controller uses the relationship of the two to determine what portion of the current error to convert to output-see Formula (1) above.

The system characteristic ratio, SCr, can be written in terms of the controller output as:

SCr = dCO/(dV/SRT) = (CO_{C} - CO_{O}) / [(V_{C} - V_{O})/SRT].

This same change when written in terms of the change in system input, dSI, becomes:

dSI/(dV/SRT) = (SI C -SI_{O}) / [(V_{C} - V_{O})/SRT]

where V_{C} and V_{O} represent the variable's current value and initial value, respectively; CO_{C} and CO_{O} represents those for the controller output; and SI_{C} and SI_{O} represents those for the system input.

Here, somewhat in contrast to other discussions, CO_{O} and SI_{O} represent the values of these variables just before the change in output, dCO, is made; CO_{C} and SI_{C} represent their values just after the change is made; and V_{C} represents the value for the variable a time equivalent (2 x SRT) after the change dCO.

**Figure 2.** Shown is a plot of run data from an actual application with the Controller controlling the temperature of water in a beaker

**Using a model**

How are SRT and SCr determined for an operating system? Consider, as a thought model, a tank level control application where, initially, level, system input, and system output are constant. Note the initial values for the variable, V_{O}, and the controller output, CO_{O}. Introduce a specific change in controller output, dCO; determine SRT as above; wait a time equivalent 2 x SRT; then measure the current variable and determine the change therein. Suppose the following values:

CO_{C} = 10% and CO_{O} = 5%, or SI_{C }= 10 gal/t and SI_{O} = 5 gal/t

V_{C} = 110 in and V_{O} = 107.5 in

t = cycle time

SRT= 5 t.

Given these values, much can be discerned about the model's system and the process controller's relationship thereto, for example,

**(2)** dSI/dCO = (SI_{C} -SI_{O}) / (CO_{C }- CO_{O})

= (5 gal/t)/5%

= (1 gal/t)/%

**(3)** V/gal = (dV/t)/dSI

= (2.5 in / 5 t)/(5 gal/t)

= 0.1 in/gal

**(4)** dCO/(dV/t) = (CO_{C} -CO_{O}) / [(V_{C} - V O)/dt].

= (10% - 5%) / [(110 in - 107.5 in) / 5 t]

= (10%/in) x t (i.e., following an increase of 10% in controller output, each cycle, the variable, and tank level, will increase 1.0 in).

Notice from Formula (4) that, given the ratio, dCO/(dV/t) for a system, if either the change in output or the change in the variable is known, the other can be calculated for some time t, e.g.,:

If dCO = 5%: dCO/(dV/t) = (10% x t)/in

5%/(dV/t) = (10% x t)/in

dV = 0.5 in

If dV/t = 0.5 in/t: dCO/(0.5 in/t) = (10% x t)/in

dCO = 5%

Or, if dV/t = 2.0 in/t: dCO = (2 in/t) x (10 % x t) / in = 20%.

** **

**(5)** SCr = dCO/(dV/SRT) = (CO_{C} -CO_{O}) / (V_{C} - V_{O})

= (10% - 5%) / (110 in - 107.5 in)

= 2%/in (i.e., beginning with the system at steady state; an increase in controller output of 2% results in a level increase of 1.0 in after a time equivalent 2 x SRT.)

These formulae can be applied to other systems with the units being those of the particular system. The following are some examples using 'generic' units, where V represents the units of the variable; q/t those for the rate of system input (and, for now, system output, SO) with q representing quantity; and % remains the units for controller output.

If SRT = 2 t, dCO = 5%, dSI = 5 q/t and dV/(SRT) = 2.5 V; then:

dSI/dCO = (5 q/t)/5% = 1 (q/t)/%

V/q = 2.5 V /(2 x 5 q/t) = 0.25 V/q

dCO/(dV/t) = (5%) / (2.5 V / 2 t) = (4%/V) x t

SCr = dCO/(dV/SRT) = (5%) / (2.5 V) = 2%/V,

If SRT = 5 t, dCO = 5%, dSI = 5 q/t and dV/(SRT) = 2.5 V; then:

dSI/dCO = (5 q/t)/5% = 1 (q/t)/%

V/q = 2.5 V /(5 t x 5 q/t) = 0.1 V/q

dCO/(dV/t) = (5 %) / (2.5 V / 5 t) = (10%/V) x t

SCr = dCO/(dV/SRT) = (5%) / (2.5 V) = 2%/V,

If SRT = 10 t, dCO = 5%, dSI = 5 q/t and dV(SRT) = 5.0 V; then:

dSI/dCO = (5 q/t)/5% = 1 (q/t)/%

V/q = 5 V/(10 t x 5 q/t) = 0.1 V/q

dCO/(dV/t) = (5%) / (5 V / 10 t) = (10%/V) x t

SCr = dCO/(dV/SRT) = (5%) / (5 V) = 1%/V

Later in this article, we'll discuss what happens to the current variable, V_{C}, when the system output, SO, is not held constant (i.e., the load is changing). For now, consider a system with no change in output:

**(6)** V_{C} = V_{O} + dV where: dV = (SI_{C} - SO_{O}) x V/q = {(CO_{O} x dSI/dCO) - SO_{O}} x V/q

**Simulation**

Using the above developed concepts and formulae, it is possible to simulate the dynamics of a system controlled by the Controller. To do so, the following calculations are repeatedly performed in sequence:

**[1]** SO_{C} = SO_{O} + dSO/dt where: dSO/dt = change in load

**[2]** V_{C} = V_{O} + dV

**[3]** E_{C} = SP_{C} - V_{C}

**[4]** dE_{C} = E_{C} - E_{O} or dE_{C} = V_{O} - V_{C} = - dV

**[5]** CO_{C} = CO_{O} + SCr x (E_{C} + dE_{C})

**[6]** Update variables

Now, imagine a system, similar to the one in the model, operating a steady state with the following parametric values:

CO_{C} = 20%, SI_{C} = 10 q/t and SO_{C} = 10 q/t

V_{C} = 50.0 in and current set point, SP_{C} = 50.0 in

E_{C} = 0.0 and dE_{C} = 0.0

V/q = 1 in/q

dSI/dCO = (q/t)/2%

t = cycle time

SRT= 1.0 t

SCr = 2.0%/in.

Then let SO increase to 15 q/t:

V_{C} = 50 in + {[20%/2%/(q/t)] -15 q/t} x t x 1.0 in/q = 45.0 in,

E_{C} = 5.0 in and dE_{C} = 5.0 in

CO_{C} = 20% + 2%/in x (5.0 in + 5.0 in ) = 40%.

Next cycle:

V_{C} = 45.0 + [(40/2) - 15] x 1.0 = 50.0 in,

E_{C} = 0.0 in and dE_{C} = -5.0 in

CO_{C} = 40 + 2 x (0.0 - 5.0 ) = 30.0%.

Next cycle:

V_{C} = 50.0 + [(30/2) - 15] x 1.0 = 50.0 in,

E_{C} = 0.0 in and dE_{C} = 0.0 in

CO_{C} = 30.0 + 2 x (0.0 - 0.0) = 30.0%.

Next cycle:

V_{C} = {50.0 + [(30/2) - 15.0] x 1.0 = 50.0 in,

E_{C} = 0.0 in and dE_{C} = 0.0 in

CO_{C }= 30.0 + 2 x (0.0 + 0.0) = 30.0%.

In tabular format:

[1] | [2] | [3] | [4] | [5] | ||
---|---|---|---|---|---|---|

t= | SO_{C}= |
V_{C}= |
E_{C} = |
dE_{C} = |
CO_{C} = |
SI_{C} = |

0 | 10 q/t | 50 in | 0 | 0 | 20% | 10 q/t |

1 | 15 q/t | 45 in | 5.0 in | 5.0 in | 40% | 10 q/t |

2 | 15 q/t | 50 in | 0.0 in | -5.0 in | 30% | 20 q/t |

3 | 15 q/t | 50 in | 0.0 in | 0.0 in | 30% | 15 q/t |

4 | 15 q/t | 50 in | 0.0 in | 0.0 in | 30% | 15 q/t |

None of the changes are immediate. Current tank level is a function of the flow rates in and out of the tank and of the previous level. The tank's input flow rate is a function of the current controller output, CO_{C}, which itself is a function of the previous controller output, the current error, E_{C}, and the current change in errror, dE_{C}. E_{C} is a function of the difference between current variable and current set point and dE_{C} one of the rate of change in the variable. The controller cycles divide the system operation time line into segments, one immediately following the other. All along this time line, the level changes continuously according to the difference in the tank's current input and output flow rates. Each cycle is a given sequence of measurements taken, calculations made, and controller output adjustment.

Figure 3 is a plot of a simulated run for a generic system where the load or SO is changed without changing system input, SI (i.e., no control action is being taken). Notice how the initial increase in SO, dSO/(t1-t0) = 1, causes the variable to fall at the rate, dV/dt = - 1 for cycles 2 - 5, and that dE_{C} = - dV/dt = - (SI -SO) during this time. Interesting, too, the relationship of ddE_{C} to - d(SI - SO) /dt.

With no controller action or change in set point, the variable continues to change at a rate determined by the difference between the rate of system input and output.

When the Controller is operating: it looks at the variable, calculates the values for the error and the change in error, and changes the output at the beginning of the first cycle, the second, the third, and so on. Figure 3A shows the same loading as Figure 3 , but now the controller is operating. Now, V_{C} = V_{O} + dV, dV = SI_{C} - SO_{C}, SI_{C }= CO_{C} x dSI/dCO, and CO_{C }= CO_{O} + SCr x (E_{C} + dE_{C}).

**Figure 3.** A plot of a simulated run for a generic system where the load or SO is changed without changing system input, SI

**Figure 3a.** The same loading as Figure 3 is shown, but now the controller is operating.

For a system operating at steady state with no error, a change in either the variable or the set point will cause an error. It has been shown that a difference in the system input and output rate causes a change in the variable. A change in set point has nothing to do with either the system's input or output rate.

Figure 4A shows set point changes without controller action. The current error, E_{C} = S_{C} -V_{C} = SP - V. The change in error can be seen as dE_{C} = E_{C} - Eo, which includes the change in set point, or it can be seen as dE_{C }= V_{O} - V_{C}, which excludes the change in set point. Figure 4B shows the changes in set point of Figure 4A but here the controller is operating. Notice in Figure 4B that the system input only need change long enough to change the variable.

**Figure 4a. **Set point changes without controller action.

**Figure 4b.** The changes in set point of Figure 4A but here the controller is operating.

Modeling a system becomes a bit more complicated when SRT is greater than 1 t. For such systems, the effect of a change in controller output is not seen until those cycles equivalent SRT have occurred following the change (a shift register can be used to simulate this time lag). Table 1 shows the results of a load increase on a simulated system with SRT = 10 t, and SCr = 0.1. Here the basic output formula (1) has been expanded so as to utilize the relationship of ddE_{C} to - d(SI - SO) /dt noted above. Now, the basic formula is: O_{C} = O_{O }+ SCr x [E C x (t/SRT) + dE_{C} + ddE_{C}], and some adaptive tuning is being applied. The formulation for dV is: dV = [(CO_{n-10} + CO_{n-11})/ 2] x (dSI/dCO) - SO_{C}.

Each cycle of operation, the Controller determines the current error and change in error. It converts these to an equivalent output value, which it then adds to the previous output to get a current output. This current output is the output needed to control the variable at or very near the set point at all times. The Controller is self tuning. Its two tuning parameters, SRT and SCr, can be quickly determined at initial startup.

**Table 1 **

VC = VO + [(COn-10 + COn-11)/2] x (dSI/dCO) -SOC

COC = COO + SCr x [(EC /2) x (t/SRT) + dEC + ddEC]

Cyc |
Ec |
dEc |
ddEc |
Sic |
SOc |

1 |
0 | 0 | 0 | 3 | 3 |

2 |
0.1 | 0.1 | 0.1 | 3.0855 | 3.2 |

3 |
0.3 | 0.2 | 0.1 | 3.182 | 3.2 |

4 |
0.5 | 0.2 | 0 | 3.2045 | 3.2 |

5 |
0.7 | 0.2 | 0 | 3.228 | 3.2 |

6 |
0.9 | 0.2 | 0 | 3.2525 | 3.2 |

7 |
1.1 | 0.2 | 0 | 3.278 | 3.2 |

8 |
1.3 | 0.2 | 0 | 3.3045 | 3.2 |

9 |
1.5 | 0.2 | 0 | 3.332 | 3.2 |

10 |
1.7 | 0.2 | 0 | 3.3605 | 3.2 |

11 |
1.9 | 0.2 | 0 | 3.39 | 3.2 |

12 |
2.05725 | 0.15725 | -0.04275 | 3.39515 | 3.2 |

13 |
2.1235 | 0.06625 | -0.091 | 3.36742 | 3.2 |

14 |
2.13025 | 0.00675 | -0.0595 | 3.34953 | 3.2 |

15 |
2.114 | -0.01625 | -0.023 | 3.34698 | 3.2 |

16 |
2.07375 | -0.04025 | -0.024 | 3.34132 | 3.2 |

17 |
2.0085 | -0.06525 | -0.025 | 3.33234 | 3.2 |

18 |
1.91725 | -0.09125 | -0.026 | 3.3198 | 3.2 |

19 |
1.799 | -0.11825 | -0.027 | 3.30347 | 3.2 |

20 |
1.65275 | -0.14625 | -0.028 | 3.28311 | 3.2 |

21 |
1.4775 | -0.17525 | -0.029 | 3.25847 | 3.2 |

22 |
1.28493 | -0.19258 | -0.01733 | 3.23698 | 3.2 |

23 |
1.10364 | -0.18129 | 0.01129 | 3.22919 | 3.2 |

24 |
0.94516 | -0.15848 | 0.02281 | 3.22802 | 3.2 |

25 |
0.7969 | -0.14826 | 0.01022 | 3.2202 | 3.2 |

26 |
0.65276 | -0.14415 | 0.00411 | 3.20832 | 3.2 |

27 |
0.51593 | -0.13683 | 0.00732 | 3.19751 | 3.2 |

28 |
0.38986 | -0.12607 | 0.01076 | 3.18842 | 3.2 |

29 |
0.27822 | -0.11164 | 0.01443 | 3.18196 | 3.2 |

30 |
0.18493 | -0.09329 | 0.01835 | 3.17946 | 3.2 |

31 |
0.11414 | -0.07079 | 0.0225 | 3.18173 | 3.2 |

32 |
0.06642 | -0.04772 | 0.02307 | 3.18715 | 3.2 |

33 |
0.03333 | -0.03308 | 0.01464 | 3.19017 | 3.2 |

34 |
0.00473 | -0.02861 | 0.00448 | 3.18857 | 3.2 |

35 |
-0.01938 | -0.02411 | 0.0045 | 3.18763 | 3.2 |

36 |
-0.03364 | -0.01426 | 0.00985 | 3.19065 | 3.2 |

37 |
-0.03656 | -0.00292 | 0.01134 | 3.19579 | 3.2 |

38 |
-0.02952 | 0.00703 | 0.00995 | 3.20139 | 3.2 |

39 |
-0.0147 | 0.01481 | 0.00778 | 3.20675 | 3.2 |

40 |
0.00458 | 0.01929 | 0.00448 | 3.21094 | 3.2 |

41 |
0.02398 | 0.01941 | 0.00012 | 3.21309 | 3.2 |

42 |
0.03955 | 0.01556 | -0.00384 | 3.21292 | 3.2 |

43 |
0.05089 | 0.01134 | -0.00422 | 3.2122 | 3.2 |

44 |
0.06152 | 0.01063 | -0.00071 | 3.21323 | 3.2 |

45 |
0.07342 | 0.0119 | 0.00127 | 3.21574 | 3.2 |

46 |
0.08428 | 0.01086 | -0.00104 | 3.21675 | 3.2 |

47 |
0.09106 | 0.00678 | -0.00408 | 3.21587 | 3.2 |

48 |
0.09247 | 0.00141 | -0.00537 | 3.21381 | 3.2 |

49 |
0.08839 | -0.00407 | -0.00548 | 3.2111 | 3.2 |

50 |
0.07955 | -0.00885 | -0.00478 | 3.20823 | 3.2 |

**Table 1.** The results of a load increase on a simulated system with SRT = 10 t, and SCr = 0.1

*******

*Author Information*

Ken Melvin ([email protected]) is a consultant for Industrial Control Systems (Oakland, Calif.) and inventor of the 'Melvin' Controller (US patent 6,049,739). You can reach him via voice at (510) 834-0175.