Pseudoequilibrium Model Based Estimator of Matte Grade in a Copper

Dec 15, 1996 - Pseudoequilibrium Model Based Estimator of Matte Grade in a. Copper Smelter. Patrick Ronan, Mark Pritzker,* and Hector M. Budman...
0 downloads 0 Views 191KB Size
112

Ind. Eng. Chem. Res. 1997, 36, 112-121

Pseudoequilibrium Model Based Estimator of Matte Grade in a Copper Smelter Patrick Ronan, Mark Pritzker,* and Hector M. Budman Department of Chemical Engineering, University of Waterloo, Waterloo, Ontario, Canada N2L 3G1

A smelter model has been developed as the basis for an inferential matte grade estimator for an industrial copper smelter. This model couples dynamic mass balances on each species with equilibrium relationships for each component to form a system of differential and algebraic equations. An extended Kalman filter (EKF) based on the dynamic model was applied to track variations in feed composition and enhance the model performance for estimating matte grade. For simulated plant data, the extended Kalman filter tracked feed composition disturbances very well. The effect of the frequency of matte grade measurements on the accuracy of the grade estimates was studied. Off gas composition measurements were also used to infer matte grade and improve the estimator performance. When these secondary measurements were used in conjunction with the matte grade measurements in the EKF algorithm, the estimator produced the smallest error between the estimate and the plant. 1. Introduction A smelting furnace is a reactor in which a concentrated ore feed is contacted with oxygen. In the case of copper smelting, the feed containing 20-30% copper by weight is melted and partially oxidized in the reactor to form two separate phasessa lighter slag phase rich in iron and a heavier matte phase rich in copper. The slag phase is made up primarily of FeO, Fe3O4, and SiO2 with trace quantities of copper and is considered as waste in the copper-smelting process. The matte phase is primarily made up of Cu2S and FeS. A comprehensive review of copper-smelting operations is given by Davenport and Partelpoeg (1987). The matte phase is fed to the downstream converters which produce a high-purity copper product (approx 99% copper) from the matte phase (65-70% copper). Because the converters are batch units, the matte and slag are only “tapped” from the smelter intermittently. A typical tapping schedule is shown in Figure 1. The “onoff” nature of the tapping schedule creates a semicontinuous smelting process in which concentrate is continually fed to the reactor while the matte and slag phases are extracted on the basis of a tapping schedule. The processing time for the converters is a direct function of the matte grade (weight percent copper) in the matte phase. If the grade is too low, the required converter production time must be increased; if the grade is too high, metallic copper, which is detrimental to the refractory lining of the converter, will form. Therefore, control of the matte grade between these limits is key to the smelting operation. Moreover, the use of automatic control has the potential of decreasing the variability in grade, allowing the operators to set targets for a grade closer to the upper limit. Most industrial smelting processes use control strategies based on steady state mass balances (Kyto et al., 1989; Czernecki et al., 1989). The mass balances are used to determine the necessary feed rates for a given target matte grade. Although the steady state strategies have proved successful, they have serious limitations when a semicontinuous smelter is considered or when there is a high degree of variability in the feed * Author to whom correspondence should be addressed. Phone, 519-885-1211 (ext 2542); e-mail, pritzker@cape. uwaterloo.ca; fax, 519-746-4979. S0888-5885(96)00254-0 CCC: $14.00

Figure 1. Typical matte tapping schedule (1 indicates tapping; 0 indicates no tapping).

composition. In these situations, the reactor is never at steady state. Another area of concern is the monitoring of the reactor performance. Due to the characteristics of the process, only feed rates and temperature are typically monitored on-line. Matte grade is monitored off-line much less frequently (every 30-45 min) than the on-line measurements. Since control moves are made on the basis of matte grade data, there is concern about what is happening between samples. These problems suggest that any control strategy may be significantly improved by incorporating an on-line estimator into its scheme. The estimator would account for the dynamics of the process and provide matte grade estimates to use for feedback control purposes between matte samples. Recently, the first reported effort to develop a dynamic model as the basis for an adaptive estimator was conducted by Cain et al. (1996). Crucial to their approach is the well-known observation that the concentrate melts and reacts within seconds of being fed to the smelter (Davenport and Partelpoeg, 1987). Consequently, Cain et al. (1996) envisaged that the smelting process could be split into two stages by incorporating a steady state block and a dynamic block into their model. The first block accounts for the instantaneous and complete conversion of feed to matte and slag components through the use of steady state mass and energy balances. The © 1997 American Chemical Society

Ind. Eng. Chem. Res., Vol. 36, No. 1, 1997 113

