How to lose money with inferential properties

5
IMPROVING PROCESS CONTROL SPECIALREPORT How to lose money with inferential properties Fourteen more rules that, if followed, will ensure that advanced control will drive the unit further away from optimum operation M. J. KING. Whitehouse Consulting, Isle of Wight, UK vided the inferential responds by changing in the correct direction, even if relatively inaccurate, its dynamic advantage can sub- stantially reduce duration of off-spec opera- tion. The analyzer measurement, through suitable dynamic compensation, can then be used to trim the inferential to maintain Its accuracy. 2. Implement automatic labora- tory updating. By "remembering" what the inferential recorded at sample time, when the laboratory result later becomes available, it is possible to adjust the bias term of the inferential to force agreement with the laboratory. This is common prac- tice for many vendors of inferential tech- nology, with most providing the option of filtering this correction so that some tuneable fraction of it is applied. However, even with such a filter in place, use of automatic o updating almost always reduces 000~ accuracy of the inferential. The t laboratory result is itself sub- Automatic 0 jeer to random error; 'updating laboratory simply adds this to that of the 90'--_'--_-'--_-'--_-'-u_pd_a_te..J.s_ta_rt_ed-'-_--'--_--'--_.....L_--l inferent ial, increasin g overall o 20 40 60 80 100 120 140 160 180 200 random error. This is illustrated in the case study shown as Fig. 1. Soon after commissioning a multivariable controller, the inferred property was found to more closely approach the upper limit and profitably reduce giveaway. However, the operator then noticed that laboratory results were often violating the specification and reduced the high limit. The net effect was that there was little change in product giveaway. To improve what appeared to be an inaccurate inferen- tial, the engineer implemented automatic laboratory updating. Even with filtering, the effect was to further worsen the situ- anon. Updating should only be applied if there is a bias or sustained error. Bias errors can arise because of changes in operating mode or underlying changes to the process caused by gradual effects such as catalyst deactiva- tion. Often, such changes can be detected and included as part of the inferential tech- 105r--------------------~ 102 1. Don't bother with an inferen- tial if there is an onstream ana- Iyzer. Of course, it is tempting to use the analyzer measurement directly in the control strategy, especially if the analyzer is believed to be accurate. However, most ana- lyzersrespond much more slowly to process changes than other instrumentation. The analyzer may be located well downstream, the sample system may introduce a signifi- cant delay and the analyzer itself may be discontinuous. By the time the analyzer first indicates a change in quality, the dis- turbance could have already persisted for a lengthy period and built up an inventory of off-spec material in the process. Further, the slow dynamics will severely -""'\ limit how quickly the process can be moved to the required operating conditions. Pro- T he hydrocarbon industry is remark- ably inventive in providing a never- .'~ ending catalog of ways to jeopardize the benefits that advanced control should capture. Inferential properties, now com- monplace in advanced control projects, offer another rich vein of examples. This article, like its predecessors, 1,2 presents a further list of rules. Also known as "soft sensors" or "virtual measurements," infer- entials are often applied to pre- dicting product qualities from more easily measurable operat- ing conditions. But they can be applied to almost any variable that is difficult or costly to mea- sure directly. Examples include column flooding, coker drum outage, furnace coking, etc. Technologies range from simple linear formulae, through neural ,~ networks to semirigorous engi- ~ neering calculations. o Applying automatic laboratory updating usually reduces accuracy. An added advantage of this approach is that at least some form of control will be maintained during times when the analyzer is out of service. Further, a large difference between inferential and ana- lyzer could help provide early detection of analyzer failure. In situations where installing a new analyzer is being considered, early devel- opment of an inferential may provide an effective alternative. In capturing some of the benefits of improved quality con- trol, it may reduce what remains to the point where the analyzer cost is no lon- ger justified. Or, if an analyzer already exists, it may permit it to be moved to another stream where successful imple- mentation of inferential technology proves elusive. HYDROCARBON PROCESSING OCTOBER 2004 I 47

Transcript of How to lose money with inferential properties

Page 1: How to lose money with inferential properties

IMPROVING PROCESS CONTROL SPECIALREPORT

How to lose money withinferential propertiesFourteen more rules that, if followed, will ensure that advanced controlwill drive the unit further away from optimum operationM. J. KING. Whitehouse Consulting, Isle of Wight, UK

