Article pubs.acs.org/IECR
Tuning a Soft Sensor’s Bias Update Term. 2. The Closed-Loop Case Yuri A. W. Shardt* and Biao Huang* University of Alberta, Edmonton, Alberta, Canada T6G 2 V4 ABSTRACT: The difficulty in measuring certain types of process variables rapidly has encouraged the use of soft sensors, which can determine the values of difficult to measure process variables based on easily available secondary process variables. A bias update term that allows the system to take into consideration disturbances in the system is often included in such soft sensor systems. In the second part of this two-part series, an investigation of the bias update term in closed-loop operation in the presence of a drifting (integrating) disturbance for the ideal case, the case where there is measurement delay, the case with multirate sampling, and the case where there is a combination of measurement delay and multirate sampling is considered. Proposed tuning rules are provided for all cases in order to obtain optimal closed-loop tracking of the controller. Simulation and experimental validation of the results is also presented.
1. INTRODUCTION In many industrial processes, it is common that certain key quality variables, such as concentration, cannot be measured sufficiently quickly or accurately to allow for closed-loop control. One commonly used solution to this problem is to implement a soft senor that can infer the required values on the basis of the easily accessible values, such as temperatures, flow rates, and pressures.1 With use of this inferred value, it is then possible to close the loop and perform automatic control. In many soft sensor setups, there is a bias update term.1,2 In such cases, it has been assumed that the bias update term is a simple constant updating term, for which it has been observed that, in open-loop calibration, good results are obtained. However, under certain circumstances such as a drifting disturbance, it has been observed that the closed-loop performance of the soft sensor may be problematic. Thus, a detailed examination of this problem will be considered over the two papers using both simulations and experimental results with the objective of proposing tuning rules for the bias update term. This second paper will consider the closed-loop soft sensor, while the first paper (the preceding paper in this issue) has considered the open-loop soft sensor. Therefore, the objectives of this second paper are (1) to theoretically analyze a soft sensor system with bias update in the closed-loop case and determine the factors that can influence the tracking behavior of the soft sensor, (2) to theoretically analyze the system at different sampling rates and measurement delays, and (3) to propose appropriate tunings for the bias update terms. As well, validation of the proposed method using simulation and experimental results will be presented.
From Figure 1, it can be seen that the following relationships hold u t = Gc(rt − ym,t ) yt = Gpu t + G le t yα,t = Gp̂ u t yβ,t = GB(ym,t − yt ) ym,t = yα,t + yβ,t
where yβ,t is the bias value and yα,t is the raw forecast soft sensor value. Using eq 1, the closed-loop transfer function for ym,t and yt in terms of rt and et can be written as ym,t =
(Ĝp − GBGp)Gc rt (1 + (Gp̂ − GBGp)Gc − GB) +
−GBG l et (1 + (Gp̂ − GBGp)Gc − GB)
(2)
Figure 1 and eq 2 imply that the closed-loop transfer function for yt can be written as ⎛ ⎞ (1 − GB) ⎟rt yt = GpGc⎜⎜ ⎟ ⎝ (1 + (Ĝp − GBGp)Gc − GB) ⎠ ⎛ ⎞ (1 + ĜpGc − GB) ⎟e t + G l⎜⎜ ⎟ ⎝ (1 + (Ĝp − GBGp)Gc − GB) ⎠
2. SOFT SENSORS WITH BIAS UPDATE 2.1. Introduction. Assume that the closed-loop soft sensor system can be described as shown in Figure 1, where Gp is the “true” process transfer function, Ĝ p the assumed process transfer function, Gl the disturbance transfer function, Gc the controller, and GB the bias correction transfer function. Furthermore, assume that the reference signal is given by rt, the disturbance by et, which is modeled as a white noise sequence with mean μ and variance σ2, ut the input to the process, the true output yt, and the soft sensor output ym,t. © 2012 American Chemical Society
(1)
(3)
2.1.1. Some Observations on GB, the Bias Update Term. In Figure 1, no assumptions have been made about the speed at which the process is measured. Assume that the controller Received: Revised: Accepted: Published: 4968
July 8, 2011 February 29, 2012 March 1, 2012 March 1, 2012 dx.doi.org/10.1021/ie2014586 | Ind. Eng. Chem. Res. 2012, 51, 4968−4981
Industrial & Engineering Chemistry Research
Article
Figure 1. Schematic of a closed-loop soft sensor with bias update.
update is every n samples. In a real process, there are two issues to consider: (1) yt is sampled every N samples, which is often much larger than the controller update period. This behavior can be modeled by adding a zero-order hold to the bias update term that has a hold of N samples. (2) A time delay in obtaining the data is present, which implies that although yt is sampled at time a, its value due to processing is not available until time a + d, where d is the time delay in processing the data. This behavior can be modeled by adding a d-sample time delay into the bias update term. Given the above discussion, the actual bias update system can be represented as shown in Figure 2. Note that a zero-order
the subtraction. Finally, it should be noted that, although the actual bias update transfer function that will be designed will change its form, placing the zero-order hold after Ĝ B makes simulations easier, since a single update value will be available for the given interval. 2.2. Simulation Setup. The suggested tunings for the bias update term will be investigated using Simulink and the following model parameters: (1) Gp = 0.5z−1/(1 − 0.85z−1). (2) Gl = (1 + 0.5z−1)/(1 − z−1). (3) Gc = (2 − 1.6z−1)/(1 − z−1), which is a modified internal model controller designed assuming that the true model of the plant is not known. It was designed on the basis of the procedure given by Seborg et al.3 and then discretized using a sampling time of 1 s. (4) The bias update term will be designed differently depending on the circumstances. (5) White noise with a mean of 0 and a variance of 1 will be used. (6) The simulation was run for 10 000 time samples. Some of the models may be changed in order to demonstrate specific cases. The closed-loop Simulink model of the system is shown in Figure 4. 2.3. Closed-Loop Investigation. For the closed-loop system, comparing the forecast and measured terms given by eqs 2 and 3 shows that, if yt = ym,t,
Figure 2. Schematic representation of an actual process.
hold, which can be considered to be equivalent to a sampler, and a time delay term are added to the soft sensor output, ym, in order to obtain a more appropriate comparison with the sampled process data, yt. It should be noted that the zero-order hold has a hold period of N samples. It is possible to rearrange this version into the one given by Figure 3. First, it should be noted that Ĝ B is a discrete filter.
Gp = Gp̂
(4)
ĜpGc = −1
(5)
Equation 5 cannot be achieved as this implies that gain of the controller and assumed process must be inversely related. Nevertheless, good tracking of the process is provided for most situations, as shown in Figure 5a, for the case where Gl = (1 + 0.5z−1)/(1 − 0.25z−1), Ĝ p = Gp, GB = Ĝ B = −1, and there is no step change in the set point. Adding plant−model mismatch to the simulation does not significantly change the observed trends. 2.3.1. Drifting Disturbance. In the presence of a drifting disturbance, that is, a disturbance model, Gl, that contains an integrator (s−1 or (1 − z−1)−1), the tracking of the process, even in the absence of plant−model mismatch, is extremely poor. This can be seen by comparing the results shown in Figure 6, which contains a drifting disturbance, with that previously shown in Figure 5. From Figure 6, it can be seen that the actual
Figure 3. Detailed examination of the bias update term.
Next, one should note that both streams contain the same sampler and delay, so these two components can be placed after 4969
dx.doi.org/10.1021/ie2014586 | Ind. Eng. Chem. Res. 2012, 51, 4968−4981
Industrial & Engineering Chemistry Research
Article
Figure 4. Simulink model of the soft sensor system.
Figure 5. Closed-loop behavior of the system for a nondrifting disturbance: (left) plot of the forecast process value against the actual process value and (right) time series plots of actual process (top) and forecast process (bottom) values. The dashed line represents the y = x line.
Figure 6. Closed-loop behavior of the system for a drifting disturbance: (left) plot of the forecast process value against the actual process value and (right) time series plot of actual process (top) and forecast process (bottom) values. The dashed line represents the y = x line.
process value drifts widely about the set point, while the forecast process values oscillate about the set point value of zero. This compares poorly with the previous good tracking behavior observed in the absence of the drifting disturbance. This behavior occurs irrespective of whether or not there is a set point
change, which suggests that it is due to the nature of the disturbance. Finally, it can be noted that, in the open-loop case, the system behaves well; that is, good tracking is achieved. Thus, as is often the case when commissioning this type of controller, to calibrate the bias update term on the basis of 4970
dx.doi.org/10.1021/ie2014586 | Ind. Eng. Chem. Res. 2012, 51, 4968−4981
Industrial & Engineering Chemistry Research
Article
simulation results are in complete agreement with the theoretical results. 2.3.1.2. Proposed Theoretical Solution. In the above derivation it has been shown that, in the presence of a drifting disturbance with a constant bias update term for the soft sensor, irrespective of whether there are any set point changes or plant−model mismatch, the forecast process output and the measured process output do not track each other properly. Furthermore, it has been observed that the actual process output transfer function has an integrating term present, which is not found in the forecast process output transfer function. This difference seems to be the cause of the observed problem. Therefore, a potential solution would be to introduce an integrating term to the bias update transfer function, which will eliminate the difference between the forecast and actual transfer functions. The following term is defined by
open-loop results will not successfully resolve this type of problem. 2.3.1.1. Theoretical Analysis. To determine the source of the observed poor tracking of the soft sensor in the presence of a drifting disturbance, first one should note that, in this case, an integrating factor is present in the controller and disturbance transfer functions. Second, it should be noted that, since this problem is observed irrespective of a set point change, the following discussion will assume that rt = 0. The transfer functions are written as Gl = Gc =
G̃ l 1 − z −1 Gc̃
1 − z −1 GB = KB
(6)
where KB is a constant value and the tilde (○̃ ) represents that the integrator has been removed from the process. The forecast process output, given by eq 2, can be rewritten as ym,t = =
−KB[G̃ l /(1 − z−1)] et (1 + (Ĝp − KBGp)[Gc̃ /(1 − z−1)] − KB)
ym,t = (7)
Multiplying out the term 1 − z ym,t =
(8)
from which it can be seen that there will not in general be any integrating action in this transfer function. In other words, there is no drifting trend in the soft sensor forecast despite there being such a trend in the process output. This result dovetails well with the observed simulation results for the forecasted process output. On the other hand, using eq 6, for the actual process output, eq 3, can be written as
(
)
(
)
(12)
Multiplying out the term 1 − z ym,t =
((1 − z
−1 2
) + ((1 − z
in eq 12 leads to
− G̃ BG̃ l et )Gp̂ − G̃ BGp)Gc̃ − (1 − z−1)G̃ B)
−1
(13)
from which it can be seen that there will not in general be any integrating action in this transfer function. For the actual process output, eq 3 can be written as ⎛ ⎞ (1 + ĜpGc − GB) ⎟e t yt = G l⎜⎜ ⎟ ⎝ (1 + (Ĝp − GBGp)Gc − GB) ⎠
⎞ ⎟ ⎟⎟e t ⎠
=
(9)
Multiplying out the term 1 − z−1 in eq 9 leads to yt =
− GBG l et (1 + (Gp̂ − GBGp)Gc − GB)
−1
⎛ ⎞ (1 + ĜpGc − GB) ⎟e t yt = G l⎜⎜ ⎟ ⎝ (1 + (Ĝp − GBGp)Gc − GB) ⎠ ⎛ 1 + Ĝp[Gc̃ /(1 − z−1)] − KB G̃ l ⎜ = ⎜ 1 − z−1 ⎜ 1 + (Gp̂ − KBGp)[Gc̃ /(1 − z−1)] − KB ⎝
(11)
⎡ G̃ B G̃ l = ⎢− ⎢⎣ 1 − z−1 1 − z−1 ⎛ ⎛ ⎞ Gc̃ G̃ B G̃ B ⎞⎤ ⎟⎥e t − /⎜1 + ⎜Gp̂ − Gp⎟ − − 1 1 ⎝ ⎠1 − z ⎝ 1−z 1 − z−1 ⎠⎦
in eq 7 leads to
− KBG̃ l et − 1 (1 − z + (Ĝp − KBGp)Gc̃ − (1 − z−1)KB)
1 − z −1
and the assumption is made as before that there are no set point changes and the presence of an integrating term in both the controller and disturbance transfer functions. Under these assumptions, the forecast process output, given by eq 2, can be rewritten as
−GBG l et ̂ (1 + (Gp − GBGp)Gc − GB)
−1
G̃ B
GB =
G̃ l 1 − z−1 ⎛ ⎞ (1 − z−1 + Gp̂ Gc̃ − (1 − z−1)KB) ⎟e × ⎜⎜ −1 −1 ⎟t ̂ ̃ (1 z ( G K G ) G (1 z ) K ) − + − − − p B p c B ⎠ ⎝
⎛⎛ Gc̃ G̃ B ⎞ ⎜⎜⎜1 + Ĝp − ⎟ 1 − z − 1 ⎝⎝ 1 − z −1 1 − z −1 ⎠ ⎛ ⎞ Gc̃ ⎛ G̃ B G̃ B ⎞⎞ ⎟⎟⎟e t /⎜1 + ⎜Ĝp − G − ⎟ p ⎝ ⎝ 1 − z −1 ⎠ 1 − z −1 1 − z − 1 ⎠⎠ G̃ l
(14) −1
Multiplying out the term 1 − z
in eq 14 leads to
⎛ ⎞ (1 − z−1 + Gp̂ Gc̃ − G̃ B) ⎟ yt = G̃ l⎜ ⎜ ((1 − z−1)2 + ((1 − z−1)Ĝ − G̃ G )G̃ − (1 − z−1)G̃ ) ⎟ p B p c B ⎠ ⎝
(10)
This shows that, unlike for the forecast process output, here an integrator term remains in the transfer function. As before, the
et 4971
(15) dx.doi.org/10.1021/ie2014586 | Ind. Eng. Chem. Res. 2012, 51, 4968−4981
Industrial & Engineering Chemistry Research
Article
Figure 7. Closed-loop behavior of the system for a drifting disturbance with the proposed solution: (left) plot of the forecast process value against the actual process value and (right) time series plot of actual process (top) and forecast process (bottom) values. The dashed line represents the y = x line.
an integrator is present in the disturbance. Results for the case where there is a single sample time delay in obtaining the data and in the presence of a drifting disturbance for the case KC = KB = 1 are shown in Figure 8 and for the case KC = KB = −1 in Figure 9. It can clearly be seen that the integrator must be present for the closed-loop soft sensor to track the process. Other potential solutions are similar to the first case, and they do not track the process. 2.3.3. Multirate System. As was previously noted, adding an N-sample zero-order hold to GB is equivalent to saying that only information at a certain time period is available to update the bias term. It should first be noted that during the time period over which there is no new information about the true process, which enters through the bias update term, the control system is acting in an “open-loop” situation. However, the changes made by the controller will still affect the true process value. Further the assumption is made that the only time at which the bias update term is changed is at kN, k ∈ . As well, this implies that the bias update term can only have data every N samples. Therefore, one way to represent Ĝ B at the sample instances kN is as Ĝ B(z−N). This will force all of the coefficients in Ĝ B between kN and (k + 1)N to be zero, since, over this interval, there will be no update from the system and the last available value will be used. A similar approach to that used for the open-loop multirate case will be used to derive the closed-loop multirate solution. It should be noted that the derivation is more involved as it requires keeping track of the contribution of the controller to the output. The difference between the measured and forecast values is denoted as yd; that is, yd = ym − y (20)
Now, it can be seen that there is no extraneous integrating term in the transfer function for the actual process. Thus, it is expected that good tracking should now be obtained. 2.3.1.3. Simulation Results for the Proposed Solution. The assumption is that the same system is used as was initially used for testing the drifting disturbance, but now the following term is defined:
GB =
−1 1 − z −1
(16)
Figure 7 shows the results of implementing this system. In contrast with Figure 6, Figure 7 does not show any drifting behavior in the actual process values and the tracking of the two variables is very close. This is in complete agreement with the developed theoretical closed-loop transfer functions given as eqs 13 and 15. 2.3.2. Time Delay. Similar to the open-loop case, where it was shown that adding a time delay can destabilize the soft sensor forecasts by making the poles of the transfer function outside the unit circle (in terms of z), adding a time delay to the bias update term in the closed-loop system will also cause stability issues. It is assumed that GB can be written as GB =
KBz−d 1 + KCz−d
(17)
Substituting eq 17 into the denominator of the closed-loop transfer function, given as eq 2, and rearranging give ⎛ ⎞ KBz−d KBz−d Gp⎟⎟Gc − 1 + ⎜⎜Gp̂ − 1 + KCz−d ⎠ 1 + KCz−d ⎝
(18)
where ym is the forecast process output and y is the actual process output. At any time interval, t, the following equation describes the behavior of the updating term,
To obtain some initial estimate of the possible solution, it is assumed that Ĝ p = Gp and that GpGc = 1. In this case, eq 18 reduces to 2(1 + KCz−d − KBz−d)
(19)
ym,t = Gp̂ Gc(rt − ym,t ) + GB(z−N )yd ,t
To obtain unconditionally stable solution, there exist an infinite number of potential solutions as long as KC = KB. However, not all solutions will provide good disturbance tracking in the presence of a drifting disturbance. In fact, there is a need to set KC such that there is an integrator present in the denominator of the transfer function. Therefore, the only feasible solution is KC = KB = −1. Simulating the closed-loop system with the above solution for the time delay will give the same results irrespective of whether
(21)
At the time point t = N, eq 21 can be rewritten as ym, N = Gp̂ Gc(rN − ym, N ) + GB(z−N )yd , N
(22)
while at t = N + 1, eq 21 can be rewritten as ym, N + 1 = Gp̂ Gc(rN + 1 − ym, N + 1) + GB(z−N )yd , N + 1 (23) 4972
dx.doi.org/10.1021/ie2014586 | Ind. Eng. Chem. Res. 2012, 51, 4968−4981
Industrial & Engineering Chemistry Research
Article
Figure 8. Results for case KB = KC = 1 for the time delay problem in the presence of a drifting disturbance: (left) plot of the forecast process value against the actual process value and (right) time series plot of actual process (top) and forecast process (bottom) values. The dashed line represents the y = x line.
Figure 9. Results for case KB = KC = −1 for the time delay problem in the presence of a drifting disturbance: (left) plot of the forecast process value against the actual process value and (right) time series plot of actual process (top) and forecast process (bottom) values. The dashed line represents the y = x line.
the following system of equations to describe the sampled data system
However, it should be noted that due to the fact that the data are only available every N samples, at this time instance, yd,N+1 is not available. Instead, it is replaced by the last available value, yd,N; that is, eq 23 can be rewritten as ym, N + 1 = Gp̂ Gc(rN + 1 − ym, N + 1) + GB(z−N )yd , N (24)
Furthermore, it should be noted that, from eq 20, eq 24 can be rewritten to give ym, N + 1 = Gp̂ Gc(rN + 1 − ym, N + 1) + GB(z−N )(ym, N − yN ) (25)
A similar argument can be made for all of the remaining time intervals between N and 2N, for which no new update values are available. Therefore, the equations for the system can be written as for each point in the time interval [N, 2N[ as
where IN is the N × N identity matrix, B̂ is an N × N matrix, and the sampling time of the new system is N. Solving the resulting system for ŷm gives ym̂ = Gp̂ GcIN r ̂ − ĜpGcIN ym̂ + Bŷ m̂ − Bŷ ̂
(28)
Equation 28 can be rewritten as At the time point 2N, a new bias update term is available and the cycle restarts for the new time interval. Thus, we can write
IN ym̂ + ĜpGcIN ym̂ − Bŷ m̂ = ĜpGcIN r ̂ − Bŷ ̂ 4973
(29)
dx.doi.org/10.1021/ie2014586 | Ind. Eng. Chem. Res. 2012, 51, 4968−4981
Industrial & Engineering Chemistry Research
Article
Simplifying eq 29 and rearranging gives (IN + Gp̂ GcIN − B)̂ ym̂ = Gp̂ GcIN r ̂ − Bŷ ̂
Combining eqs 34 and 35 gives ̂ r ̂ − Ccl ̂ (GcGpIN (r ̂ − y ̂ ) + G lIN e )̂ ym̂ = Gcl m
(30)
̂ r ̂ − Ccl ̂ [GcGpIN ]r ̂ + Ccl ̂ [GcGpIN ]y ̂ = Gcl m ̂ − Ccl[G lIN ]e ̂
Solving eq 30 for ŷm gives
̂ [GcGpIN ])y ̂ = (Gcl ̂ − Ccl ̂ [GcGpIN ])r ̂ − Ccl ̂ [G lIN ]e ̂ (IN − Ccl m
ym̂ = (IN + Gp̂ GcIN − B)̂ −1Gp̂ GcIN r ̂ − (IN + Gp̂ GcIN − B)̂ −1Bŷ ̂
(36)
Once again, since IN − Ĉ clGcGpIN is lower triangular with nonzero diagonal terms, its determinant cannot be zero, and hence an inverse can always be found. Therefore, eq 36 can be rewritten as
(31)
Similar to the open-loop case, IN + Ĝ pGcIN − B̂ is lower triangular with nonzero diagonal terms, its determinant cannot be zero, and hence an inverse can always be found. Furthermore, the inverse can be obtained as follows:
̂ [GcGpIN ])−1(Gcl ̂ − Ccl ̂ [GcGpIN ])r ̂ ym̂ = (IN − Ccl ̂ [GcGpIN ])−1Ccl ̂ [G lIN ]e ̂ − (IN − Ccl
(37)
and eq 35 can be rewritten as ̂ [GcGpIN ])−1(Gcl ̂ − Ccl ̂ [GcGpIN ])r ̂ y ̂ = GcGpIN (r ̂ − ((IN − Ccl − 1 ̂ [GcGpIN ]) Ccl ̂ [G lIN ]e )) − (IN − Ccl ̂ + G lIN e ̂ ̂ [GcGpIN ])−1(Gcl ̂ − Ccl ̂ [GcGpIN ]))r = GcGp(IN − (IN − Ccl − 1 ̂ ̂ + (G lIN − GcGpIN (IN − Ccl[GcGpIN ]) Ccl[G lIN ])e ̂ (38)
It should be noted that the inverse of (IN − Ĉ cl[GcGpIN])
This can be obtained by applying the standard manual inversion method by forming the matrix [A|Im] and then row reducing it so that the result [Im|A−1] is obtained.4 This allows eq 31 to simplify to
−1
is
Since the only time step at which the bias update term should be changed is when there are data available about yt, that is, at time steps kN, k ∈ ; that is, ym, N =
(Ĝp − GB(z−N )Gp)Gc
rN (1 + (Gp̂ − GB(z−N )Gp)Gc − GB(z−N )) +
−GB(z−N )G l
eN (1 + (Gp̂ − GB(z−N )Gp)Gc − GB(z−N )) (40)
From eq 40, it can be seen that, at these time steps, the system will have a form similar to the original nonmultirate equations given as eq 2. Since the only difference is now that GB has been modified, this implies that using the same integrator in the bias update transfer function will resolve any issues with tracking a drifting disturbance. After taking into consideration the change made in GB due to the zero-order hold, then the transfer function for GB can be written as
Thus, ŷm can be written as
̂ r ̂ − Ccl ̂ ŷ ym̂ = Gcl
(34)
GB =
For ŷt, the closed-loop response for the time period [N, 2N[ is given as y ̂ = GcGpIN (r ̂ − ym̂ ) + G lIN e ̂
−1 1 − z −N
(41)
Simulations of the closed-loop system for the case where
GB =
(35) 4974
1 1 + z −N
(42)
dx.doi.org/10.1021/ie2014586 | Ind. Eng. Chem. Res. 2012, 51, 4968−4981
Industrial & Engineering Chemistry Research
Article
Figure 10. Results for case KB = KC = 1 for the multirate problem in the presence of a drifting disturbance: (left) plot of the forecast process value against the actual process value and (right) time series plot of actual process (top) and forecast process (bottom) values. The dashed line represents the y = x line.
Figure 11. Results for case KB = KC = −1 for the multirate problem in the presence of a drifting disturbance: (left) plot of the forecast process value against the actual process value and (right) time series plot of actual process (top) and forecast process (bottom) values. The dashed line represents the y = x line.
are shown in Figure 10 and for the case where GB is given by eq 41 are shown in Figure 11. In both cases, N = 2; that is, the data were sampled every 2 s. It can clearly be seen that the integrator must be present for the closed-loop soft sensor to track the process. Furthermore, it should be noted in Figure 11 that, due to sampling of the process, the accuracy between the forecast and actual values in the interval between samples is not as good as at the sample point, since the soft sensor cannot reduce the variability associated with the interval between samples. This discrepancy creates the central band that is not aligned along the 45° axis. However, it should be stressed that the variability associated with the interval between samples will occur irrespective of the designed soft sensor system. Finally, it can be noted that adding an integrator to the bias update function will remove the bias in the predicted values, as seen, for example, in Figure 10, and improve the closed-loop tracking behavior. It can be noted that increasing the sampling interval, N, does not change the observed performance. However, as the sampling interval increases, the corresponding performance decreases. Furthermore, the tuning of the controller must be changed in order to decrease its aggressiveness due to the less accurate values. Consider the results for the case N = 480 shown in Figure 12, which shows the results for both a properly tuned controller and a constant bias update term with or without an integrating disturbance. It can be seen that the performance of a bias update term tuned using eq 41 is the same regardless of the disturbance type, while, for a constant bias update term, the
results depend on the form of the disturbance. Furthermore, it can be noted that, in the proposed method, the deviation from the 45° line increases as N increases. This is a result of the design of the soft sensor system selected. 2.3.4. Time Delay and Multirate Sampling in GB. The most realistic situation for a soft sensor is to combine a time delay with a zero-order hold; that is, it takes time to obtain the data which are sampled at a rate that is often much slower than required for forecasting. It should be noted that the time delay will not be affected by the zero-order hold, since it is not a component of Ĝ B which is affected by the zero-order hold. If the time delay, d, is equal to the sampling interval, N, then the results will be very similar to that obtained for a time delay case, since GB will have a form similar to that previously obtained; that is, eq 41 can be used to obtain the desired solution. Specifically, one should note that a constant bias update term will not suffice due to the presence of time delay. If d is less than N, then, experimentally, it has been verified that using the system obtained for the zero-order hold and ignoring the time delay will provide the correct results. On the other hand, for the case where d > N, then the problem is still open. However, in the case where the time delay is an integer multiple of the zeroorder hold, then taking the larger of d or N to use in constructing the bias update term can be shown to be the correct approach. Simulating the closed-loop system using an integrator for the combined time delay and mutlirate sampling will give the same 4975
dx.doi.org/10.1021/ie2014586 | Ind. Eng. Chem. Res. 2012, 51, 4968−4981
Industrial & Engineering Chemistry Research
Article
Figure 12. Different configurations of bias update and disturbance model at N = 480. The top row contains a bias update term designed using eq 41, while the bottom row contains a constant bias update term of −1. The left-hand side shows an integrating disturbance, while the right-hand side shows a nonintegrating disturbance. The dashed line is the y = x line. The data are only shown at every sampling interval.
Figure 13. Results for case KB = KC = −0.1 for the combination problem in the prescence of a drifiting disturbance: (left) plot of the forecast process value against the actual process value and (right) time series plot of actual process (top) and forecast process (bottom) values. The dashed line represents the y = x line.
results irrespective of whether an integrator is present in the disturbance. Simulations were performed for the case where there is a three-sample time delay in obtaining the data and data are available only every four samples. This implies that the delay is less than the zero-order hold period, and hence using an integrator with N = 4 should suffice. A drifting disturbance was present. Results for the case GB =
are shown in Figure 13 and for the case
GB =
1 − z −N
(44)
are shown in Figure 14. It can clearly be seen that the integrator must be present for the closed-loop soft sensor to track the process. The explanation for the central band in Figure 14 is the same as for the pure multirate system; that is, it is caused by the intersampling noise that cannot be compensated for by the bias
−0.1 1 − 0.1z−N
−1
(43) 4976
dx.doi.org/10.1021/ie2014586 | Ind. Eng. Chem. Res. 2012, 51, 4968−4981
Industrial & Engineering Chemistry Research
Article
Figure 14. Results for case KB = KC = −1 for the combination problem in the presence of a drifting disturbance: (left) plot of the forecast process value against the actual process value and (right) time series plot of actual process (top) and forecast process (bottom) values. The dashed line represents the y = x line.
3. SAMPLED DATA PROCESS SIMULATIONS To investigate the results of the proposed solutions in a continuous time environment, the standard continuous, stirred tank reactor (CSTR) model for an irreversible, exothermic reaction given as A→B, as originally proposed by Morningred et al.,5 was used. The same basic system as was explained in part 1 (the preceding paper in this issue) will be used.6 The same soft sensor models were used as before; that is,
update. However, adding an integrator clearly improves the tracking ability (bias) in the soft sensor system compared to the case without an integrator (Figure 13). As well, it should be noted that the performance of the soft sensor degrades as the time delay increases and sampling rate decreases. This can be explained by noting that as these parameters increase, there is a decrease in the amount of relevant information available about the process. 2.3.5. Augmenting the Estimated Plant Model. As has been considered for the open-loop case, it may be feasible to add to the model additional, secondary variables, whose impact on the process could be quantified. If is assumed, as before, that these secondary variables have a transfer function given as Ga with values given by dt. Thus, the true closed-loop, process output can be written as ⎛ ⎞ (1 − GB) ⎟rt yt = GpGc⎜⎜ ⎟ ̂ ⎝ (1 + (Gp − GBGp)Gc − GB) ⎠
(45)
rt (1 + (Gp̂ − GBGp)Gc − GB) (Gâ − GBGa)Gc dt + (1 + (Gp̂ − GBGp)Gc − GB)
⎛ −0.00266 ⎞ ⎜ ⎟ T (s ) ⎝ 0.979s + 1 ⎠
(48)
Gc(z−1) =
(49)
55 + 50z−1 1 − z −1
(50)
The Simulink system used to simulate the process is shown in Figure 15. The disturbance transfer function was defined as
−GBG l
et (1 + (Gp̂ − GBGp)Gc − GB)
CA(s) =
The discrete-time controller was obtained by discretizing the continuous-time controller given by eq 49 assuming a sampling time of 1 min. This gives a discrete-time controller of the form
(Gp̂ − GBGp)Gc
+
(47)
⎛ 1 ⎞⎟ Gc(s) = 50⎜1 + ⎝ 10s ⎠
The closed-loop, soft sensor forecast values can then be written as ym,t =
⎛ −0.00266 ⎞⎛ 0.8775 ⎞ ⎟ V ̇ (s ) ⎜ ⎟⎜ ⎝ 0.979s + 1 ⎠⎝ 7.324s + 1 ⎠ c
A third soft sensor model was obtained by discretizing eq 47 using the exact discretization method.7 The continuous-time controller was designed on the basis of the method presented in Seborg et al.;3 that is,
⎛ ⎞ GpGc2(Gâ − GBGa) ⎟d + ⎜Ga − t ⎜ (1 + (Gp̂ − GBGp)Gc − GB) ⎟⎠ ⎝ ⎛ ⎞ (1 + Gp̂ Gc − GB) ⎟e t + G l⎜⎜ ⎟ ⎝ (1 + (Gp̂ − GBGp)Gc − GB) ⎠
CA(s) =
(46)
Gl =
Performing a comparison similar to that of the original system, it can be seen that the only additional constraint arises from the presence of the secondary variables. The additional term due to the auxiliary variable dt will not introduce any new complications for the design of closed-loop soft sensors. This implies that although adding auxiliary variables may improve the accuracy of the soft sensor and, hence, reduce the magnitude of the bias update term, the general form of the bias update term will remain the same as before.
0.01 s
(51)
The white noise input had zero mean and a variance of 0.005. It was assumed that there was a 1 min time delay between sampling the data and obtaining the value. It was assumed that there were no set point changes. The default model is the continuous-time model given by eq 47. The system will be investigated for different types of models and controller structures. The bias term will be tried with and without the required integrator term. 4977
dx.doi.org/10.1021/ie2014586 | Ind. Eng. Chem. Res. 2012, 51, 4968−4981
Industrial & Engineering Chemistry Research
Article
Figure 15. Simulink diagram of the system.
Figure 16. Sampled data system simulation for the case GB with the form KB = KC = −0.7: (left) plot of the forecast process value against the actual process value and (right) time series plot of actual process (top) and forecast process (bottom) values. The dashed line represents the y = x line.
3.1. Effect of the Integrator in GB. Figure 16 shows the result of simulating the system for the case where the bias update term has the form GB =
that the forecast process output follows the trends displayed by the actual process output. 3.2. Effect of Using Different Soft Sensor Models. The above analysis has shown that the soft sensor’s ability to track the process variable can be a problem in the presence of a drifting process. However, the influence of different types of soft sensor models has not been considered. Thus, this section will consider the effect of different soft sensor types: input-based, outputbased, and discretized models for the soft sensor. Using the discrete-time model obtained by discretizing the input-based model given by eq 47 gives the same results as shown in Figure 16 and Figure 17. Thus, there is no difference in the observed behavior of the system if an appropriate discretetime model is used. On the other hand, using the continuous-time output-based model, that is, eq 48, gives the results shown in Figure 18. It can be seen that the amount of oscillations due to the drifting disturbance has been decreased in magnitude. However, it is still quite clear that the forecast process does not track the true pro-
−0.7z−1 1 − 0.7z−1
(52)
which should not provide good tracking of the process in the presence of a drifting disturbance. Figure 16 does indeed show that the forecast process output does not follow the trends displayed by the actual process output. Figure 17 shows the result of simulating the system for the case where the bias update term has the form
GB =
− z −1 1 − z −1
(53)
which should provide good tracking of the process in the presence of a drifting disturbance. Figure 17 does indeed show 4978
dx.doi.org/10.1021/ie2014586 | Ind. Eng. Chem. Res. 2012, 51, 4968−4981
Industrial & Engineering Chemistry Research
Article
Figure 17. Sampled data system simulation for the case GB with the form KB = KC = −1: (left) plot of the forecast process value against the actual process value and (right) time series plot of actual process (top) and forecast process (bottom) values. The dashed line represents the y = x line.
Figure 18. Sampled data system simulation for the case GB with the form KB = KC = −0.7 and eq 47 as the soft sensor: (left) plot of the forecast process value against the actual process value and (right) time series plot of actual process (top) and forecast process (bottom) values. The dashed line represents the y = x line.
cess values. As well, it can be noted that as KB and KC are further from −1, the magnitude of the mismatch increases and approaches the previously observed results with the input-based model. Making the bias update term be defined by eq 53 gives the same good tracking as previously observed. 3.3. Different Controller Strategies. Adding a proportional, integral, and derivative (PID) controller rather than a proportional and integral (PI) controller does not make any changes to the observed results; that is, the mismatch persists if an inappropriately tuned bias update term is used. Similarly, using a continuous-time controller does not change the observed results. Thus, it can be concluded that the proposed solution is likely the correct one for the observed problem.
4. EXPERIMENTAL RESULTS Figure 19. Process schematic.
4.1. Setup. To test the above results, a heated tank system with a schematic given in Figure 19 was used. Most of the parameters were the same as those for the open-loop tests presented in part 1.6 The key system parameters are given as follows: (1) The level in the tank was set to 0.2 m and controlled using the cold water flow rate cascade controller. An integrating disturbance in the level driven by white noise with mean zero and variance 0.000 01 was introduced into the system.
(2) The measured input for the soft sensor is the steam flow rate. The temperature from the system can only be obtained every 3 s. Controller update is every second. (3) The data are sampled every second. The experiment was run for 1800 s. A step change of 5 kg/h in the steam was introduced at 900 s. 4979
dx.doi.org/10.1021/ie2014586 | Ind. Eng. Chem. Res. 2012, 51, 4968−4981
Industrial & Engineering Chemistry Research
Article
Figure 20. Experimental results for the case GB with the form KB = KC = −1: (left) plot of the forecast process value against the actual process value and (right) time series plot of the tank level (top) and steam flow rate (bottom) values. The dashed line represents the y = x line.
Figure 21. Experimental results for the case GB with the form KB = −1 and KC = −0.4: (left) plot of the forecast process value against the actual process value and (right) time series plot of the tank level (top) and steam flow rate (bottom) values. The dashed line is the y = x line.
update term, then the soft sensor would be able to track the system accurately. A verification of the proposed method using both discrete and continuous time simulations as well as experimental results suggest that the proposed solution can accurately solve the observed problem. Therefore, practically, in order for good tracking to occur irrespective of the disturbance encountered, an integrator must be present in the bias update term. Additional design constraints can be imposed on the basis of the open-loop analysis in part 1 (the preceding paper in this issue) in order to adequately design the bias update term. Future work should focus on developing adequate performance assessment measures for soft sensors and determining their implications for the design of the soft sensor system.
(4) The PI controller was designed using the procedure outlined in Seborg et al.3 to give a controller of the form
GC =
1 ⎛⎜ 1 ⎞⎟ 1+ 1.54 ⎝ 60s ⎠
(54)
4.2. Results. Two different runs were performed: with an integrator in the bias update term and without an integrator in the bias update term. Figure 20 shows the forecast temperature against the measured temperature, as well as the tank level and steam flow rates, for the case when an integrator is present in the bias update term, while Figure 21 shows the results when no integrator is present in the bias update term. Figure 20 clearly shows that the tracking of the temperature is quite good by the soft sensor. However, without an integrator, as shown in Figure 21, the forecast temperature is biased from the true values and starts to exhibit the horizontal section that suggests an inability to track the true temperature. This confirms the theoretical results.
■
AUTHOR INFORMATION
Corresponding Author
*Tel.: 780-492-9016. E-mail:
[email protected] (Y.A.W.S.); biao.huang@ ualberta.ca (B.H.).
5. CONCLUSIONS In this second part of the two-part series on soft sensors, the tuning relationships for the bias update term have been developed for the ideal case, a measurement time delay, a multirate system, and a combination of both for the closed-loop case. It has been shown that, in the presence, of a drifting disturbance, the conventional soft sensor system is unable to properly track the system. It was proposed that by adding an integrator term to the bias
Notes
The authors declare no competing financial interest.
■
REFERENCES
(1) Domlan, E.; Huang, B.; Xu, F.; Espejo, A. A decoupled multiple model approach for soft sensor design. Control Eng. Pract. 2011, 19, 126−134.
4980
dx.doi.org/10.1021/ie2014586 | Ind. Eng. Chem. Res. 2012, 51, 4968−4981
Industrial & Engineering Chemistry Research
Article
(2) Shao, X.; Huang, B.; Lee, J. M.; Xu, F.; Espejo, A. Bayesian method for multirate data synthesis and model calibration. AIChE J. 2011, 57, 1514−1525. (3) Seborg, D. E.; Edgar, T. F.; Mellichamp, D. A. Process Dynamics and Control, 2nd ed.; John Wiley & Sons: Hoboken, NJ, USA, 2004. (4) Anton, H. Elementary Linear Algebra, 8th ed.; John Wiley & Sons: Hoboken, NJ, USA, 2000. (5) Monringred, J. D.; Paden, B. E.; Seborg, D. E.; Mellichamp, D. A. An adaptive nonlinear predictive controller. Chem. Eng. Sci. 1992, 47 (4), 755−762. (6) Shardt, Y. A. W.; Huang, B. Tuning a soft sensor’s bias update term. 1. The open-loop case. Ind. Eng. Chem. Res., preceding paper in this issue. (7) Huang, B.; Kadali, R. Dynamic Modeling, Predictive Control and Performance Monitoring: A Data-driven Subspace Approach; SpringerVerlag: London, England, U.K., 2008.
4981
dx.doi.org/10.1021/ie2014586 | Ind. Eng. Chem. Res. 2012, 51, 4968−4981