products from the steady state blocks are fed to the dynamic block which consists of separate mixers for the matte and slag phases. In each of these mixers, newly formed material from the first block is mixed with previously formed material remaining in the smelter. The dynamics of the smelting process is considered to arise from fluctuations in the flow rate of feed to the reactor, the intermittent nature of the tapping of the matte and slag from the reactor, and the fact that the tapping rates of the matte and slag are usually quite different. These effects are captured entirely in the dynamic block in the model. Two major hurdles exist for the estimation of the reactor states in industrial smelters. The first is the large variability and uncertainty in the feed composition. It is common industrial practice to introduce significant amounts of scrap material (e.g. circuit boards, cables, etc.) into the reactor. Not only is this material highly variable in composition, but its chemical analysis is not practically feasible. A second hurdle arises from the difficulty in making frequent on-line measurements of the progress of the process. Reactor temperature is the only variable that is routinely monitored on-line. Matte grade analysis which provides the most direct measure can only be done intermittently due to the extreme conditions of the process and technological limitations. At best, matte sampling is done approximately every 30-45 min with another 15-20 min required for the chemical analysis to be done and data sent to the operators. For example, Kyto et al. (1989) reported that the operators at the Outokompu Harjavalta Copper Smelter analyzed the matte on average 4-6 times per day with a delay of 30 min before the results are obtained. Cain et al. (1996) made an effort to address these issues in designing their estimator. They used their dynamic smelter model as the basis for an adaptive estimator to predict matte grade using the weight fractions of copper and iron in the feed as the unknown fitting parameters. Their scheme utilized recursive leastsquares estimation (RLSE) with resetting of the predicted matte grades to the measured values as they become available. In addition, they incorporated the effect of the delay between the time the matte is sampled and the time its composition is reported to the operator. This estimator performed reasonably well when tested against data collected during test runs on the actual industrial smelter in question. However, it was felt that further improvements in the estimation could be made. Since continuous on-line data of reactor temperature were also available, Cain et al. (1996) attempted to improve their estimator by using this additional information and having it adapt on both matte grade and temperature measurements. Unfortunately, reactor temperature proved to be not as sensitive to feed composition changes as matte grade, and so it made no improvement to estimator performance. With this in mind, there are three major objectives to the current study. The first is to examine further avenues to improve the performance of the matte grade estimator. For one thing, we will investigate the use of the extended Kalman filter (EKF) method as the basis for the estimation scheme. It is hoped that this will help to smooth out abrupt changes in the predicted matte grade that were sometimes observed with the previous scheme based on RLSE and resetting. The second important aim of this work is to identify a secondary measurement which is more sensitive to feed composi-

tion changes than temperature and which can be incorporated to improve the estimator. In particular, we will look into using the weight percent SO2 and the mass flow rate of SO2 in the smelter off gas as measurements along with matte grade in the estimation scheme. The third major objective of this research is to modify and improve the dynamic smelter model upon which the estimator is based from the one previously presented by Cain et al. (1996). There are some problems associated with modeling the smelter as a steady state block followed by a dynamic block. Firstly, it does not give an entirely accurate representation of what occurs in the furnace since it does not allow for the matte and slag components to react further once they enter the dynamic block. Consequently, reaction and mixing are considered to be distinct sequential processes within the smelter. Our experience with the model has shown that in situations where operating conditions are extreme (e.g. very high O2 flow rates in the feed) or there are large variations in operating conditions, this can lead to unrealistic or even impossible predictions of smelter behavior in the steady state block. (It should be noted that these conditions do not prevent the estimator from working reasonably well since adaptation is done on the dynamic block only.) Secondly, as the previous model is constituted, it does not predict mass flow rates of the off gases. Consequently, it cannot be used if the SO2 flow rate is to serve as a measurement on which the estimator can adapt. We will therefore present a smelter model in which the reaction and mixing parts of the process occur simultaneously within a single CSTR. In addition, the model will allow off gas flow rates to be determined. 1.1. Copper-Smelting Reactions. In the coppersmelting furnace, sulfide concentrates are melted and oxidized to produce two liquid phasessa matte phase which is rich in copper and a slag phase which is rich in iron. The primary components of the concentrates fed to a smelter are typically chalcopyrite (CuFeS2) and pyrite (FeS2). In addition to the concentrates, coal is fed to the reactor in order to control temperature and silica flux (SiO2) is fed to the reactor to enhance the separability of the two phases. Silica flux also regulates the viscosity of the slag, facilitating the tapping of the slag from the reactor. Oxygen is continuously fed to the reactor to oxidize the feed. Assuming the feed is primarily CuFeS2 and FeS2, the following oxidation reactions take place:

2CuFeS2 +

5 13 1 3 O w Cu2S‚ FeS + FeO + SO2 4 2 2 2 2 (1)

(

)

5 FeS2 + O2 w FeO + 2SO2 2

(2)

Cu2S‚(1/2)FeS forms the heavier matte phase, while the oxides comprise the lighter slag phase. SO2 leaves with the off gas, along with combustion products, water, and inerts such as nitrogen. The FeO reacts further to form the lighter slag phase as follows:

FeO + SiO2 w FeO‚SiO2

(3)

1 3FeO + O2 S Fe3O4 2

(4)

Through reaction 3, FeO forms a liquid solution with SiO2 in the slag phase, while it is oxidized via reaction

114 Ind. Eng. Chem. Res., Vol. 36, No. 1, 1997

4 to form magnetite which remains mostly in the slag phase. Reactions 1-4 are highly exothermic and result in a very high bath temperature (approximately 1500 K). In addition to the above reactions, further oxidation of FeS can occur through the following reaction:

1 1 FeS + O2 S FeO + S2 2 2

(5)