vided the inferential responds by changingin the correct direction, even if relativelyinaccurate, its dynamic advantage can sub-stantially reduce duration of off-spec opera-tion. The analyzer measurement, throughsuitable dynamic compensation, can thenbe used to trim the inferential to maintainIts accuracy.

2. Implement automatic labora-tory updating. By "remembering" whatthe inferential recorded at sample time,when the laboratory result later becomesavailable, it is possible to adjust the biasterm of the inferential to force agreementwith the laboratory. This is common prac-tice for many vendors of inferential tech-

nology, with most providing theoption of filtering this correctionso that some tuneable fraction ofit is applied.

However, even with such afilter in place, use of automatic

o updating almost always reduces000~ accuracy of the inferential. Thet laboratory result is itself sub-Automatic 0 jeer to random error; 'updatinglaboratory simply adds this to that of the

90'--_'--_-'--_-'--_-'-u_pd_a_te..J.s_ta_rt_ed-'-_--'--_--'--_.....L_--l inferent ial, in creasin g overallo 20 40 60 80 100 120 140 160 180 200 random error. This is illustrated

in the case study shown as Fig.1. Soon after commissioninga multivariable controller, theinferred property was found

to more closely approach the upper limitand profitably reduce giveaway. However,the operator then noticed that laboratoryresults were often violating the specificationand reduced the high limit.

The net effect was that there was littlechange in product giveaway. To improvewhat appeared to be an inaccurate inferen-tial, the engineer implemented automaticlaboratory updating. Even with filtering,the effect was to further worsen the situ-anon.

Updating should only be applied if thereis a bias or sustained error. Bias errors canarise because of changes in operating modeor underlying changes to the process causedby gradual effects such as catalyst deactiva-tion. Often, such changes can be detectedand included as part of the inferential tech-

105r--------------------~

102

1. Don't bother with an inferen-tial if there is an onstream ana-Iyzer. Of course, it is tempting to usethe analyzer measurement directly in thecontrol strategy, especially if the analyzer isbelieved to be accurate. However, most ana-lyzers respond much more slowly to processchanges than other instrumentation. Theanalyzer may be located well downstream,the sample system may introduce a signifi-cant delay and the analyzer itself may bediscontinuous. By the time the analyzerfirst indicates a change in quality, the dis-turbance could have already persisted for alengthy period and built up an inventory ofoff-spec material in the process.

Further, the slow dynamics will severely-""'\ limit how quickly the process can be moved

to the required operating conditions. Pro-

The hydrocarbon industry is remark-ably inventive in providing a never-

. '~ ending catalog of ways to jeopardizethe benefits that advanced control shouldcapture. Inferential properties, now com-monplace in advanced control projects,offer another rich vein of examples. Thisarticle, like its predecessors, 1,2 presents afurther list of rules.Also known as "soft sensors"

or "virtual measurements," infer-entials are often applied to pre-dicting product qualities frommore easily measurable operat-ing conditions. But they can beapplied to almost any variablethat is difficult or costly to mea-sure directly. Examples includecolumn flooding, coker drumoutage, furnace coking, etc.Technologies range from simplelinear formulae, through neural

,~ networks to semirigorous engi-~ neering calculations.

o

Applying automatic laboratory updating usually reducesaccuracy.

An added advantage of this approachis that at least some form of control willbe maintained during times when theanalyzer is out of service. Further, a largedifference between inferential and ana-lyzer could help provide early detectionof analyzer failure.

In situations where installing a newanalyzer is being considered, early devel-opment of an inferential may provide aneffective alternative. In capturing someof the benefits of improved quality con-trol, it may reduce what remains to thepoint where the analyzer cost is no lon-ger justified. Or, if an analyzer alreadyexists, it may permit it to be moved toanother stream where successful imple-mentation of inferential technologyproves elusive.

HYDROCARBON PROCESSING OCTOBER 2004 I 47

Page 2: How to lose money with inferential properties

IMPROVING PROCESS CONTROL

n; »

'".., .§C III EQ. ~ <;

E ~ ..c g ;;:III .s III "If' ...• W u

