Abstract:
A method and apparatus for inferring and controlling the temperature of a NO x  trap located downstream from a three-way catalyst that employs a temperature sensor to correct a temperature estimation model under relatively steady-state conditions to provide a more accurate estimate of NO x  trap temperature and three-way catalyst temperature. In a second embodiment, the three-way catalyst also includes a temperature sensor for improving the instantaneous catalyst temperature estimation.

Description:
TECHNICAL FIELD 
     This invention relates to vehicle emissions control and, more particularly, to a method and apparatus for correcting a temperature model of an exhaust passage including a catalytic converter and a NO x  (nitrogen oxides) trap using a temperature sensor for adaptive feedback control. 
     BACKGROUND ART 
     Conventional lean burn engine control systems include an air/fuel controller that delivers fuel to the engine intake manifold proportional to measured air mass to maintain a desired air/fuel ratio, lean of stoichiometric. The typical three-way catalytic converter provided in the engine exhaust passage does not convert the NO x  produced while running lean; and in order to reduce NO x  emission to the atmosphere, it has been proposed to locate a NO x  trap downstream of the three-way catalyst. A typical NO x  trap utilizes alkali metal or alkaline earth materials in combination with platinum in order to store or occlude NO x  under lean operating conditions. The mechanisms for NO x  storage involves the oxidation of NO to NO 2  over the platinum followed by the subsequent formation of a nitrate complex with the alkaline metal or alkaline earth. Under stoichiometric operation or operation rich of stoichiometric, the nitrate complexes are thermodynamically unstable, and the stored NO x  is released and catalytically reduced by the excess of CO, H 2 , and hydrocarbons (HCs) in the exhaust. Accordingly, the lean burn engine is periodically switched to a relatively rich air/fuel ratio to purge the NO x  trap. The NO x  trap must be exposed to a minimum threshold temperature before it will perform efficiently and, accordingly, a minimum exhaust temperature must be established before a lean burn mode of engine operation is established. There is also an upper or maximum temperature above which the trap may be degraded. 
     Over time, the NO x  trap becomes saturated with sulfur oxides (SO x ) and must be purged of the SO x  in order to be able to trap the NO x . One of the methods for purging the SO x  is to introduce air directly into the exhaust passage just upstream of the trap thereby raising the temperature of the trap and burning off the sulfur deposits. In order to purge the SO x , the NO x  trap must be heated using an air pump and engine A/F enrichment (so excess fuel burns in the trap). The temperature required for purging the trap is close to that at which the trap suffers degradation. It has been proposed to locate a temperature sensor at the trap to provide temperature information to the control system. While the sensor provides accurate information at steady-states, it is expensive and moreover is too slow for accurate control in transient driving. The sensor has a long time constant (approximately 15 seconds). In that amount of time, the NO x  trap may suffer damage. Further, the control system needs temperature information at several points in the exhaust system. It is too expensive to locate sensors at each location. 
     A method of estimating NO x  trap temperature is disclosed in copending application FMC 0778 PUS, filed concurrently with this application by the assignee of this application, and is incorporated herein by reference. While the open loop approach to modeling NO x  trap temperature disclosed in that application avoids the need for a sensor and is reasonably accurate, a more accurate NO x  trap temperature estimate is desirable. 
     SUMMARY OF THE INVENTION 
     In view of the above, it is an object of the present invention to provide a method and apparatus for inferring and controlling the temperature of a NO x  trap located downstream from a three-way catalyst. The trap employs a temperature sensor to correct the model under relatively steady-state conditions to provide a more accurate estimate of NO x  trap temperature. 
     In accordance with the present invention, a temperature sensor is added to improve temperature estimation accuracy. The problems of sensor time constant and need for multiple sensors are handled in the present invention by an adaptive temperature control scheme. The sensor is used to correct the model under relatively steady-state conditions and the corrected model is used under all conditions and all locations for various powertrain control functions including control of NO x  trap temperatures. 
     In a second embodiment of the invention, a temperature sensor is included to measure the temperature in the three-way converter. In this embodiment, the catalytic converter temperature sensor is used to correct inferred or estimated catalyst midbed temperature obtained through use of the temperature model. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     A more complete understanding of the present invention may be had from the following detailed description which should be read in conjunction with the drawings in which: 
     FIG. 1 is a block diagram of a vehicle engine and an electronic engine controller which embodies the principles of the invention; 
     FIGS. 2, 3 and 4 are high level flowcharts of conventional engine fuel control and NO x  purging schemes; 
     FIG. 5 is a flowchart of the NO x  trap temperature determining method of the present invention; 
     FIG. 6 is a flowchart of a air pump control valve control scheme based on NO x  trap temperature; 
     FIG. 7 is a block diagram showing another embodiment of the invention wherein the catalytic converter includes a temperature sensor; and 
     FIG. 8 is a flowchart modification of FIG. 5b, applicable to the embodiment of FIG. 7. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT 
     Referring now to the drawings, and initially to FIG. 1, a fuel pump 10 pumps fuel from a tank 12 through a fuel line 14 to a set of injectors 16 which inject fuel into an internal combustion engine 18. The fuel injectors 16 are of conventional design and are positioned to inject fuel into their associated cylinder in precise quantities as determined by an electronic engine controller (EEC) 20. The EEC 20 transmits a fuel injector signal to the injectors 16 via signal line 21 to maintain an air/fuel ratio determined by the EEC 20. The fuel tank 12 contains liquid fuels, such as gasoline, methanol or a combination of fuel types. An exhaust system 22, comprising one or more exhaust pipes and an exhaust flange 24, transports exhaust gas produced from combustion of an air/fuel mixture in the engine to a conventional three way catalytic converter 26. The converter 26, contains a catalyst material 28 that chemically alters exhaust gas that is produced by the engine to generate a catalyzed exhaust gas. 
     The catalyzed exhaust gas is fed to a downstream NO x  trap 30 composed of material of the type previously described. The trap 30 is contained in a housing generally indicated at 31. The NO x  trap is shown as comprising two spaced apart portions or &#34;bricks&#34; 30a and 30b. Located in the space between the two bricks is a temperature sensor 32 for monitoring the temperature of the NO x  trap and communicating with the EEC 20 over conductor 33. The sensor 32 provides an accurate measurement of the temperature of the trap during steady-state condition but has a time constant of about 15 minutes during which time measurement data is relatively inaccurate. A heated exhaust gas oxygen (HEGO) sensor 34, detects the oxygen content of the exhaust gas generated by the engine 18, and transmits a signal over conductor 36 to the EEC 20. A pair of HEGO sensor 38 and 40 are located upstream and downstream respectively of the trap 30, and provide signals to the EEC 20 over conductors 42 and 44 respectively. Still other sensors, indicated generally at 46, provide additional information about engine performance to the EEC 20, such as crankshaft position, angular velocity, throttle position, air temperature, etc. The information from these sensors is used by the EEC 20 to control engine operation. 
     A mass air flow sensor 50 positioned at the air intake of engine 18 detects the amount of air inducted into an induction system of the engine and supplies an air flow signal over conductor 52 to the EEC 20. The air flow signal is utilized by EEC 20 to calculate a value termed air mass (AM) which is indicative of a mass of air flowing into the induction system in lbs./min. 
     An air pump 54, which may be electrically powered or mechanically coupled to the engine 18 provides a pressurized source of air from the atmosphere, for injecting air through an air passage 58 into an exhaust passage portion 60 at a pierce point 62 downstream of the catalytic converter 26 and generally at the entrance of the NO x  trap 30. The amount of air injected depends on the positioning of a control valve 56 under the control of EEC 20 over conductor 64. The control valve 56 may be ON/OFF valve which opens and closes in accordance with a control signal or may be a flow control valve which can adjust flow rate continuously. 
     The EEC 20 comprises a microcomputer including a central processor unit (CPU) 70, input and output (I/O) ports 72, read only memory (ROM) 74 for storing control programs, random access memory (RAM) 76, for temporary data storage which may also be used for counters or timers, and keep-alive memory (KAM) 78 for storing learned values. Data is communicated over a conventional data bus as shown. The EEC 20 also includes an engine off timer that provides a record of the elapsed time since the engine was last turned off as a variable &#34;soaktime&#34;. 
     The liquid fuel delivery routine executed by controller 20 for controlling engine 18 is shown in the flowchart of FIG. 2. An open loop calculation of desired liquid fuel is calculated at block 100. More specifically, the measurement of inducted mass airflow (MAF) from sensor 34 is divided by a desired air/fuel ratio (AFd) which in this example, is correlated with stoichiometric combustion. At decision block 102 a determination is made whether closed loop feedback control is desired, by monitoring engine operating parameters such as engine coolant temperature. Fuel command or desired fuel signal Fd is generated by dividing feedback variable FV, read at block 104, into the previously generated open loop calculation of desired fuel in block 106. Desired fuel signal Fd is then converted to a pulse width signal fpw at block 108 for actuating fuel injector 16, thereby delivering fuel to engine 18 in relation to the magnitude of the desired fuel signal Fd. 
     The air/fuel feedback routine executed by controller 20 to generate fuel feedback variable FV is shown in the flowchart in FIG. 3. Under closed loop control as determined at block 110, a two-state signal EGOS is generated at block 112 from the signal provided by the sensor 34. Predetermined proportional tern Pj is subtracted from feedback variable FV at block 114 when the signal EGOS is low, but was high during the previous background loop of controller 20 as determined at decision blocks 116 and 118. When signal ECOS is low and was also low during the previous background loop predetermined integral term Δj, is subtracted from feedback variable FV at block 120. 
     On the other hand, when signal EGOS is high and was also high during the previous background loop of controller 20, as determined at decision blocks 116 and 122, integral term Δi is added to feedback variable FV at block 124. When signal EGOS is high but was low during the previous background loop proportional term Pi is added to feedback variable FV at block 126. 
     Referring now to FIG. 4, the lean cruise mode of engine operation is depicted. In general, during the lean cruise mode, air/fuel operation proceeds open loop at a predetermined value such as 19 lb air/lb fuel for enhanced fuel economy. NO x  trapping material 32 will store nitrogen oxides passing through catalytic converter 26. Periodically, the material 32 must be purged of stored nitrogen oxides by operating the engine at an air/fuel ratio rich of stoichiometric. Lean cruise operating conditions such as vehicle speed being above a predetermined value or throttle position being above a predetermined value are checked at block 150. Lean cruise operation will commence unless the material 32 is near its capacity and should be purged as determined at block 152. Should that be the case, feedback variable FV is generated at block 154 as provided in a closed loop stoichiometric air/fuel ratio or in an open loop air/fuel ratio rich of stoichiometric. Purging of the NO x  trap may continue for a variable time internal until the trap is relatively free of NO x . Various procedures have been proposed for determining when to terminate purge as well as when to initiate a SO x  purge of the trap. See for example, copending application Ser. No. 08/733,079, filed Oct. 16, 1996, and assigned to the assignee of the present invention. 
     On the other hand, if purge conditions are not present, the routine continues for lean cruise conditions. Engine rpm and load are read at block 156, closed loop air/fuel control is disabled at block 158, and feedback variable FV is generated in an open loop manner to provide lean air/fuel engine operation. More specifically, at block 160 in this particular example, feedback variable FV is generated by reading a look-up table value as a function of engine speed and load and multiplying the table value by a multiplier LMULT. The resulting product is then added to unity which is the stoichiometric air/fuel reference. Multiplier LMULT, which varies between 0 and unity, is gradually incremented to ramp engine air/fuel operation to a desired lean air/fuel ratio. Feedback variable FV is thereby generated which is an indication of desired air/fuel air ratio. 
     The operations of running lean followed by a NO x  purge operation continue as long as the efficiency of the trap remains above a desired efficiency. As the efficiency decreases, the lean cruise time may be reduced in order to purge the trap more frequently. It is known, however, that sulfur in the fuel will contaminate the NO x  trap with sulfur oxides (SO x ) and if not removed will render the NO x  trap incapable of performing the NO x  trapping function. If the efficiency of the trap requires purging more frequently than a predetermined time interval, it may indicate that a SO x  purge is needed. A SO x  purge requires passing exhaust gases over the trap at a higher temperature than that necessary for NO x  purging. To achieve the higher temperature, additional air is introduced from the air pump 54, under control of the controller 20, at the pierce point 62 near the entrance area of the trap 30 and just downstream of the location generally indicated at &#34;B&#34; in FIG. 1. 
     Referring now to FIG. 5, a flowchart depicting the steps in a routine performed by the EEC 20 for inferring NO x  trap temperature is shown. The temperature determination routine is entered at 200 and at 202 an initialization flag EXT --  INIT is checked to determine if certain temperature variables have been initialized. If not, the temperature variables are initialized at 204, after which the flag EXT --  INIT is set to 1. A preferred embodiment advantageously initializes certain temperature variables in a manner to account for instances where an engine may be turned off for short periods of time in which the NO x  trap 30 may not have cooled to ambient temperature. NO x  trap over temperature conditions are accordingly avoided by estimating NO x  trap temperature upon engine ignition as a function of estimated NO x  trap temperature upon engine shutoff, ambient temperature, a calibratable time constant indicative of NO x  trap cooling and the time elapsed from engine shutoff to subsequent engine operation. The initialization of the temperature at locations &#34;B&#34;, &#34;C&#34; and &#34;D&#34; is accomplished in accordance with the following Equations 1, 2 and 3. 
     
         ext.sub.-- ntB.sub.-- init=((ext.sub.-- ntB.sub.-- prev-infamb)*fnexp(-soaktime/tc.sub.-- ntB))+infamb       (1) 
    
     
         ext.sub.-- ntC.sub.-- init=((ext.sub.-- ntC.sub.-- prev-infamb)*fnexp(-soaktime/tc.sub.-- ntC))+infamb       (2) 
    
     
         ext.sub.-- tso=ext.sub.-- ntD.sub.-- init=ext.sub.-- ntC.sub.-- init(3) 
    
     where: 
     ext --  ntB --  prev=estimated NO x  trap temperature when engine was turned off, 
     fnexp is a look-up table value that approximates an exponential function, 
     soaktime=time since engine was shut down in seconds, 
     tc --  nt=an empirically derived time constant associated with the cooling off of the exhaust gas at an identified location such as &#34;B&#34;, in seconds, 
     infamb=inferred ambient temperature, and 
     ext --  tso=estimated temperature at temperature sensor location &#34;D&#34;. 
     Ambient temperature may be inferred as indicated above or measured with a sensor. When ambient temperature is inferred (infamb) the value is stored keep-alive memory 78 and is initialized at block 204. If the absolute difference between air charge temperature (ACT) and engine coolant temperature (ECT) is within a calibratable tolerance, usually about 6 degrees, it may be assumed that the engine is at equilibrium or ambient temperature and therefore that ambient temperature is equal to ACT. Otherwise, ambient temperature is assumed to be smaller of the last known ambient temperature in K --  AM 78 or ACT. 
     If the engine is running and if engine coolant temperature and vehicle speed are above minimum values, then a steady-state forcing function is calculated as ACT-Δ, where A is about 10 degrees F. if the air conditioning clutch is not engaged and is about 20 degrees F. if the air conditioning clutch is engaged. Normally, the forcing function is filtered by a rolling average but if ACT is ever less than inferred ambient then infamb is set to ACT immediately. 
     At block 210, the instantaneous midbed (usually 1&#34; into the first brick) temperature of the catalytic converter 26 is calculated in accordance with the disclosure in U.S. Pat. No. 5,414,994, assigned to the assignee of the present invention and incorporated herein by reference. At block 211, the midbed temperature calculated in block 210 is corrected by adding an adaptive temperature correction value as a function of air mass. Preferably, three (3) correction values are stored in KAM 78 for three (3) different ranges of engine air mass. The appropriate correction value is accessed based on measured air mass. The correction values are adaptively learned during vehicle operation under relatively steady-state conditions, as will be described more fully hereinafter, and are stored in KAM 78 for use at the program step performed in block 211. 
     At block 212, the temperature loss in the exhaust passage between the midbed of the catalytic converter 26 and the entrance &#34;B&#34; to the NO x  trap 30 is calculated in accordance with Equation 4. 
     
         ext.sub.-- ls.sub.-- ntB=FNLS.sub.-- NTB(am)* (ext.sub.-- cmd+ext.sub.-- ntB.sub.-- prev)/2-infamb!                                (4) 
    
     where: 
     FNLS --  NTB(am) is a unitless value, contained in a table indexed by mass air flow (am), which is indicative of a temperature drop between the catalytic converter and location &#34;B&#34; as a function of (am), 
     ext --  cmd=instantaneous converter catalyst midbed temperature calculated in block 210, and 
     ext --  ntB --  prev=value of ext --  ntB for the previous loop. 
     At block 214 the steady-state NO x  trap inlet temperature at location &#34;B&#34; is calculated, in accordance with Equation 5. 
     
         ext.sub.-- ss.sub.-- ntB=ext.sub.-- cmd-ext.sub.-- ls.sub.-- ntB(5) 
    
     This is the exhaust gas temperature before the pierce point 62 of the air passage 58, which is just upstream of the entrance of the NO x  trap 30. This temperature is determined by subtracting the temperature loss, calculated at block 212, from the corrected catalyst midbed temperature, calculated at block 211. 
     At block 216, the time constant of the temperature rise at the trap inlet is a function of air mass flow and is evaluated in accordance with Equation 6. 
     
         tc.sub.-- ntB.sub.-- run=FNTC.sub.-- NTB(am)               (6) 
    
     where: 
     FNTC --  NTB(am)=ROM calibration data table value of time constant, in seconds, indexed by air mass. 
     At block 218, a filter constant that perform an exponential smoothing function, is calculated from the time constant determined at block 216 in accordance with Equation 7. 
     
         fk.sub.-- ntB=1/(1+tc.sub.-- ntB.sub.-- run/bg.sub.-- tmr) (7) 
    
     where: 
     bg --  tmr is the time, in seconds, for execution of the background loop. 
     At block 220, the instantaneous NO x  trap inlet temperature at location &#34;B&#34; is calculated in accordance with Equation 8, based on the previous instantaneous value at &#34;B&#34;, the new estimated steady-state value, and a predetermined temperature rate of change at &#34;B&#34; as a function of engine air mass flow. 
     
         ext.sub.-- ntB=fk.sub.-- ntB*ext.sub.-- ss.sub.-- ntB+(1-fk.sub.-- ntB)*ext.sub.-- ntB.sub.-- prev                           (8) 
    
     where: 
     ext --  ntB --  prev=previous value of inlet temperature. 
     The temperature at the front face &#34;C&#34; of the material 32, is the total heat flow divided by the heat capacity of the exhaust flow, overlooking for the moment the effect on this temperature of the exothermic reaction of the exhaust gas with the trap material. At block 222, this total heat flow is calculated in accordance with Equation 9. ##EQU1## where: 
     EXT -  CP --  FUEL2=heat capacity of fuel and is a calibration constant, 
     EXT -  CP AIR2=heat capacity of air and is a calibration constant, 
     airpump --  am=air pump air mass flow in kg/min 
     am=engine air mass flow (kg/min) 
     fuel flow=engine fuel flow (kg/min). 
     The heat capacity of this total heat flow is calculated in accordance with Equation 10, at block 224. ##EQU2## As previously stated, the temperature at the front face &#34;C&#34; of the trap material 32, before exotherm is the total heat flow calculated at block 222 divided by the heat capacity of the heat flow calculated at block 224, and is calculated at block 226 in accordance with Equation 11. 
     
         ext.sub.-- ntC.sub.-- before.sub.-- exo=tot.sub.-- heat.sub.-- flw/exh.sub.-- ht.sub.-- cap                              (11) 
    
     The exotherm energy calculation depends on whether the air/fuel ratio at the entrance to the NO x  trap 30 is rich or lean as calculated at block 228. The exhaust air/fuel ratio at the entrance to the NO x  trap 30 is calculated in accordance with Equation 12. 
     
         lambse.sub.-- ntr=lambse.sub.-- exh*((airpump.sub.-- am+am)/am)(12) 
    
     where: 
     lambse --  exh is the exhaust A/F equivalence ratio measured before the air from the air pump is introduced in the exhaust. 
     If the A/F is rich, the exotherm energy is limited by and proportional to the amount of air pump air mass. Once all of the excess air is burned, additional rich products (hydrocarbons) cannot burn or produce further heat. If rich, as determined at block 230, the exotherm energy is calculated in accordance with Equation 13, as indicated at block 232. 
     
         ntr.sub.-- exo.sub.-- energy=airpump.sub.-- am*FN.sub.-- NTR.sub.-- EXO.sub.-- R (lambda.sub.-- ntr)                          (13) 
    
     where: 
     FN --  NTR --  EXO --  R(lambda --  ntr) is a value obtained from a look-up table that contains empirical data describing the exotherm energy. The units are joules per pound of air pump air mass and is mapped against the exhaust A/F. 
     If the air/fuel ratio is lean, then exotherm energy is calculated in block 234 in accordance with Equation 14. When lean, the exotherm energy is limited by and proportional to the engine air mass which at a given equivalence ratio is proportional to fuel mass or heat energy. 
     
         ntr.sub.-- exo.sub.-- energy=(am)*FN.sub.-- NTR.sub.-- EXO.sub.-- L(lambse.sub.-- ntr)                                      (14) 
    
     where: 
     FN --  NTR --  EXO --  L(lambse --  ntr) is a value obtained from a look-up table that contains empirical data describing the exotherm energy. The units are joules per pound of air pump air mass and is mapped against the exhaust A/F. 
     In either event, if the air pump 54 is ON, as determined in block 235, an adaptive exotherm correction term, apx --  cor --  tmp, discussed hereinafter, is read from KAM 78 at block 236 and added to the calculation of exotherm temperature at block 238 in accordance with Equation 15. Preferably, three (3) correction values are stored in KAM 78 for three (3) different ranges of engine air mass and the appropriate correction value is accessed based on measured air mass. The exotherm temperature is the exotherm energy calculated in Equations 13 or 14 divided by the heat capacity calculated in Equation 10. 
     
         ext.sub.-- ntr.sub.-- exo=ntr.sub.-- exo.sub.-- energy/exh.sub.-- ht.sub.-- cap+apx.sub.-- cor.sub.-- tmp                             (15) 
    
     If the air pump 54 is OFF, then the adaptive correction term, apx --  cor --  tmp, is set to 0 at block 237. 
     The forcing function or steady-state equivalent of the temperature near the front face of the NO x  trapping material 32, indicated at &#34;C&#34;, is calculated in block 239 in accordance with Equation 16, and is the combined temperature due to the gas temperature and the air pump induced exotherm. The air pump pierce point 62 is close enough to the NO x  trap 30 to ignore a temperature drop from &#34;B&#34; to &#34;C&#34; 
     
         ext.sub.-- ss.sub.-- ntC=ext.sub.-- ntC.sub.-- before.sub.-- exo+ext.sub.-- ntr.sub.-- exo                                            (16) 
    
     The time constant of the temperature rise near the front face &#34;C&#34; of the trap 30 is a calibratable function of the total airflow and is evaluated at block 240 in accordance with Equation 17. 
     
         tc.sub.-- ntC run=FNTC.sub.-- NTC(am+airpump.sub.-- am)    (17) 
    
     where: 
     FNTC --  NTC=ROM calibration data table value of time constant, in seconds, indexed by total air mass. 
     At block 241, a filter constant for performing a smoothing function is calculated in accordance with Equation 18 based on the time constant, evaluated in accordance with Equation 17. 
     
         fk.sub.-- ntC=1/(1+tc.sub.-- ntC.sub.-- run/bg.sub.-- tmr) (18) 
    
     Finally, at block 242, the instantaneous temperature near the front face &#34;C&#34; of the trap 30 is calculated in accordance with Equation 19 from the previous value, new steady-state value, and the filter constant. 
     
         ext.sub.-- ntC=fk.sub.-- ntC*ext.sub.-- ss.sub.-- ntC+(1-fk.sub.-- ntC)*ext.sub.-- ntC.sub.-- prev                           (19) 
    
     where: 
     ext --  ntC --  prev=the value of ext --  ntC calculated on the previous loop. 
     At blocks 244 through 248, a temperature which is more representative of an average temperature of the trap 30 is calculated. At block 244, the steady-state average temperature of the trap 30 is calculated in accordance with Equation 20, which is based on the assumption that there is no temperature drop from the location &#34;C&#34; to the location &#34;D&#34; and therefore at steady-state the two temperatures are equal. 
     
         ext.sub.-- ss.sub.-- ntD=ext.sub.-- ntC                    (20) 
    
     There is a time constant as a function of air mass which causes the temperature at location &#34;D&#34; to lag the temperature at location &#34;C&#34;. This time constant is due to the thermal capacitance of the trap substrate and trap material. At block 246, the time constant at location &#34;D&#34; in the trap is evaluated in accordance with Equation 21. This time constant is a function of the total air flow. 
     
         tc.sub.-- ntD.sub.-- run=FNTC.sub.-- NTD(am+airpump.sub.-- am)(21) 
    
     A filter constant is calculated at block 248 from the time constant in accordance with Equation 22. 
     
         fk.sub.-- ntD=1/(1+tc.sub.-- ntD.sub.-- run/bg.sub.-- tmr) (22) 
    
     Finally, the instantaneous average temperature of the trap 30 is calculated at block 250 in accordance with Equation 23 from the previous value, new steady-state value, and the filter constant. 
     
         ext.sub.-- ntD=fk.sub.-- ntD*ext.sub.-- ss.sub.-- ntD+(1-fk.sub.-- ntD)*ext.sub.-- ntD.sub.-- prev                           (23) 
    
     At block 252 an estimate of what the temperature sensor 32 should be reading is calculated. The estimated average substrate temperature of the NO x  trap determined at block 250, is an estimate of the instantaneous temperature at the location of the temperature sensor 32, assuming no steady-state temperature drop between location &#34;D&#34; and the sensor location. This equality is indicated in Equation 24. 
     
         ext.sub.-- ss.sub.-- tso=ext.sub.-- ntD;                   (24) 
    
     The actual reading of the sensor 32 is delayed from this value due to its thermal mass. In order to create an estimate of what the sensor 32 will read during transient conditions, the estimated temperature is adjusted by a time constant related to the sensor 32 as indicated in Equation 25. 
     
         ext.sub.-- tso=fk.sub.-- tso*ext.sub.-- ss.sub.-- tso+(1-fk.sub.-- tso)*ext.sub.-- tso.sub.-- prev                           (25) 
    
     where: 
     ext --  tso --  prev=previous estimated sensor reading, 
     tc --  tso --  run=FNTC --  TSO(am+airpump --  am)=ROM calibration data table value of time constant, in seconds, indexed by total air mass, and 
     fk --  tso=1/(1-tc --  tso --  run/bg --  tmr)=filter constant of the sensor. 
     At block 254, the error between the estimated sensor output (exh --  tso) and the actual sensor output (tso act) is calculated in accordance with Equation 26. 
     
         ext.sub.-- err.sub.-- tso=ext.sub.-- tso-tso.sub.-- act;   (26) 
    
     At block 256, a determination is made whether relatively steady-state conditions are present, and adaptive learning can proceed. Such conditions are present if (a) the absolute value of the difference between the steady-state estimate of the output of sensor 32 and the instantaneous estimate is less than a calibratable tolerance value TSO --  ADP --  TOL, as indicated in Equation 27, and (b) the instantaneous estimate of the temperature measured by the sensor 33 is greater than a predetermined minimum temperature value TSO --  ADP --  MIN as indicated in Equation 28. 
     
         abs(ext.sub.-- ss.sub.-- tso.sub.-- ext.sub.-- tso)&lt;TSO.sub.-- ADP.sub.-- TOL                                                       (27) 
    
     
         ext.sub.-- tso&gt;TSO.sub.-- ADP.sub.-- MIN                   (28) 
    
     If the conditions of Equations 27 and 28 are met and the air pump 54 is ON, as determined at decision block 258, then a term for correcting the temperature due to air pump exotherm is learned at block 260. The correction term is a rolling average of the error between the estimated and actual sensor readings and is stored in KAM 78. The procedure for learning the adaptive corrections at a given air mass is as follows. Assume that TSO --  ADP --  AM1, TSO --  ADP --  AM2, and TSO --  ADP --  AM3 are three (3) calibratable air mass levels which define three regions where three adaptive coefficients will be learned. If the present measured air mass value&lt;am) is less than TSO --  ADP --  AM1, then the adaptive exotherm correction term that is learned is expressed by Equation 29. 
     
         apx.sub.-- cor1=fk.sub.-- apx.sub.-- cor1*ext.sub.-- err.sub.-- tso+(1-fx.sub.-- apx.sub.-- cor1)*apx.sub.-- cor1.sub.-- prev(29) 
    
     where: 
     fk --  apx --  cor1=1/(1+tc --  APX --  COR1/bg --  tmr) 
     tc --  APX --  COR1=the time constant controlling the desired rate of adaptive learning, 
     fk --  apx --  cor1=the filter constant equivalent of the time constant, 
     apx --  cor1 --  prev=previous adaptive correction term. 
     Similarly, if the present measured air mass value (am) is between TSO --  ADP --  AM1 and TSO --  ADP --  AM2, then the adaptive exotherm correction term that is learned is expressed by Equation 30. 
     
         apx.sub.-- cor2=fk.sub.-- apx.sub.-- cor2*ext.sub.-- err.sub.-- tso+(1-fx.sub.-- apx.sub.-- cor2)*apx.sub.-- cor2.sub.-- prev(30) 
    
     Finally, if the present measured air mass value (am) is between TSO --  ADP --  AM2 and TSO --  ADP --  AM3, then the adaptive exotherm correction term that is learned is expressed by Equation 31. 
     
         apx.sub.-- cor3=fk.sub.-- apx.sub.-- cor3*ext.sub.-- err.sub.-- tso+(1-fx.sub.-- apx.sub.-- cor3)*apx.sub.-- cor3.sub.-- prev(31) 
    
     The values of apx --  cor1, apx --  cor2, apx --  cor3 are stored in KAM 78. 
     As indicated previously, the calculation of exotherm temperature at block 238 includes the adaptive correction term learned at block 260 as indicated in Equation 15. 
     If the conditions of Equations 27 and 28 are met and the air pump 54 is OFF as determined at decision block 258, then an adaptive converter midbed temperature correction term is learned at block 262. The correction term is a rolling average of the error between the estimated and actual sensor readings and is stored in KAM 78. The procedure for learning the adaptive corrections at a given air mass is as follows. If the present measured air mass value (am) is less than TSO --  ADP --  AM1, then the adaptive converter midbed correction term that is learned is expressed by Equation 32. 
     
         cmd.sub.-- cor1=fk.sub.-- cmd.sub.-- cor1*ext.sub.-- err.sub.-- tso+(1-fx.sub.-- cmd.sub.-- cor1)*cmd.sub.-- cor1.sub.-- prev(32) 
    
     where: 
     fk --  cmd --  cor1=1/(1+tc --  CMD --  COR1/bg --  tmr) 
     Similarly, if the present measured air mass value (am) is between TSO --  ADP --  AM1 and TSO --  ADP --  AM2, then the adaptive converter midbed correction term that is learned is expressed by Equation 33. 
     
         cmd.sub.-- cor2=fk.sub.-- cmd.sub.-- cor2*ext.sub.-- err.sub.-- tso+(1-fx.sub.-- cmd.sub.-- cor2)*cmd.sub.-- cor2.sub.-- prev(33) 
    
     where: 
     fk --  cmd --  cor2=1/(1+tc --  CMD --  COR2/bg --  tmr) 
     Finally, if the present measured air mass value(am) is between TSO --  ADP --  AM2 and TSO --  ADP --  AM3, then the adaptive converter midbed correction term that is learned is expressed by Equation 34. 
     
         cmd.sub.-- cor3=fk.sub.-- cmd.sub.-- cor3*ext.sub.-- err.sub.-- tso+(1-fx.sub.-- cmd.sub.-- cor3)*cmd.sub.-- cor3.sub.-- prev(34) 
    
     where: 
     fk --  cmd --  cor3=1/(1+tc --  CMD --  COR3/bg --  tmr) 
     The values of cmd --  cor1, cmd --  cor2, cmd --  cor3 are stored in KAM 78. 
     The calculation of the midbed temperature of the catalytic converter catalyst made at block 210 is corrected, on the next background loop, in block 211 by one of the three (3) correction terms, depending on measured air mass, in accordance with Equation 35. 
     
         ext.sub.-- cmd=current.sub.-- calculation+cmd.sub.-- cor   (35) 
    
     where: 
     cmd --  cor=cmd --  cor1, cmd --  cor2 or cmd --  cor3 depending on air mass (am), 
     current --  calculation=calculation made at block 210. 
     Knowing the temperature of the NO x  trap permits various control schemes. One scheme is to disable the lean open loop operation and enter a closed loop stoichiometric operation if the estimated temperature is greater than a predetermined maximum temperature. If the temperature remains too high during stoichiometric operation, a rich open loop mode of operation may be invoked. Another use is the control of the air pump control valve 56 in accordance with the flowchart shown in FIG. 6. The routine shown in FIG. 6 is entered at 260 and at decision block 262 the status of the air pump flag AIR --  PMP --  FLG is checked. If the flag is set, indicating that the air pump is ON, then the trap temperature at location &#34;C&#34; of the NO x  trap is compared with a maximum temperature above which the trap is subject to irreversible damage. If the maximum temperature is exceeded, as determined by block 264, then the air pump is turned off at block 266 and the flag AIR --  PMP --  FLG is reset and the routine returns to the main program. On the other hand, if the pump is not ON and a sulphur purge of the NO x  trap is required as determined by the block 268, then the trap temperature at location &#34;D&#34; is checked at block 270 to determine if the temperature is less than the minimum temperature required for SO x  purging. If so, the air pump is turned ON at block 272 in order to raise the NO x  trap temperature and the flag AIR --  PMP --  FLG is set and the routine returns to the main program. 
     Referring now to FIG. 7, another embodiment of the invention is disclosed wherein like elements of FIG. 1 are identified by like numerals. FIG. 7 differs from FIG. 1 in that the catalytic converter 26 is also provided with a temperature sensor 282 that communicates with the EEC 20 over conductor 284. With the sensor 282 provided, the sensor 32 in the trap 31 is no longer needed to correct the catalyst midbed temperature. Instead, the routine of FIGS. 5a-5b would be modified beginning at block 252 as shown in FIG. 8. The temperature sensed by both the sensor 32 and 282 will be estimated at block 252&#39;. It is assumed that no steady-state temperature drop exist between the midbed location and the sensor 282 location. This equality is indicated in Equation 36. 
     
         ext.sub.-- ss.sub.-- tso=ext.sub.-- cmd;                   (36) 
    
     The actual reading of the sensor 282 is delayed from this value due to its thermal mass. In order to create an estimate of what the sensor 282 will read during transient conditions, the estimated temperature is adjusted by a time constant related to the sensor 282 as indicated in Equation 25. 
     If relatively steady-state conditions are present, as determined in block 256&#39; based on Equations 27 and 28 then adaptive learning proceeds for the midbed correction term in block 262&#39;. The adaptive learning is carried out as previously described using Equations 32-34 and the error calculated in block 254&#39; with respect to the sensor 282. 
     If the air pump is ON as determined by block 258&#39;, then the correction term for exotherm is learned at block 260&#39; as previously described in connection with block 260. Otherwise, the routine returns to the main program. 
     The calculation of the midbed temperature of the catalytic converter catalyst made at block 210 is corrected, on the next background loop, by one of the three (3 correction terms learned in block 262&#39;. 
     While the best mode for carrying out the present invention has been described in detail, those familiar with the art to which this invention relates will recognize various alternative designs and embodiments for practicing the invention as defined by the following claims.