It is important to control the amount of magnetite (Fe3O4) present in the slag due to its high melting point and relatively low solubility in the slag phase. The presence of solid magnetite in the slag can lead to high viscosity or even to a separate solid phase, both of which would lead to problems in tapping the slag phase from the vessel. It is important, therefore, to maintain the reactor at a sufficiently high temperature to maintain the magnetite solubility as high as possible. On the other hand, the temperature must also be maintained below an upper limit since high temperatures can cause the two phases to become very fluid and more difficult to separate, as well as possibly damage the refractory lining of the smelter. Other reactions that take place in the reactor bath lead to the formation of such minor species as Cu2O, PbO, and ZnO. Although these were not included in the model presented in this work, they could easily be incorporated into the model. An overview of these reactions is given by Davenport and Partelpoeg (1987) and Nagamori and Mackey (1978a,b). 2. Smelter Model The model implemented in this study is a modification of a previous one presented by Cain et al. (1996). In this section, we outline the assumptions and structure of the model, pointing out the similarities and differences between the two versions. The model consists of dynamic balances on each of the major species in the matte phase, slag phase, and the off gases. Unlike the previous approach of Cain et al. (1996), an energy balance is not included for several reasons. Firstly, there are a number of energy transfer terms that are not well characterized or highly uncertain (e.g. radiation losses, energy involved in the combustion of the scrap material), which makes it difficult to track the dynamics of temperature changes within the reactor. Secondly, Cain et al. (1996) demonstrated that the use of temperature as a second measurement (in addition to matte grade) upon which the estimator can adapt brought no improvement in the performance of the estimator. Thus, there is no advantage to treating temperature as a state variable. Instead, it makes more sense to utilize the reactor temperature data that are available on-line as input parameters to continually update the mass balance equations. The rising air and/or enriched air from the tuyeres at the bottom of the furnace causes vigorous mixing within the matte and slag layers. From knowledge provided by plant metallurgists, composition within each phase does not vary much within the reactor. Consequently, we have modeled the smelter as a CSTR, as Cain et al. (1996) did. However, as mentioned previously, the new model differs from the earlier one in that the reactions, mixing, variations in the feed, and the intermittent matte and slag tapping schedules are accounted for within a single dynamic CSTR. The feed to the smelter is complex and consists of several separate streams: several ore concentrates from

different sources, recycled slag from the downstream converters, coal, flux containing SiO2 and lesser amounts of CaO and Al2O3, air and/or enriched air, and scrap material. In formulating the model, we have relied on knowledge of the process and also on some simplifying assumptions: (1) The minerals CuFeS2 and FeS2 in the concentrate react rapidly and completely within seconds of being added to the furnace (Davenport and Partelpoeg, 1987; Kyto et al., 1989). Thus, reactions 1 and 2 are considered to go to completion. (2) The matte phase contains Cu2S and FeS. (3) The slag phase contains FeO, Fe3O4, and SiO2. (4) The off gas contains N2, O2, H2O, CO2, SO2, and S2. (5) Minor species such as PbS and ZnS in the matte and Cu2O, PbO, ZnO, CaO, and Al2O3 are not considered. (6) Physical entrainment of slag within matte and matte within slag is not incorporated. (7) The distribution of FeS, FeO, Fe3O4, O2, SO2, and S2 are determined by reactions 4 and 5 which are considered to be at pseudoequilibrium and also by empirical thermodynamic relationships determined in previous studies (Nagamori and Mackey, 1978a; Michal and Schuhmann, 1952). (8) Coal is completely combusted to CO2. (9) SiO2, N2, and H2O are chemically inert. (10) There is no accumulation of the gaseous species within the reactor. Since the reactions within smelters are rapid in comparison to typical residence times (Davenport and Partelpoeg, 1987), we have based the new smelter model on a pseudoequilibrium approach in which the reactions are assumed to be very fast in comparison to the dynamics of the mixing and feed and discharge schedule. Thus, as stated in assumption 7 above, the distribution of the various products is dictated by equilibrium considerations. The model development starts with dynamic mass balances on each species considered in the matte, slag, and off gases. Each of these balances contains a generation or consumption rate term due to the homogeneous reactions in which the particular species participates. However, we do not describe these terms explicitly since equilibrium expressions are to be used instead. Since the homogeneous reactions are constrained by mass conservation considerations, it is possible to combine the species balance equations so as to eliminate the generation and consumption terms. The following example will serve to show how this is done. Consider the iron in the system which reacts to form FeS, FeO, and Fe3O4 in the matte and slag phases, respectively. Assuming none of these species is present in the feed and that all the Fe in the feed reacts, the mass balances are as follows:

MFeS d (M ) ) 0 - Qmatte tot + RFeS dt FeS M

(6)

MFeO d (MFeO) ) 0 - Qslag tot + RFeO dt M

(7)

MFe3O4 d (MFe3O4) ) 0 - Qslag tot + RFe3O4 dt M

(8)

0 ) Qfeed Fe - RFe

(9)

matte

slag

slag

Ind. Eng. Chem. Res., Vol. 36, No. 1, 1997 115

where Mi is the mass of species FeS, FeO, and Fe3O4 within the reactor, Qfeed Fe is the total mass flow rate of Fe in all its forms in the feed stream, Qmatte and Qslag are the mass flow rates of matte and slag from the reactot tot tor, and Mmatte and Mslag are the total masses of matte and slag within the reactor, respectively. RFeS, RFeO, and RFe3O4 are the rates of generation due to reactions in the smelter. Equation 9 is obtained from the assumption that the concentrates melt and react in the order of a tenth of a second, as described by Davenport and Partelpoeg (1987). From this, we take the accumulation terms for the feed components to be zero. The generation and consumption terms are related by the following equation:

FFe,FeSRFeS + FFe,FeORFeO + FFe,Fe3O4RFe3O4 ) RFe (10) In eq 10, the coefficients F refer to the mass fractions of Fe in FeS, FeO, and Fe3O4, respectively. Equation 10 states that the rate of consumption of Fe in the feed is equal to the sum of the combined rates of generation of Fe in the three iron-containing products. Therefore, balances 6-9 can be combined algebraically and utilized with eq 10 to give a single overall balance on all Fecontaining species with no reaction rate terms as follows:

d d (M ) + FFe,FeO (MFeO) + dt FeS dt MFeS d FFe,Fe3O4 (MFe3O4) ) Qfeed Fe - FFe,FeSQmatte tot dt M

FFe,FeS

matte

FFe,FeOQslag

MFeO tot Mslag

- FFe,Fe3O4Qslag

MFe3O4 tot Mslag

(11)

resulting in one dynamic balance on all Fe-containing species. However, in doing so, we have lost two of the dynamic equations. This is compensated for by the addition of equilibrium relationships taken from the literature. These take into account the equilibria of reactions 4 and 5. Using the above approach, we have derived a set of balance equations and equilibrium relationships to completely define the system. The full set of equations is given in the Appendix. The system of nonlinear differential and algebraic equations has the general form

g(x3 (t),x(t),u(t)) ) 0 y(t) ) h(x(t))

(12)

where x(t) and its derivatives are vectors of the variables being solved in the model. The variables with accumulation terms are the masses of Cu2S, FeS, FeO, Fe3O4, and SiO2. The algebraic variables are the mass fractions in the gas phase of SO2, H2O, N2,O2, S2, and CO2 and the off gas mass flow rate (Qoffgas). The inputs, u(t), include the O2 flow rate, ore feed rates, ore feed composition, coal and silica flux feed rates, and the temperature of the reactor bath. The feed composition is not known a priori and is defined as a function of two parameters γ and β, which represent the copper and the iron weight fractions in the main concentrate stream. These parameters are adapted on-line to fit the model to the matte grade measurement. This will be further discussed in a later section. The system defined by eq 12 can be easily solved using a variety of different software packages. Temperature values obtained directly from the infrared pyrometer measurements con-

ducted on-line are used as inputs to the model to update the equilibrium constants which depend on temperature. 2.1. Comparison of the Model to Plant Data. The model developed using this approach has been tested and compared to several sets of plant data obtained from an industrial copper smelter. Plant data from the smelter site were collected on two separate occasions to produce four data sets covering time periods from 5 to 9 h. The data sets are denoted as DS1, DS2, DS3, and DS4. A nonlinear steady state controller which is normally operated in this smelter was kept activated during these data collection runs. This controller controls the matte grade by manipulating the feed rate of the concentrate. The feed streams for DS1 and DS2 were therefore augmented by a pseudorandom binary signal (PRBS) in addition to the normal process fluctuations and control actions. This was done to allow the true process response to be distinguished from the controller action, as discussed by Ljung (1987). Adding a PRBS to DS3 and DS4 was not possible due to operational difficulties, but this is not of major concern since Ljung has shown that when a nonlinear controller is used, process identification can be achieved under closed loop conditions without the addition of a PRBS. For reasons of confidentiality, we cannot present the exact values of the flow rates and operating compositions for each data set. These values will be reported in deviation form based on arbitrarily set values. The feed rates of the concentrate streams, air, coal, silica flux, and temperature were recorded every minute. In addition, the tapping schedules for the matte and slag phases were recorded. In the case of DS1, it was not possible to record all the information due to operational difficulties. To compensate for this, the set-point values from the controllers currently in operation at the smelter were used for this data set. This did not seem to be a big problem in the case of the feed concentrate streams since these were observed to fluctuate very little. However, the blast and enriched air streams were observed to fluctuate more than their set points would indicate. Since the matte grade is highly sensitive to the oxygen input to the system, it is expected that the model performance for DS1 will not be as accurate as for the other data sets. All other data sets included the actual feed rate values and not the set points. To evaluate the model sensitivity to changes in feed composition and its potential to serve as a basis of a matte grade estimator, the initial simulations were conducted using the input values from data set DS2. The results shown in Figure 2 were obtained from simulations using three different combinations of values of the weight fraction copper in the main feed stream (β) and the weight fraction iron in the main feed stream (γ). The reduced matte grade is defined as the difference between the actual weight percent copper in the matte and an arbitrary reference value. The values of β and γ are given in deviation form for reasons of confidentiality. The combinations used for [∆β, ∆γ] are [-0.002, -0.005], [0, 0], and [+0.008, +0.005]. The ∆ indicates the amount by which the parameter is changed from the reference value. The reference values are those which gave the best fit between the measured matte grade and the model predictions for data set DS2. Since β and γ correspond to feed compositions, it is obvious from Figure 2 that changes of less than 1% cause significant changes in the model prediction of matte grade.

116 Ind. Eng. Chem. Res., Vol. 36, No. 1, 1997

Figure 2. Effect of feed composition on model output using input values from data set DS2. ∆β ) -0.002, ∆γ ) -0.005 (‚‚‚); ∆β ) 0, ∆γ ) 0 (s); ∆β ) +0.008, ∆γ ) +0.005 (-‚-).