1 5.08 4.81 0.27 0.272 4.97 4.79 0.18 0.453 4.93 5.25 0.32 0.134 5.05 5.02 0.03 0.165 5.20 4.86 0.34 0.506 5.55 4.96 0.59 1.097 5.22 5.08 0.14 1.238 5.52 5.17 0.35 1.589 5.56 4.98 0.58 2.1610 5.56 4.90 0.67 2.8211 5.64 4.86 0.78 3.6112 4.80 4.98 0.18 3.4313 5.16 4.94 0.23 3.6514 4.95 5.17 0.22 3.4315 4.93 5.01 0.09 3.35164.95 5.17 0.22 3.1317 5.17 5.09 0.08 3.2118 5.17 5.16 0.01 3.2219 5.16 4.75 0.41 3.6320 4.84 4.81 0.03 3.66

2

4.0

e 3.5o~ 3.0.J:I.!l1 2.5iij~ 2.0~~ 1.5.sEr 1.0:::l8 0.5

0.0o

Problem, ~ A.. ~esolved1/ ~ V..•.

)

I- t- Bias error = slope of line

Vl/

J Problem~ ~ V devTloped

4 6 8 10 12 14 16 18 20Sample number

EJ .:a The CUSUMcan be used to distinguish a bias error from a random error.

nology itself If this is not feasible, updatingmay be the only solution, but it should notbe automatic following every laboratoryresult. Certainly, the inferential should bechecked against every laboratory result butonly updated if there is clear evidence of abias error. The cumulative sum of errors(CUSUM) technique illustrated in Fig. 2can be used to distinguish a bias error fromrandom error.

3. Check inferential accuracyusing line graphs. Probably the mostcommon way used by vendors to convincethe customer that an inferential is accurateis the line graph. The inferred property iscompared with that measured. Fig. 3 givesa typical example.

Line graphs seem to trick the eye intobelieving that the relationship berween therwo parameters is stronger than it actuallyis. Fig. 4 displays the same data as a scatterdiagram and reveals much larger poten-tial errors. For example, if the measuredproperty is 50, the inferred varies berween30 and 70 - an error potentially as largeas 400/0!

4. Use scatter diagrams and Pear-son R2 to validate the inferential.Fig. 5 shows the trend of the stock marketshare price for an APC vendor. Fig. 6 showsperformance of an inferential developed bythe author. With an R2 of 0.989, the author

----should by now have retired a wealthy man.However, closer inspection of the scatter

diagram shows why not.There are a few points where the pre-

dicted share price was significantly greaterthan the actual price. These points coincidewith the sharp falls in July and October1998. Predicting share price is trivial whenthere are no changes. Money is made byproperly predicting the variations. Thesame is true in the process industry.

To measure effectiveness of an. inferen-tial, it is essential to compare its accuracyto variability of the measured property.Standalone measures such as correlationcoefficients and standard error do not dothis. Fig. 7 shows the parameter, (1 - fJ~rror/

fJ~roperty)' where fJ~rror is the variance of theerror (inferential versus laboratory) andfJ~roperty is the variance of the measuredproperty (with APC off). Should thisparameter fall below zero, the inferentialwill introduce disturbances into the processgreater than those in place prior to the APCcommissioning.

Under these circumstances, greater ben-efits would be achieved by "dropping" theinferential as a controlled variable. SinceAPC projects are often justified by halv-ing the standard deviation, this parameterwould seem to need to have a value of atleast 0.75. In practice, since no APC per-fectly controls the process, the value prob-ably needs to be much greater.

5. Apply regression analysis with-out understanding the process.The easiestway of achieving this is to blindly

Select 81 at www.HydrocarbonProcessing.com/RS ~

Page 3: How to lose money with inferential properties

SPECIALREPORT IMPROVING PROCESS CONTROL

100 ."

•.".,••••

• ".••• h····•I•••• • .•.•••_. "

#. 80;:.~ 60c0..

"'C

t; 40'6'"a:

20

o o 20 40 60Measured property, %

80 100·O~ ~ -"

Line graphs seem to trick the eye into believing therelationship between the two parameters is stronger thanit actually is.

FIG. A scatter plot highlights inferential inaccuracy.

60~----r-----'-----'-----.------r----,60

1lfoAl

rIJJ4~ IV

1 flrlv-IhA f'...-