Figure 4. Comparison of measured (+) matte grades and predictions (‚‚‚, ∆β ) -0.017, ∆γ ) 0) using the smelter model for data set DS1.

Figure 3. Comparison of measured (+) matte grades and predictions (‚‚‚) using the smelter model for data set DS2.

Figure 5. Comparison of measured (+) matte grades and predictions (‚‚‚, ∆β ) -0.117, ∆γ ) -0.153) using the smelter model for data set DS3.

On the basis of our previous work (Cain et al., 1996) and the model sensitivity to changes in the feed composition, the tuning parameters chosen for the modelbased estimator are β and γ. By a trial-and-error approach, values were found which provided the best fit between the predicted matte grade and measured matte grade values. Figure 3 shows the comparison between the measured grade and the predicted grade over a span of almost 5 h for DS2 after tuning β and γ by this trial-and-error procedure. As stated earlier, future values of β and γ will be given in reference to these values. Figure 3 shows that the model tracks the trends in the process dynamics very closely. Using the same trialand-error tuning procedure for β and γ data sets DS1, DS3, and DS4, good agreement was achieved between the model and the measured matte grade values. Not surprisingly, the accuracy of the model is not as good for DS1, as shown in Figure 4. This fit was obtained using ∆β ) -0.017 from the base case and ∆γ ) 0. As stated earlier, the poor fit shown in Figure 4 is likely due to the difficulties encountered in collecting all the necessary data. Figure 5 shows the best fit of the model to the measurements during run DS3 obtained using ∆β ) -0.117 and ∆γ ) -0.153. It is worth noting that during this run a stoppage of feed occurred at about 350 min and lasted approximately 20 min. As indicated in Figure 5, this had no apparent effect on the ability of

the model to predict matte grade and track the process dynamics. During this stoppage period, all the feed rates including that of the enriched oxygen were zero. The ability of the model to effectively track the process dynamics during this periods is important since feed stoppages are not uncommon occurrences at the reactor site. The contents of the reactor bath, i.e. FeS, continue to oxidize as long as there is some oxygen present in the smelter bath. Finally, Figure 6 shows the best fit of the model for the final data set DS4 obtained using ∆β ) -0.182 and ∆γ ) -0.215. There is a good fit between the model and the measurements for this final data set. Figure 7 shows that the mass fraction of oxygen predicted in the off gas is of the order of 10-7. This justifies the assumption made by Cain et al. (1996) that virtually all the oxygen is consumed in the reactor. Simulations were done in which the amount of oxygen fed to the reactor was artificially increased to look at the effect this would have on the model output. It was found that as long as some FeS remains in the matte phase to be oxidized to FeO, the oxygen content in the off gas remains very low. It should be noted that although the amount of O2 remaining is negligible from the point of view of the mass balance, it cannot be neglected altogether since the equilibrium relationships depend on PO2.

Ind. Eng. Chem. Res., Vol. 36, No. 1, 1997 117

case (Davenport and Partelpoeg, 1987; Nagamori and Mackey, 1978a,b). As mentioned earlier, it is also no longer necessary to assume that all the oxygen is consumed in the reactions. This model also allows the off gas flow rates to be determined which, as will be seen, will be used to improve the estimator. Comparison of the results for each of the data sets shows that the values of the tuning parameters which provide the best fit to the data vary widely from day to day, precluding the use of a fixed estimator. A similar conclusion was reached using our previous model (Cain et al., 1996). This new model can also be used as the basis for an adaptive estimator, as will be described in the next section of the paper. 3. Adaptive Estimation of Matte Grade Figure 6. Comparison of measured (+) matte grades and predictions (‚‚‚, ∆β ) -0.182, ∆γ ) -0.215) using the smelter model for data set DS4.

Figure 7. Predicted oxygen mass fraction in the off gas from data set DS2.

One should note the relative values of the tuning parameters between the first two data sets and the last two. The first two were collected on the first trip to the smelter site, while the last two data sets were collected several months later on the second trip to the smelter. It is apparent that the operating conditions had changed over this period of time from the values of the parameters as well as the difference in the range of matte grade. The first two data sets show matte grades between 0 and 3% above the reference value, while the grades in the second two lie 1-7% below the reference value. This is a clear indication of the variability in the process. The above comparisons clearly show that the model predictions are very sensitive to input composition changes and therefore can be effectively used as the basis for inferring the input composition and the matte grade using all the available information of the operating conditions at any given time. Once tuned, the model effectively tracks the dynamics and provides reasonable estimates of the grade. In terms of predicting grade, the model performs as well as our previous model, however, with some improvements. It more correctly accounts for the fact that the reactions and mixing will occur simultaneously in the smelter bath. Thus, it ensures that the distribution of the various species within the entire furnace is dictated by equilibrium thermodynamics, which is generally accepted to be the

An estimator which can predict matte grade between lab samples can be designed using the dynamic smelter model described in section 2. This should in turn permit better control of the smelter since the estimator may be used to provide continuous feedback information for control purposes. Given the fluctuating nature of the feed streams, an adaptive estimator seems to be the best choice. Specifically, an extended Kalman filter (EKF) has been used to estimate matte grade where the parameters β and γ are adapted to capture the changes in the feed composition with time. The final step in designing an estimator is choosing the measurable variables on which the inference of matte grade can be made. In our previous work (Cain et al., 1996), temperature and infrequent matte grade measurements were initially chosen, but temperature was found to contribute little information to the estimation of grade. As mentioned earlier, this may be due to the fact that the temperature changes are due to the heat released from the combustible scrap material which is also fed to the smelter but cannot be accurately characterized for modeling purposes. In the current work, we examine the use of another inferential variable, namely the SO2 mass flow rate in the off gas, as a secondary measurement to be used along with the matte grade measurement in an adaptive estimator. However, SO2 flow rate data are not currently available for data sets DS1-DS4 since it is not being measured at the present time. Consequently, to study the use of this additional variable, the only recourse is the use of simulated plant data. 3.1. Kalman Filtering. The algorithm applied to this work is an extended Kalman filter which is an extension of the linear Kalman filter. Kalman filter theory has been discussed extensively in the literature by Gelb (1974) and Goodwin and Sin (1984). For the nonlinear case, the model is linearized around the operating point to obtain a linear state space representation of the system. Application of the Kalman filter on a linearized version of a nonlinear model around the current operating condition is referred to as the extended Kalman filter. In this approach, the vector of states is augmented with the stochastic parameter states in order to adapt the parameters during each run through the EKF algorithm. One of the earliest applications of this technique was reported by Jo and Bankoff (1976) for the monitoring and estimation of polymerization reactors, while McAuley and MacGregor (1991) presented a more recent application of this technique for the on-line inference of polymer properties in an industrial polyethylene reactor.

118 Ind. Eng. Chem. Res., Vol. 36, No. 1, 1997

In our work, the linearization of the model presented above has been done automatically using the software package SpeedUp, which performs the linearization numerically and provides the linearized state space model. The states for the system are the variables in the model which have corresponding accumulation terms and the parameters which are being adapted. The states include the masses of every species present in the matte and slag phase except magnetite which can be explicitly computed from an empirical equation shown in the Appendix (eq A.10). In addition, the weight fractions of copper and iron in the main feed stream are the final two states. The state vector is therefore x ) [x1 x2 x3 x4 x5 x6]T, where x1-x4 correspond to the masses of Cu2S, FeS, FeO, and SiO2, respectively, and x5 and x6 are the parameters β and γ. The noise in the grade measurement and in the parameters β and γ were chosen on the basis of information from the plant. The process noise for the other variables was selected through trial and error by fitting grade estimates to grade measurements for data set DS2. The noise terms were assumed to be uncorrelated. The matte grade measurement associated with the smelter has a delay of 15-20 min between the time the sample was taken and the time the analysis was received by smelter operators. For simplicity, the delay was assumed to be a constant 20 min. When the measurement is received, the states are updated using the following equation

Figure 8. Effect of sampling interval and lab delay on accuracy of matte grade estimator. Sampling times are 15 min (s), 30 min (‚‚‚), and 45 min (-‚-).

xˆ (k-d|k-d) ) xˆ (k-d|k-d-1) + K(k-d)[ym(k-d) - yˆ (k-d)] (13) where xˆ are the predicted states, K is the Kalman Filter Gain, ym is the measured grade, and d is the measurement delay. The model is then reintegrated off-line from (k - d) to k to give the updated state at the present time. The estimator proceeds from this point to compute new estimates until the next sample analysis is received, at which point the procedure is repeated. A detailed explanation of this updating procedure is given by Cain et al. (1996). The performance of the extended Kalman filter applied to the copper smelter is discussed in the next section. 3.2. Inferential EstimatorsDiscussion of Results. The performance of the EKF was first studied on the data sets DS1-DS4 to determine if the estimator offered any improvement over the tuned model. Only matte grade measurements can be used in the EKF algorithm since they are the only available measurements. Figure 9 shows a comparison of the plant data to the fixed dynamic model and the estimator using the extended Kalman filter to infer feed changes. Although matte grade measurements were available at 10 min intervals for data set DS2, only those 30-40 min apart were used in order to simulate existing plant practices. The results in Figure 9 show that the estimator performs satisfactorily. Comparison with the results of Cain et al. shows the estimated response in this work to be smoother due to the use of the EKF rather than RLSE with pure resetting. It is likely that further improvement in accuracy of the estimator may require the use of an additional more frequent measurement. In the remainder of this study we examine the use of two measurements for adaptation. However, since no other measurements are currently available on-line, we will base this analysis on simulated plant data. These simulated plant data were created by introducing a

Figure 9. Comparison of plant measurements (+) with the predictions of the fixed model (s) and the EKF adaptive estimator (‚‚‚) for data set DS2. (x indicates matte grade measurements used in the EKF algorithm.)

series of step changes or random walk type of disturbances in the feed composition to the dynamic smelter model under open loop conditions while keeping the mass flow rate constant. The outputs from these simulations, specifically the matte grade and SO2 flow rates, were then augmented with white noise. The white noise is normally distributed with a zero mean and an assumed variance. It is from these noisy signals that the simulated plant measurements are taken. The role of the adaptive estimator is to infer changes in the feed parameters through the comparison of the predicted model output and the simulated plant measurements. Different operating conditions were studied to test the performance of the inferential estimator. The effect of the sampling interval and the measurement delay on the estimation was examined. The estimator was designed using only the matte grade measurement in the EKF. Results were consistent with those found by Cain et al. (1996), showing that the performance improves as the sampling interval is decreased and the delay shortened. Figure 8 shows the sum of square errors between the prediction and the measurements for a range of sampling intervals from 15 to 45 min. Although it is not possible to totally eliminate the delay time for the chemical analysis of the samples, if this