50~----~-----+----~~-----r----~~--~5040r-----r-----+-----+_~40

"'C

'".~ 301-----+----=-F:..c,.=_. r-=----+------+--------1"'C

'"a:$ 30

20

10~--~ ~~--+_-----r-------1------+_----_410

OL- L- ~ ~ ~ ~ ~

ooJun-97 Sep-97 Jan-98 Apr-98 Jul-98 Nov-98 Feb-99 May-99 Aug-99 Dec-99

50 6010 20 30Actual

40

!I .' Stock market share price of an APC vendor. FIG. 6 Why the author has not made millions of dollars frompredicting share prices.

apply a neural network. Doing so discardsany knowledge of process behavior. Whilethe resulting inferential may work well, itsperformance outside the range over whichit was trained can be extremely unpredict-able. In some cases, this has caused a reversalof the sign of the process gain with respectto the key manipulated variable--severelyimpacting process profitability.

Naively applying linear regression tech-niques can have a similar impact. With mod-ern spreadsheets and statistical packages, itis relativelyeasy to extract large quantities ofdata from the process information databaseand search for all possible correlations. Byincluding large numbers of process variablesit will certainly be possible to apparentlyimprove accuracy of the inferential. How-ever, this is likely to be only a mathematicalcoincidence. If the inferential includes termsthat make no engineering sense (or coef-ficients that have the wrong sign), it will failduring a process excursion.

6. Exclude terms that appear notto make engineering sense fromregression-based inferentials. Acommon form of inferential for distillationproduct composition is a linear function ofthe variables column pressure, P, and traytemperature, T.

However, if pressure and temperaturevary widely, regression will find a betterfit if the term PT is also included. Thismight first appear to have no engineeringmeaning. Fig. 8 shows the true relationshipbetween product composition and pressureand temperature. Including only P and Twould imply that the relationship is a seriesof parallel straight lines. In the exampleshown, this gives a standard deviation ofprediction error of 0.6 mol%. IncludingPT results in a closer match to the nonpar-allellines, reducing the error to 0.3%. Useof a nonlinear function (e.g., T2) insteadof T reduces the error to 0.2%.

Similarly, if Q is the percent of heavy key

in the overhead product then one wouldexpect it to increase as tray temperatureincreases. This would lead one to reject thesecond term in the correlation:

where T\ and T2 are temperatures on twodifferent trays and a, band c are positivenumbers. However, this equation can berewritten as:

If T\ is higher up the column than T2,

the term, T2 - T\, is a measure of fraction-ation, Provided a - b is positive, the cor-relation indeed makes sense.

7. Ignore the dynamics of inputsto the inferential. Dynamic relation-ships between the measured property and ..-each of the inputs will be different. For

50 I OCTOBER 2004 HYDROCARBOr-j PROCESSING

Page 4: How to lose money with inferential properties

IMPROVING PROCESS CONTROL SPECIALREPORT

1211",10Jg 9.';:::~ 8.5 7~ 6"# 5o:2: 4

3256 58 63

1.o.------------------,0.81----------------------1

~0.61----------t'\:--------::;;:f'-"t-lCi;~O.4hr------~.-~~~-.~-rPr~~~~~r-~5.b 0.2HI---t"'--'-----''-qI'---'-t-f-'I----'----"''--'\-fJ-------l+----j

~ 0.0 hfi----;"'"-----=---------------------,19"~~

:: -0.21+--I-f,.J.I''---l;-------------------------I--I/--+~~~-0.41+~_+__+-------------7'<-=-__t

/".Y

l I. 1 ~ormal-Reduced columypressure column

---/press~--- .......... i-""

..;..- ......- .i-> --~~ -~ -~I..---~ I..---~ Increased columnf---J..---- pressure

57-0.8 Inferential is so poor thatr_--------- it should be disabled -------1-1.0'-- -'

Trending inferential accuracy can show when to abandonits use.

Temperature and pressure have a nonlinear effect onproduct composition.

example, if the two tray temperaturesin Rule 6 are far apart, their dynamicswill be significantly different. The infer-ential is based on a steady-state analysisand will, therefore, display an unusualdynamic response. Indeed, under somecircumstances it is likely to exhibit inverseresponse. While it is of course possibleto dynamically compensate the inputs,dynamic compensation required candepend on the source of the disturbance.For example, the dynamic relationshipbetween the measured property and Tlcould be quite different for reflux changeswhen compared to reboiler changes. Ifdynamics are a problem, it is often betterto simplify the inferential to only includeinputs that have dynamically similareffects on the measured property.