Ind. Eng. Chem. Res., Vol. 36, No. 1, 1997 119

Figure 10. Comparison of EKF matte grade estimator adapting β only (‚‚‚) and adapting β and γ (-‚-) on simulated data. (+ indicates simulated grade measurement.)

Figure 12. Adapted values of β (‚‚‚) and random walk disturbance in β (s) corresponding to the response in Figure 11.

of about 1%, which are consistent with the maximum errors with the recursive least-squares estimator of Cain et al. (1996). Figure 12 shows the relatively slow adaptation of the parameter β due to the sampling interval and delay. One solution to the problem of the sampling interval would be to add a second inferential variable which could be taken more frequently. As discussed earlier, Cain et al. (1996) tested temperature as an inferential variable previously and found it to contribute little to the estimator. In this analysis, we turn our attention to SO2 measurements which may offer more information for the inference of matte grade than does the temperature. Two types of measurements were considered, the SO2 concentration in the off gas and the mass flow rate of SO2 leaving the reactor, which is simply the flow rate of the off gas multiplied by the SO2 composition. We found that the gas composition measurement did not improve the estimator accuracy in predicting grade. This may be due to the fact that the concentration of SO2 is found according to the following equation Figure 11. Performance of matte grade estimator (‚‚‚) using only matte grade measurements. (+ indicates simulated matte grade measurements.)

and the sampling interval can be minimized and maintained constant during operation, the estimator could provide a more reliable matte grade prediction. At this moment, reducing the sampling interval and lab delay is very difficult due to workload constraints in the plant. On the basis of our previous findings concerning the number of parameters to adapt as well as our current work in these simulation studies, it was concluded that adaptation of only one parameter is adequate for the estimation of matte grade. Figure 10 shows a comparison of matte grade estimatorssone which adapts only the parameter β and one which adapts both β and γ. There is very little difference between the two estimators in terms of prediction accuracy. The use of more than two adaptive parameters was not examined because it is believed that an adaptive estimator with three or more adapting parameters would be too sensitive to process and measurement noise. For these reasons, only the parameter β is used in the further adaptation schemes studied in this work. The performance of the matte grade estimator using only matte grade measurements is shown in Figures 11 and 12. These results are for a random walk type of disturbance in β. The estimator shows maximum errors

[SO2] )

m ˘ SO2 m ˘ offgass

(14)

where the numerator is the mass flow rate of SO2 and the denominator is the total mass flow rate of the gases leaving the reactor. If both the numerator and the denominator in eq 14 are functions of β, the effect of a change in the feed composition would tend to cancel itself out in this equation. However, a change in the SO2 flow rate alone might be more indicative of a change in feed composition. Thus, as the next step, we examine the use of the gas flow rate measurement as the other inferential variable along with the matte grade measurement. The simulated SO2 flow rate measurement was assumed to be taken every 5 min with no delay, while the matte grade measurements were used every 45 min with a constant 20 min delay. Figures 13 and 14 give a comparison of the adaptive estimator performance using only the matte grade measurement and that obtained using both the matte grade and SO2 flow rate measurements. Clearly, the estimator accuracy is improved with the addition of the gas flow measurement, especially in the period immediately after the disturbances in β. The estimator errors are reduced from about 1% to less than 0.5% when both measurements are used to infer grade.

120 Ind. Eng. Chem. Res., Vol. 36, No. 1, 1997

suggests that SO2 flow rate is a better measurement to use for inferring the matte grade. 4. Concluding Remarks

Figure 13. Comparison of matte grade estimators using matte grade measurements only (‚‚‚) and both matte grade and SO2 flow rate measurements (-‚-). (+ indicates simulated matte grade measurements.)

A more fundamental approach to modeling a copper smelter than that taken in our previous work led to the dynamic model described in section 2. A “pseudoequilibrium” assumption was made in which the smelting reactions are considered to occur very rapidly in comparison to the dynamics of the mixing of the system. The model performed well in tracking the dynamics of an industrial copper smelter and served as a basis for an inferential estimator of matte grade. The model is sensitive to changes in the feed composition, and so the percent copper in the feed β was chosen as the parameter to adapt in an extended Kalman filter algorithm. The estimator performed best when both the matte grade measurement and SO2 flow rate measurement were used as inferential variables. This greatly improved the estimator over one which uses only the matte grade measurement, particularly during the period immediately after the feed disturbances. This inferential estimator has the potential to serve as the basis for a reactor control strategy which would use the on-line matte grade estimate for feedback regulation. Acknowledgment The authors of this work acknowledge the support of the Natural Sciences and Engineering Research Council (NSERC) over the duration of this project. Appendix. Smelter Model

Figure 14. Adapted values of β for estimator using a single measurement (‚‚‚) and estimator using both measurements (-‚-) corresponding to the response in Figure 13 compared to step disturbances in the feed composition.