8. Always apply semirigorousengineering models in preferenceto regression analysis. As one mightexpect, suppliers of these semirigorous tech-nologies claim that this approach is better.They certainly have some advanrages.:'Inferentials based on regression shouldstrictly only be accurate over the range ofoperating conditions used in their develop-ment. Models based on process engineeringtechniques should in theory operate overthe full range of possible operations and bereadily adapted to take into account processmodifications.

This would suggest that only two orthree sets of test run data would be requiredto calibrate the model as opposed to thelarger number of records needed for regres-sion. One could argue, however, that oneneeds to check the model over a wide rangeof conditions to develop confidence thatit is reliable. This is especially true since

often the underlying technology is based onempirical (and sometimes suspect) general-purpose correlations published by others.

Some disadvantages to the more rigor-ous approach are that the models are usuallymore complex and, therefore, more costlyto implement and maintain. Also, usersoften experience difficulty in retaining theexpertise necessary for their support, andan inferential can effectively degrade to a"black box." Because they tend to use manymore process measurements, more complexapproaches are, therefore, more prone toinstrument failure.

As with many process control tech-nologies, there is no overwhelming argu-ment for one approach over another. Bothtechniques have been applied successfully.Indeed, many sites will have a mixture ofthe two.

9. Stop monitoring inferentialperformance after project com-pletion. Inferentials can degrade overtime. Time-dependent parameters, suchas catalyst activity and equipment fouling,can influence their accuracy. Changes infeed composition can often have a majorimpact, as will even minor process modifi-cations. Inaccuracy can become greater thanthe normal variation in the measured prop-erty. Failure to monitor will then result inthe controller degrading to the point whereprocess performance will be improved byswitching off the controller! See Rule 4.

10. Use Antoine or Clausius-Clap-eyron equations to develop pres-sure-compensated temperatures.Pressure-compensated temperatures (PCTs)are frequently used in inferentials applied todistillation products. Compensating a tray

59 60 61 62Tray temperature. ·c

64 65

temperature measurement for variationsin column pressure, in theory, permits acloser relationship to be developed betweenproduct composition and the measuredtemperature.

While this is of course beneficial, thereare many pitfalls in implementing suchcompensation--so many that a completearticle could be written on the subject. Buta common approach is to apply publishedequations that relate vapor pressure to tem-perature. Many of these equations, how-ever, assume pure components and containcomponent-specific coefficients. Attempt-ing to determine such"coefficients for rnul-ticomponent systems is a significant causeof error. A simple test is to use the sameequation to predict tray temperature fromoperating pressure. Usually the predictionis wildly wrong.

11. Design inferentials using onlydata collected during step-test-ing. Provided the process is permitted toreach steady state, step-test data can beextremely useful in developing inferentials.Indeed, the step-testing will often providemuch greater variation in operating con-ditions than that which normal historicaldata will show.

Further, time-stamping of laboratorysamples is likely to be more closely man-aged. However, relying solely on such anapproach may not cover the whole operat-ing region. For example, it may not takeinto account different feed compositions.It is unlikely to consider parameters thatchange over time, such as catalyst activ-ity or equipment fouling. It probably willnot allow for other parameters that cannotbe changed on demand, such as ambientconditions. Continued

HYDROCARBON PROCESSING OCTOBER 2004 I 51

Page 5: How to lose money with inferential properties

SPECIALREPORT

Leaving development of theinferential to this late stage is dan-gerous. There is likely to be insuf-ficient time to install any addi-tional instrumentation necessaryto improve or replace the inferen-tial. Since any new measurementswill clearlynot have been collectedduring step-testing, it will nor bepossible to complete the dynamicmodeling necessary.At best, it willbe necessary to delay commission-ing and repeat much of the step-testing. In practice, it is likely thatAPC will be commissioned with-out a key control variable.

IMPROVING PROCESS CONTROL

105r---------------------------------~