From Figure 14, we see that the addition of the second measurement allows changes in the input feed composition to be more closely tracked, which should be of considerable interest to the smelter operation. This is a promising result, which will have to be confirmed through experiments with actual industrial data when it becomes possible to monitor SO2 at the smelter. To quantify the sensitivity of SO2 concentration and flow rate measurements to changes in β, we computed the corresponding normalized steady state gains to be as follows:

SO2 concentration ) -1.79 ∆β and

SO2 flow rate ) -2.73 ∆β where the numerators are normalized on the basis of nominal values of concentration and flow rate, respectively. These values show that the SO2 flow rate is more sensitive to changes in β than is concentration. This

The system is composed of three phases: matte, slag, and off gas. The matte phase contains Cu2S and FeS; the slag phase contains FeO, Fe3O4, and SiO2; the off gas phase contains SO2, H2O, CO2, N2, S2, and O2. Mass balances for elements Cu, Fe, Si, O2, S, N2, C, and H2O are given by

d

∑j Fij dt(Mj) ) Qifeed - ∑l Ql∑j Fij

Mj

Mtot l

(A.1)

where subscript i denotes element, j denotes species, and l denotes phase. Mj is the mass of species j, Fij is the is the weight fraction of element i in species j, Mtot l is the total mass flow total mass of phase l, and Qfeed i rate of element i fed into the system and is calculated from known feed conditions. For Cu, Fe, and S

) cil + ci2γ + ci3β Qfeed i

(A.2)

where ciks are constants which depend on the ore composition. For the off gas, we assume

d (M ) ) 0 dt j

(A.3)

For the two reactions 4 and 5 which are at equilibrium, we use the following expressions for the equilib-

Ind. Eng. Chem. Res., Vol. 36, No. 1, 1997 121

rium constant taken from Nagamori and Mackey (1978a):

K1(T) )

x

aFeO aFeS

PS2

PO2

-30 640 + 5.05T ) -1.987T ln K1

K2(T) )

aFe3O4 3 aFeO xPO2

-96 200 + 40.59T ) -1.987T ln K2

(A.4) (A.5)

(A.6)

(A.7)

In addition, the following empirical relations from Nagamori and Mackey (1978a) and Michal and Schuhmann (1952) are used: 2 3 + 7.21XFeS aFeS ) 1.4999XFeS - 2.599XFeS

log aFeO )

300 - 0.59 T

(A.8) (A.9)

100XFe3O4 ) 2.6 + 29.7aFe3O4 (0.108 - 0.34aFe3O4)(T - 1523) (2.3 - 6.7aFe3O4)(T - 1523)2 × 10-4 (A.10) Xj )

Mj Mtot l

(A.11)

Furthermore, we consider that the slag is saturated with respect to Fe3O4, as reported by Nagamori and Mackey (1978a), i.e.

aFe3O4 ) 1

(A.12)

Finally, the off gases are assumed to exhibit ideal behavior, and the total gas pressure is taken to be 1 atm. Literature Cited Cain, S. L.; Budman, H. M.; Pritzker M. On line estimation of matte grade in a copper smelter. Can. J. Chem. Eng., in press. Czernecki, J.; Smieszek, Z.; Botor, J.; Sobierajski, S.; Miczkowski, Z. The choice and control of parameters of the direct smelting of copper concentrates in a flash furnace. In Process Control and Automation in Extractive Metallurgy; Partelpoeg, E. H., Himmesoete, D. C., Eds; TMS: Warrendale, PA, 1989. Davenport, W.; Partelpoeg, E. Flash Smelting. Analysis, Control and Optimization; Pergamon Press: Oxford, 1987. Gelb, A. Applied Optimal Estimation; MIT Press: Cambridge, MA, 1974. Goodwin, G. C.; Sin, K. S. Adaptive Filtering, Prediction and Control; Prentice Hall: Englewood Cliffs, NJ, 1984. Jo, J.; Bankoff, S. Digital monitoring and estimation of polymerization reactors. AIChE J. 1976, 22, 361. Kyto, S.; Makinen, J.; Saarhelo, K. On-line analyzer system of the feed mixture at the Outokompu Harjavalta copper smelter. In Process Control and Automation in Extractive Metallurgy; Partelpoeg, E. H., Himmesoete, D. C., Eds.; TMS: Warrendale, PA, 1989. Ljung, L. System IdentificationsTheory for the User; Prentice Hall: Englewood Cliffs, NJ, 1987. McAuley, K.; MacGregor, J. On-line inference of polymer properties in an industrial polyethylene reactor. AIChE J. 1991, 37, 825. Michal, E. ; Schuhmann, R. Thermodynamics of iron-silicate slags: Slags saturated with solid silica. Trans. Am. Inst. Min., Metall. Pet. Eng. 1952, 194, 723. Nagamori, M.; Mackey, P. Thermodynamics of copper matte converting: Part I. fundamentals of the noranda process. Metall. Trans. B 1978a, 9B, 255. Nagamori, M.; Mackey, P. Thermodynamics of copper matte converting: Part II. distribution of Au, Ag, Pb, Zn, Ni, Se, Te, Bi, Sb and As between copper, matte and slag in the noranda process. Metall. Trans. B 1978b, 9B, 567.

Received for review May 6, 1996 Revised manuscript received October 23, 1996 Accepted October 23, 1996X IE960254M X Abstract published in Advance ACS Abstracts, December 15, 1996.