where CV is the controlledvariable, MV the manipulatedvariable and K the process gain.Many infercntials, particularlythose derived from linear regres-sion, have the same form. Ifinputs to the inferential are allmanipulated variables, it wouldseem obvious that the coeffi-cients in the inferential shouldbe the same as the process gains98~----------------------------------~in the controller. Since the coef-

971--------------------__1 ficients and gains are determined96~------------------__I from different approaches, they95 '--_"--_-'-_-'-_-'-_--'-_-.i...._-'-_--'_--'_---' a re 0 f ten in con sisten t. T hiso 20 40 60 80 100 120 140 160 180 200 might result in the controller

time, minutes implementing a nonoptimum102r------,------r-----,.------, S(fa tegy 0 r even b eco m ing

unstable.Incidentally, it is common

for an inferential to use a singlemanipulated variable as its input,i.e.:

12. Use historical data todevelop an inferential.Most sites have had integratedlaboratory and process informa-tion systems in place for sev-eral years. They are, therefore,likely to contain thousands ofrecords that could potentially beused to develop inferentials byregression. In practice, however,there is usually little variationin the data. Operators will haveadjusted the operating condi-tions to keep key properties closeto operating targets.

Variation in the data is likelyto be more due to random errorsthan to any change in operat-ing conditions. Regression is, therefore,unlikely to produce a viable inferential.This is one of the arguments that suppliersof more rigorous techniques put forward.They require only a few points to calibratetheir models. However, if the calibrationdata do not show a wide variation, whatconfidence is there that their model willwork during excursions from normaloperation?

The key is "quality not quantity." Usingrelatively few data sets where collectionwas properly managed over a wide rangeof process conditions instead of hundredsof historical data sets is far more likely togenerate an effective inferential.

R2 =0.611~101~-----~-----~-r •• ---a~~------~tQ)o,e~100f-------+----.h~~::JCl)CllQ)

~ 99~----~~~------r_-------+------__1

One must question the value ofthis-even if aj is consistent with

98'-- '-- '-- ---''-- ---' Kt. Its advantageappears limited to98 99 100 101 102 displaying the inferred property in

Actual property the way the operator is used to see-ing the measured property. Placingsuitable limits on the manipulatedvariablewould allowthe c~ntrolledvariable to be removed from the

controller. HP

13. Don't bother with accuratetime-stamping of laboratorysamples. It might seem obvious thattime-stamping becomes more importantif a laboratory sample is taken when theprocess is not steady. One might, there-fore, infer that the converse is true: if theprocess is steady, small errors in recording

the sampling time have little effect. Fig. 9. illustrates the impact on an otherwise per-fect inferential of a randomly determinedsampling time error in the range of -10to +10 minutes. With the process close tosteady state, one might falsely concludefrom the R2 value that the inferential is oflittle value. This also illustrates the impor-tance of Rule 4.

Even accurately time-stamped samplestaken when the process is unsteady arelikely to be of little value. Process dynam-ics dictate that the sampled property is theresult of process conditions that were inplace some unknown time before the sam-pling time.

14. Don't check for consistencybetween the inferential and themultivariable controller. Multivari-able controllers comprise a series of linearmodels of the form:

CV = KjMVj + K2MV2 ... + KnMVn+ bias

FIG. 9 Time-sampling of laboratory samples is important, even ifthe process is steady.

52I OCTOBER2004HYD.R9CA~BO~ PROCESSING

LITERATURE CITED1 King, M. J., "How ro lose money with advancedcontrols," Hydrocarbon Processing, June 1992.

2 King, M. J., "How ro lose money with basic con-trols," Hydrocarbon Processing, Ocrober 2003.

3 Friedman, Y. Z., "First-principles distillationinference models for product quality prediction,"Hydrocarbon Processing, February 2002.

Myke King founded WhitehouseConsulting in 1992.Previously, hewas a founder member of KBC Pro-cess Automation, and prior to that

he was employed by Exxon. Mr. King is responsible forconsultancy services assisting clients with developingand executing advanced control and information sys-tem projects. He has 30years of experience in suchprojects, working with many of the world's leading oiland petrochemical companies. Over 1,000engineershave attended his training courses. Mr. King has an MAdegree in chemical engineering from Cambridge Univer-sity and is a fellow of the l.Chem.E. He can be contactedat [email protected].