Patent Publication Number: US-9835094-B2

Title: Feed forward exhaust throttle and wastegate control for an engine

Description:
BACKGROUND 
     This disclosure relates to controlling an engine. 
     SUMMARY 
     Diesel engines sometimes use exhaust throttles to regulate exhaust temperature by modifying the fuel-to-air (“F/A”) ratio as well as engine pumping work. For example, an exhaust throttle is used to control the temperature of exhaust gasses going to an engine after-treatment system. Exhaust throttle control can incorporate various protections to prevent high intake manifold pressure, high cylinder pressure, high exhaust manifold pressure, and high turbine speed. Previously, exhaust throttle and exhaust gas temperature control was achieved using a combination of open loop setpoint tables and proportional-integral-derivative (“PID”) controllers. Operational constraints were controlled by separate PID controllers and subsequent arbitration of valve position commands. Due to the dynamics of such systems, PID based control is relatively slow and unresponsive to dynamic or transient operating conditions. 
     This disclosure replaces the open loop setpoint tables and PID controls with a physics-based feed forward system that provides improved response under transient conditions, prioritizes control objectives, accounts for system constraints, and is easier to calibrate than existing systems. The disclosure employs an air system state observer for an engine to estimate parameters that are not and/or cannot be measured directly. Sensor information is also used to make corrections to an engine observer model. The models and corrections from the air system state observer are used in feed forward calculations to determine the desired exhaust throttle position, a desired wastegate valve position, and a desired exhaust gas recirculation (“EGR”) valve position that achieve desired performance objectives. Feed forward control with this method provides fast and accurate control of the engine within the constraints of the system. The air system state observer is a model of the engine air system that runs in a controller or engine control unit (“ECU”) in substantially real time and receives the same actuator commands as the real engine. Differences between measured engine states and estimated engine states are used with an observer controller to make corrections to the engine observer model. Information from the engine observer model and model corrections from the observer controller are used in feed forward calculations to determine the desired exhaust throttle valve position, wastegate valve position, and EGR valve position. The air system state observer eliminates the need for various prior control loops and provides more robust engine control. The feed forward calculations include engine cylinder models, EGR cooler and valve models, EGR mixer models, compressor and charge air cooler (“CAC”) models, turbine and wastegate models, and exhaust throttle models. As a result, this disclosure improves engine control under transient conditions, improves operation in corner conditions (i.e., extreme operational conditions), limits control to stay within constraints, and is easier to calibrate. 
     In one embodiment, this disclosure provides a method of controlling exhaust gas temperature for an engine. The engine includes an air system having an exhaust throttle valve. The method includes receiving a parameter setpoint command at an inverse engine model, monitoring parameters of the engine using a plurality of sensors, receiving measured engine states based on the monitored engine parameters from the plurality of sensors, and generating measured engine state estimates and controlled engine state estimates using an engine observer model. The controlled engine state estimates are received by the inverse engine model. The method also includes determining an observer error based on a difference between the measured engine states and the measured engine state estimates and generating model corrections based on the observer error. The model corrections are received by the inverse engine model. The method also includes generating a desired exhaust throttle valve position using the inverse engine model based on the parameter setpoint command, the controlled engine state estimates, and the model corrections, and adjusting a position of the exhaust throttle valve based on the desired exhaust throttle position. 
     In another embodiment, this disclosure provides a system for controlling exhaust gas temperature. The system includes an engine, a plurality of sensors, and an electronic control unit. The engine includes an air system and an exhaust throttle valve. The plurality of sensors are used to monitor parameters of the engine. The electronic control unit includes a processor and a memory. The electronic control unit is operable to receive a parameter setpoint command at an inverse engine model, monitor parameters of the engine using the plurality of sensors, receive measured engine states based on the monitored engine parameters from the plurality of sensors, and generate measured engine state estimates and controlled engine state estimates using an engine observer model. The controlled engine state estimates are received by the inverse engine model. The electronic control unit is also operable to determine an observer error based on a difference between the measured engine states and the measured engine state estimates and generate model corrections based on the observer error. The model corrections are received by the inverse engine model. The electronic control unit is also operable to generate a desired exhaust throttle valve position using the inverse engine model based on the parameter setpoint command, the controlled engine state estimates, and the model corrections, and adjust a position of the exhaust throttle valve based on the desired exhaust throttle position. 
     Before any embodiments are explained in detail, it is to be understood that the disclosure is not limited in its application to the details of the configuration and arrangement of components set forth in the following description or illustrated in the accompanying drawings. This disclosure is capable of other embodiments and of being practiced or of being carried out in various ways. Also, it is to be understood that the phraseology and terminology used herein are for the purpose of description and should not be regarded as limiting. The use of “including,” “comprising,” or “having” and variations thereof herein are meant to encompass the items listed thereafter and equivalents thereof as well as additional items. Unless specified or limited otherwise, the terms “mounted,” “connected,” “supported,” and “coupled” and variations thereof are used broadly and encompass both direct and indirect mountings, connections, supports, and couplings. 
     In addition, it should be understood that embodiments of the disclosure may include hardware, software, and electronic components or modules that, for purposes of discussion, may be illustrated and described as if the majority of the components were implemented solely in hardware. However, one of ordinary skill in the art, and based on a reading of this detailed description, would recognize that, in at least one embodiment, the electronic based aspects of the disclosure may be implemented in software (e.g., stored on non-transitory computer-readable medium) executable by one or more processing units, such as a microprocessor and/or application specific integrated circuits (“ASICs”). As such, it should be noted that a plurality of hardware and software based devices, as well as a plurality of different structural components may be utilized. For example, “servers” and “computing devices” described in the specification can include one or more processing units, one or more computer-readable medium modules, one or more input/output interfaces, and various connections (e.g., a system bus) connecting the components. 
     Other aspects of the disclosure will become apparent by consideration of the detailed description and accompanying drawings. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         FIG. 1  illustrates a vehicle including an engine. 
         FIG. 2  illustrates a control system for the vehicle of  FIG. 1 . 
         FIG. 3  illustrates an engine control system that includes proportional integral derivative (“PID”) controllers and output control arbitration. 
         FIG. 4  illustrates an engine control system that includes an air system state observer and control system. 
         FIG. 5  illustrates a generalized state observer. 
         FIG. 6  is an engine air system schematic diagram. 
         FIG. 7  illustrates an air system state observer and control system. 
         FIG. 8  illustrates an inverse engine model and control system. 
         FIG. 9  is an iterative searching process for determining turbine outlet pressure. 
         FIG. 10  is an iterative searching process for determining wastegate position. 
         FIG. 11  is an iterative searching process for determining turbine interstage pressure. 
         FIG. 12  a wastegate actuator and solenoid control system. 
     
    
    
     DETAILED DESCRIPTION 
     This disclosure provides a feed forward control system for controlling the operation of an engine (e.g., a diesel engine) by controlling an exhaust gas recirculation (“EGR”) valve, an exhaust throttle valve, and a wastegate valve. The control system includes an electronic control unit (“ECU”) that is used to implement the feed forward control system. The ECU includes an air system state observer for the engine that is used to estimate parameters that are not and/or cannot be measured directly. Models used by, and corrections generated by, the air system state observer are used in feed forward calculations to determine a desired exhaust throttle position, a desired wastegate valve position, and a desired EGR valve position that achieve desired performance objectives. Feed forward control with this method provides fast and accurate control of the engine within the constraints of the system. The feed forward calculations include engine cylinder models, EGR cooler and valve models, EGR mixer models, compressor and charge air cooler (“CAC”) models, turbine and wastegate models, and exhaust throttle models. The models are used, for example, to calculate minimum and maximum turbine flow to provide exhaust manifold pressure control within a given range and to calculate an exhaust throttle valve position that provides a desired turbine delta pressure without exceeding flow limits required for exhaust manifold pressure protection. The disclosures provided herein can be implemented in, or applied to, a variety of applications that include an engine and an exhaust throttle. 
       FIG. 1  illustrates a vehicle  100  that includes a diesel engine. Although the vehicle  100  illustrated in  FIG. 1  is a tractor, the control systems and techniques described herein can be implemented in other vehicles, such as lawn mowers, utility vehicles, dump trucks, loaders, dozers, skid steers, excavators, bunchers, harvesters, etc. For descriptive purposes, the disclosure is described herein generally with respect to a vehicle that includes a diesel engine. This disclosure can, however, be applied to any apparatus or machine that includes a diesel engine and the association of the disclosure with a vehicle is only exemplary. 
       FIG. 2  illustrates an electronic control unit (“ECU”) or controller  200  associated with the vehicle  100  or another vehicle or apparatus that includes a diesel engine. The ECU  200  illustrated in  FIG. 2  is, for example, an ECU for a diesel engine. The ECU  200  is connected or coupled to a variety of additional modules or components, such as a user interface module  205 , one or more indicators  210 , a power supply module  215 , a plurality of sensors  220 , an exhaust throttle control module  225 , a wastegate control module  230 , an exhaust gas recirculation (“EGR”) control module  235 , a data store or database  240 , and an engine control module  245 , and engine  250 . The exhaust throttle control module  225 , the wastegate control module  230 , the EGR control module  235 , and the engine control module  245  are shown as being separate from and connected to the ECU  200  for illustrative purposes. Each of these modules can alternatively be implemented entirely within the ECU  200  such that the ECU is configured, operable, or programmed to be an engine control unit for the engine  250 . As is described herein, the modules  225 ,  230 ,  235 , and  245  are connected to or associated with one another to achieve the desired control of the engine  250 . The plurality of sensors  220  are, for example, temperature sensors, pressure sensors, position sensors (e.g., valve position sensors), humidity sensors, etc. 
     The ECU  200  includes combinations of hardware and software that are programmed, configured, and/or operable to, among other things, control the operation of the vehicle  100  and or engine  250 , control activation of (e.g., current through) a wastegate solenoid, control a wastegate valve position, control an EGR valve position, control an exhaust throttle valve position, activate the one or more indicators  210  (e.g., a liquid crystal display [“LCD”], one or more LEDs, etc.), monitor the operation of the vehicle  100  and/or engine  250 , etc. In some embodiments, the ECU  200  includes a plurality of electrical and electronic components that provide power, operational control, and protection to the components and modules within the ECU  200 , the vehicle  100 , and/or the engine  250 . For example, the ECU  200  includes, among other things, a processing unit  255  (e.g., a microprocessor, a microcontroller, or another suitable programmable device), a memory  260 , input units  265 , and output units  270 . The processing unit  255  includes, among other things, a control unit  275 , an arithmetic logic unit (“ALU”)  280 , and a plurality of registers  285  (shown as a group of registers in  FIG. 2 ), and can be implemented using a known computer architecture, such as a modified Harvard architecture, a von Neumann architecture, etc. The processing unit  255 , the memory  260 , the input units  265 , and the output units  270 , as well as the various modules connected to the ECU  200  are connected by one or more control and/or data buses (e.g., common bus  290 ). The control and/or data buses are shown generally in  FIG. 2  for illustrative purposes. The use of one or more control and/or data buses for the interconnection between and communication among the various modules and components would be known to a person skilled in the art in view of this disclosure. In some embodiments, the ECU  200  is implemented partially or entirely on a semiconductor chip, is a field-programmable gate array (“FPGA”), is an application specific integrated circuit (“ASIC”), etc. 
     The memory  260  includes, for example, a program storage area and a data storage area. The program storage area and the data storage area can include combinations of different types of memory, such as read-only memory (“ROM”), random access memory (“RAM”) (e.g., dynamic RAM [“DRAM”], synchronous DRAM [“SDRAM”], etc.), electrically erasable programmable read-only memory (“EEPROM”), flash memory, a hard disk, an SD card, or other suitable magnetic, optical, physical, or electronic memory devices or data structures. The processing unit  255  is connected to the memory  260  and executes software instructions that are capable of being stored in a RAM of the memory  260  (e.g., during execution), a ROM of the memory  260  (e.g., on a generally permanent basis), or another non-transitory computer readable medium such as another memory or a disc. Software and instructions included in the implementation of the vehicle  100  and/or engine  250  can be stored in the memory  260  of the ECU  200 . The software includes, for example, firmware, one or more applications, program data, filters, rules, one or more program modules, and other executable instructions. The ECU  200  is configured, operable, or programmed to retrieve from the memory  260  and execute, among other things, instructions related to the control processes and methods described herein. In other constructions, the ECU  200  includes additional, fewer, or different components or modules. 
     The user interface module  205  is used to control or monitor the vehicle  100  and/or engine  250  (e.g., is within a cabin of the vehicle  100 ). The user interface module  205  can include a combination of digital and analog input or output devices required to achieve a desired level of control and monitoring for the vehicle  100 . For example, the user interface module  205  can include a display and input devices such as a touch-screen display, one or more knobs, dials, switches, buttons, etc. The display is, for example, a liquid crystal display (“LCD”), a light-emitting diode (“LED”) display, an organic LED (“OLED”) display, an electroluminescent display (“ELD”), a surface-conduction electron-emitter display (“SED”), a field emission display (“FED”), a thin-film transistor (“TFT”) LCD, etc. In other constructions, the display is a Super active-matrix OLED (“AMOLED”) display. The user interface module  205  can also be configured to display conditions or data associated with the vehicle  100  and/or engine  250  in real-time or substantially real-time. For example, the user interface module  205  is configured to display sensed or measured temperatures, pressures, valve positions, diluent-to-air (“D/A”) ratios, fuel-to-air (“F/A”) ratios, etc. In some embodiments, the user interface module  205  is controlled in conjunction with the one or more indicators  210  (e.g., LEDs) to provide visual indications of the status or conditions of the vehicle  100  and/or engine  250 . 
       FIG. 3  illustrates an existing engine control system  300  that utilizes proportional-integral-derivative (“PID”) control with output control arbitration. The system  300  is not described in detail herein. However, the system  300  includes PID control modules  305  and  310 , as well as output control arbitration modules  315 ,  320 , and  325 . The system  300  is implemented with feedback control to determine a desired EGR valve position, a variable-geometry turbocharger (“VGT”) position, and an air throttle position. The PID control modules  305  and  310  calculate the desired positions, and the output controls  315 ,  320 , and  325  prevent the system  300  from operating an engine outside of its operational limits. As a result of the feedback controls, PID control modules  305  and  310 , and the output control arbitration modules  315 ,  320 , and  325 , the system  300  is relatively slow and unresponsive to dynamic or transient operating conditions. 
       FIG. 4  illustrates an engine control system  400  including an air system state observer and control module or unit  405 . The system  400  provides quicker and more efficient control of the engine  250  than the system  300  of  FIG. 3 . The system  400  includes a setpoint tables module  410 , a first factors and offsets module  415 , a second factors and offsets module  420 , a first limits module  425 , a second limits module  430 , a smoke factor module  435 , a setpoint offsets module  440 , an after-treatment system module (e.g., a diesel oxidation catalyst [“DOC”] inlet temperature control module)  445 , the air system state observer and control system  405 , an EGR valve position control module  450 , a wastegate position control module  455 , and an exhaust throttle position control module  460 . The setpoint tables module  410  receives a variety of inputs  465  related to, for example, engine speed, desired amount of fuel (e.g., per cylinder of the engine  250 ), torque-speed curve information, and control mode settings. The setpoint tables modules  410  outputs a variety of factors, such as an EGR valve maximum position, a DOC inlet temperature setpoint, a D/A ratio setpoint, and an F/A ratio setpoint. The factors and offsets modules  415  and  420  can also receive a variety of inputs  470  and  475 , respectively, such as ambient temperature multipliers, ambient pressure multipliers, etc. The smoke factor module  435  can receive inputs  480  such as a smoke opacity F/A ratio limit, an F/A ratio estimate, etc. The modules of system  400  described so far are similar to modules shown in the system  300  of  FIG. 3  and will not be described in detail herein. 
     The DOC inlet temperature control module  445 , the air system state observer and control system  405 , the EGR valve position control module  450 , the wastegate position control module  455 , and the exhaust throttle position control module  460 , however, differ from the system  300  of  FIG. 3 . In  FIG. 4 , the air system state observer and control system  405  receives a desired diluent-to-air ratio, D/A des , a desired fuel-to-air ratio, F/A des , and a desired exhaust manifold delta pressure for a temperature change, ΔP em   _   des . The air system state observer and control system  405  also receives a variety of additional sensed temperatures, pressures, speeds, etc., as described below. The air system state observer and control system  405  outputs a desired EGR valve position, u egr   _   des , a desired wastegate position, u wg   _   des , and a desired exhaust throttle position, u et   _   des , for controlling an EGR valve, a wastegate solenoid, and an exhaust throttle using the EGR valve position control module  450 , the wastegate position control module  455 , and the exhaust throttle position control module  460 , respectively. The EGR valve position control module  450  outputs an EGR valve control signal  485  (e.g., a control signal having a duty cycle corresponding to the desired EGR valve position). The wastegate position control module  455  outputs a wastegate solenoid control signal  490  (e.g., a control signal having a duty cycle corresponding to the desired wastegate position). The exhaust throttle position control module  460  outputs an exhaust throttle position control signal  495  (e.g., a control signal having a duty cycle corresponding to the desired exhaust throttle position). The operation the air system state observer and control system  405  is described in detail below. 
       FIG. 5  illustrates a generalized state observer control system  500  that includes a state observer  505 . The state observer  505  is a mathematical model of a process that is being controlled and executed by the ECU  200 . The state observer control system  500  that includes a physical process  510  that is being modeled by a process model  515 , as well as an observer controller  520 , a feedback controller  525  and a feed forward controller  530 . The feed forward controller  530  is an inverse of the process model  515 . The process model  515  is not a perfect model of the physical process  510  because the physical process  510  experiences disturbances  535  that are not accounted for by the process model  515 . Sensors used to monitor the physical process  510  provide a measured state  540 , and the process model  515  outputs a measured state estimate  545 . The difference between the measured state  540  and the measured state estimate  545  provides an observer error  550  that is input to the observer controller  520 . The observer controller  520  processes the observer error  550  and generates a model correction  555  that is input to the process model  515  and to the feed forward controller  530 . Setpoint commands  560  indicating desired values for process parameters are input to the control system  500 . The setpoint commands  560  are input to the feed forward controller  530 . The difference between the setpoint commands  560  and a controlled state estimate  565  generated by the process model  515  produces a control error  570  that is input to the feedback controller  525 . The sum of the outputs of the feedback controller  525  and the feed forward controller  530  produces actuator commands  575  that are input to the physical process  510  and the process model  515 . 
     There are a variety of advantages to implementing a state observer within an engine control system. The state observer can provide estimates of states that are difficult, expensive, and/or impossible to measure directly (e.g., fewer sensors may be required). The process model  515  with corrections from the observer controller  520  can be used in the feed forward calculation of the actuator commands  575 . The inverse process model  530  has desired states or setpoint commands  560  as inputs, and the corresponding actuator commands  575  are the outputs. Feed forward control of this type provides fast response and can reduce the complexity of feedback control. Such a technique can also make it easier to implement system constraints because the constraints can be treated as limits within the feed forward and feedback control, thus eliminating the need for separate controllers for modifying the actuator commands (i.e., output arbitration control). Using an observer  505  in the control system  500  can also improve the operation of an engine in non-standard conditions because the model  515  can predict the effects of changes and adjust the controls as needed. 
     The generalized state observer control system  500  of  FIG. 5  is adapted for use in an engine  250  (e.g., a diesel engine) to control the air system of the engine  250 . A schematic view of an engine and air system  600  is illustrated in  FIG. 6 . The engine system  600  illustrates various components, state variables, mass flows, and sensors used to control an EGR valve  605 , an exhaust throttle valve  610 , and a wastegate valve  615 . Air enters the system  600  at a compressor inlet into a low pressure compressor  620 . A temperature sensor  625 , a pressure sensor  630 , and a humidity sensor  635  are located at the inlet to the low pressure compressor  620 . The low pressure compressor  620  compresses the air and sends it to a high pressure compressor  640  where it is further compressed. The compressed air from the high pressure compressor  640  is input to a charge air cooler (“CAC”)  645 . Various parameters, for example, pressure, temperature and diluent mass fraction in the CAC  645  can be monitored. The output from the CAC  645  passes to a mixer  650 . A temperature sensor  655  and a pressure sensor  660  are positioned between the CAC  645  and the mixer  650  to measure the CAC outlet temperature and pressure. 
     The mixer  650  mixes fresh air from the CAC  645  and recirculated exhaust gasses from an exhaust gas recirculation (“EGR”) cooler  665 . A temperature sensor  670  and a pressure sensor  675  are positioned between the EGR cooler  665  and the EGR valve  605  to measure the temperature and pressure at the outlet of the EGR cooler  665 . The mixed gasses from the mixer  650  are fed to an engine intake manifold  680 , and the output of the engine intake manifold  680  is divided among a plurality of cylinders  685  of the engine  250 . The engine  250  of  FIG. 6  is illustrated as including six cylinders. In some embodiments, the engine  250  includes a difference number of cylinders (e.g., two cylinders, four cylinders, 8 cylinders, etc.). A temperature sensor  695  and a pressure sensor  700  are positioned with respect to the intake manifold  680  to measure the temperature and pressure of the intake manifold  680 . 
     The exhaust gasses from the cylinders  685  of the engine  250  are fed to an engine exhaust manifold  705 . The exhaust gasses from the exhaust manifold  705  are either recirculated through the EGR cooler  665  or expelled from the system  600 . A temperature sensor  710  and a pressure sensor  715  are positioned with respect to the exhaust manifold  705  to measure the temperature and pressure of the exhaust manifold  705 . Some of the exhaust gasses expelled from the exhaust manifold  705  pass through a high pressure turbine  720  and a low pressure turbine  725  of a turbocharger. The high pressure turbine  720  can be controlled using the wastegate valve  615 . The low pressure turbine  725  can be controlled using the exhaust throttle valve  610 . 
     Additionally, a position sensor  730  is used to measure the position of the EGR valve  605  and generate a corresponding output signal. A position sensor  735  is used to measure the position of the exhaust throttle  610  and generate a corresponding output signal. In some embodiments, a position sensor  740  is used to measure the position of the wastegate valve  615  and generate a corresponding output signal. In some embodiments, a position sensor  745  is used to measure the position of a wastegate solenoid  750  that is used to control the wastegate valve  615 . In some embodiments, additional parameters such as additional pressures, additional temperatures, engine speeds, turbocharger speeds, exhaust back pressure, etc., are also measured and/or monitored within the system  600  by additional sensors  220  and the ECU  200 . 
     The system  600  shown in  FIG. 6  can be modeled by the ECU  200  using state equations that are based on the conservation of mass, energy, and momentum. Some relationships can be approximated using, for example, first order filters. Each state equation describes a rate of change. The state value at any given time can then be determined by integrating the state equation. Within the ECU  200 , each state of the engine  250  and/or system  600  can be given an initial condition, and a state value at each time step of the ECU  200  can be updated using numeric integration. The state equations for the system  600  are described below with continued reference to the system  600  of  FIG. 6 . Values for various parameters described herein are calculated or determined estimations or estimated values for the parameter unless the parameter or value for the parameter is referred to as a sensed value or sensed parameter, or the parameter or value for the parameter is described as being received from a physical sensor (e.g., a temperature sensor, a pressure sensor, etc.). 
     A rate of change of mass in the CAC  645 , 
                 dm   cac     dt     ,         
is modeled by the difference between the mass flow coming in from the compressors  620 ,  640 , {dot over (m)} cmp , and the mass flow exiting the CAC  645 , {dot over (m)} caco , as shown below in EQN. 1:
 
     
       
         
           
             
               
                 
                   
                     
                       dm 
                       cac 
                     
                     dt 
                   
                   = 
                   
                     
                       
                         m 
                         . 
                       
                       cmp 
                     
                     - 
                     
                       
                         m 
                         . 
                       
                       caco 
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   1 
                 
               
             
           
         
       
     
     A rate of change of mass in the intake manifold  680 , 
                 dm   im     dt     ,         
is modeled by the sum of the mass flows exiting the CAC  645 , {dot over (m)} caco , and the EGR valve  605 , {dot over (m)} egr , minus the mass flow entering the engine  250 , {dot over (m)} cylsi , as shown below in EQN. 2:
 
     
       
         
           
             
               
                 
                   
                     
                       dm 
                       im 
                     
                     dt 
                   
                   = 
                   
                     
                       
                         m 
                         . 
                       
                       caco 
                     
                     + 
                     
                       
                         m 
                         . 
                       
                       egr 
                     
                     - 
                     
                       
                         m 
                         . 
                       
                       cylsi 
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   2 
                 
               
             
           
         
       
     
     The rate of change of diluent mass in the intake manifold  680 , 
                 dm   d_im     dt     ,         
is modeled as the sum of the mass flow exiting the CAC  645 , {dot over (m)} caco , multiplied by the mass fraction of diluent in the CAC  645 , χ d   _   cac , (we can assume it is the same as the mass fraction of water in ambient air due to humidity) plus the mass flow entering from the EGR valve  605 , {dot over (m)} egr , multiplied by the mass fraction of diluent in the exhaust manifold  705 , χ d   _   em , minus the mass flow entering the cylinders  685  of the engine  250 , {dot over (m)} cylsi , multiplied by the mass fraction of diluent in the intake manifold  680 , χ d   _   im , as shown below in EQN. 3:
 
     
       
         
           
             
               
                 
                   
                     
                       dm 
                       d_im 
                     
                     dt 
                   
                   = 
                   
                     
                       
                         
                           m 
                           . 
                         
                         caco 
                       
                       · 
                       
                         χ 
                         d_cac 
                       
                     
                     + 
                     
                       
                         
                           m 
                           . 
                         
                         egr 
                       
                       · 
                       
                         χ 
                         d_em 
                       
                     
                     - 
                     
                       
                         
                           m 
                           . 
                         
                         cylsi 
                       
                       · 
                       
                         χ 
                         d_im 
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   3 
                 
               
             
           
         
       
     
     The term diluent is used herein to describe everything other than dry air or fuel that is included in a mixture. 
     A rate of change of mass in the exhaust manifold  705 , 
                 dm   em     dt     ,         
is modeled by the mass flow exiting the cylinders  685  of the engine  250 , {dot over (m)} cylso , minus the mass flow entering the EGR cooler  665 , {dot over (m)} egr , and the mass flow entering the high pressure and low pressure turbines  720 ,  725 , {dot over (m)} trb , as shown below in EQN. 4:
 
     
       
         
           
             
               
                 
                   
                     
                       dm 
                       em 
                     
                     dt 
                   
                   = 
                   
                     
                       
                         m 
                         . 
                       
                       cylso 
                     
                     - 
                     
                       
                         m 
                         . 
                       
                       egr 
                     
                     - 
                     
                       
                         m 
                         . 
                       
                       trb 
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   4 
                 
               
             
           
         
       
     
     A rate of change of diluent mass in the exhaust manifold  705 , 
                 dm   d_em     dt     ,         
is modeled by the difference between the mass flow exiting the cylinders  685  of the engine  250 , {dot over (m)} cylso , multiplied by the mass fraction of diluent exiting the cylinders  685  of the engine  250 , χ d   _   cylso , and the sum of the mass flows entering the EGR cooler  665 , {dot over (m)} egr , and the high and low pressure turbines  720 ,  725 , {dot over (m)} lp   _   trb , multiplied by the mass fraction of diluent in the exhaust manifold  705 , χ d   _   em , as shown below in EQN. 5:
 
     
       
         
           
             
               
                 
                   
                     
                       d 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       
                         m 
                         d_em 
                       
                     
                     dt 
                   
                   = 
                   
                     
                       
                         
                           m 
                           . 
                         
                         cylso 
                       
                       · 
                       
                         χ 
                         d_cylso 
                       
                     
                     - 
                     
                       
                         ( 
                         
                           
                             
                               m 
                               . 
                             
                             egr 
                           
                           + 
                           
                             
                               m 
                               . 
                             
                             lp_trb 
                           
                         
                         ) 
                       
                       · 
                       
                         χ 
                         d_em 
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   5 
                 
               
             
           
         
       
     
     A rate of change of temperature at the output of the CAC  645 , 
                 dT   caco     dt     ,         
is modeled by the difference between the steady state temperature at the output of the CAC  645 , T caco   _   ss , and the measured temperature at the output of the CAC  645 , T caco , divided by a time constant for the CAC  645 , τ cac , as shown below in EQN. 6:
 
     
       
         
           
             
               
                 
                   
                     
                       dT 
                       caco 
                     
                     dt 
                   
                   = 
                   
                     
                       ( 
                       
                         
                           T 
                           caco_ss 
                         
                         - 
                         
                           T 
                           caco 
                         
                       
                       ) 
                     
                     
                       τ 
                       cac 
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   6 
                 
               
             
           
         
       
     
     A rate of change of temperature at the output of the EGR cooler  665 , 
                 dT   egrco     dt     ,         
is modeled by the difference between the steady state temperature at the output of the EGR cooler  665 , T egrco   _   ss , and the measured temperature at the output of the EGR cooler  665 , T egrco , divided by a time constant for the EGR cooler  665 , τ egrc , as shown below in EQN. 7:
 
     
       
         
           
             
               
                 
                   
                     
                       dT 
                       egrco 
                     
                     dt 
                   
                   = 
                   
                     
                       ( 
                       
                         
                           T 
                           
                             egr 
                             ⁢ 
                             co_ss 
                           
                         
                         - 
                         
                           T 
                           egrco 
                         
                       
                       ) 
                     
                     
                       τ 
                       egrc 
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   7 
                 
               
             
           
         
       
     
     The steady state cooler outlet temperatures T caco   _   ss  and T egrco   _   ss  can be calculated using a heat exchanger effectiveness model. The effectiveness can be calibrated using a table with mass flow as the input. An effectiveness of “1” means the cooler outlet temperature is equal to the temperature of the cooling fluid, and an effectiveness of “0” means there is no change in temperature between the cooler inlet and outlet. 
     A rate of temperature change of the intake manifold  680 , 
                 dT   im     dt     ,         
is calculated using the mass flows in and out, the temperature in and out, and the change in mass within the intake manifold  680 . The rate of change of temperature of the intake manifold
 
               dT   im     dt         
is modeled by the rate of change of mass at the output of the CAC  645 , {dot over (m)} caco , multiplied by the specific heat at constant pressure, C P , multiplied by the temperature at the output of the CAC  645 , T caco , plus the mass flow of the EGR valve  605 , {dot over (m)} egr , multiplied by specific heat at constant pressure, C P , multiplied by the temperature at the output of the EGR cooler  665 , T egrco  minus the mass flow entering the cylinders  685  of the engine  250 , {dot over (m)} cylsi , multiplied by specific heat at constant pressure, C P , multiplied by the temperature of the intake manifold, T im , minus the rate of change of mass in the intake manifold  680 ,
 
                 d   ⁢           ⁢     m   im       dt     ,         
multiplied by specific heat at constant volume, C V , multiplied by the temperature of the intake manifold  680 , T im , all divided by the product of the mass in the intake manifold  680 , m im , multiplied by the specific heat at constant volume, C V , as shown below in EQN. 8:
 
     
       
         
           
             
               
                 
                   
                     
                       dT 
                       im 
                     
                     dt 
                   
                   = 
                   
                     
                       
                         
                           
                             
                               
                                 
                                   m 
                                   . 
                                 
                                 caco 
                               
                               · 
                               
                                 C 
                                 p 
                               
                               · 
                               
                                 T 
                                 caco 
                               
                             
                             + 
                             
                               
                                 
                                   m 
                                   . 
                                 
                                 egr 
                               
                               · 
                               
                                 C 
                                 p 
                               
                               · 
                               
                                 T 
                                 egrco 
                               
                             
                             - 
                           
                         
                       
                       
                         
                           
                             
                               
                                 
                                   m 
                                   . 
                                 
                                 cylsi 
                               
                               · 
                               
                                 C 
                                 p 
                               
                               · 
                               
                                 T 
                                 im 
                               
                             
                             - 
                             
                               
                                 
                                   d 
                                   ⁢ 
                                   
                                       
                                   
                                   ⁢ 
                                   
                                     m 
                                     im 
                                   
                                 
                                 dt 
                               
                               · 
                               
                                 C 
                                 v 
                               
                               · 
                               
                                 T 
                                 im 
                               
                             
                           
                         
                       
                     
                     
                       
                         m 
                         im 
                       
                       · 
                       
                         C 
                         v 
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   8 
                 
               
             
           
         
       
     
     The specific heats can be measured experimentally at constant volume or constant pressure. The specific heat at constant pressure, C P , is greater than the specific heat at constant volume, C V , because as a mixture is heated at constant pressure it expands and does work on the container or the fluid around it. The specific heat at constant pressure, C P , can be used to calculate energy flow into or out of a control volume. The specific heat at constant volume, C V , can be used to calculate the change in energy within the control volume due to changes in temperature and mass. 
     A rate of change of temperature at the exhaust manifold  705 , 
                 dT   em     dt     ,         
is modeled by the difference between the temperature at the output of the cylinders  685  of the engine  250 , T cylso , and the temperature of the exhaust manifold  705 , T em , divided by a time constant, τ em , for the exhaust manifold  705 , as shown below in EQN. 9:
 
     
       
         
           
             
               
                 
                   
                     
                       dT 
                       em 
                     
                     dt 
                   
                   = 
                   
                     
                       ( 
                       
                         
                           T 
                           cylso 
                         
                         - 
                         
                           T 
                           em 
                         
                       
                       ) 
                     
                     
                       τ 
                       em 
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   9 
                 
               
             
           
         
       
     
     A rate of change of the speed of the low pressure turbocharger  725 , 
                 dN   lpt     dt     ,         
is modeled by the sum of the torques on the low pressure turbine shaft and blades divided by the inertia of the low pressure turbocharger shaft and blades (i.e., Newton&#39;s second law for rotation). The sum of the torques is modeled by the difference between low pressure turbine power, {dot over (W)} lp   _   trb , and low pressure compressor power, {dot over (W)} lp   _   cmp , divided by the low pressure turbocharger speed, N lpt . The turbine power or compressor power can be calculated from the change in enthalpy of the gas as it goes through the turbine or compressor. The enthalpy change is equal to the mass flow rate multiplied by the specific heat at constant pressure, C p , multiplied by the delta temperature across the turbine or compressor. When turbine speed is expressed in units of revolutions per minute (“RPM”), turbine speed can be converted to radians per second (“rad/s”) using a factor of π/30. The inverse of this factor is squared in EQN. 10 to convert the low pressure turbocharger speed, N lpt , in the denominator and also to express the solution,
 
                 dN   lpt     dt     ,         
in units of revolutions per minute per second (rpm/s).
 
     
       
         
           
             
               
                 
                   
                     
                       dN 
                       lpt 
                     
                     dt 
                   
                   = 
                   
                     
                       1 
                       
                         J 
                         lpt 
                       
                     
                     · 
                     
                       ( 
                       
                         
                           
                             
                               W 
                               . 
                             
                             lp_trb 
                           
                           - 
                           
                             
                               W 
                               . 
                             
                             lp_cmp 
                           
                         
                         
                           N 
                           lpt 
                         
                       
                       ) 
                     
                     · 
                     
                       
                         ( 
                         
                           
                             30 
                             ⁢ 
                             
                               / 
                             
                             ⁢ 
                             π 
                             ⁢ 
                             
                                 
                             
                             ⁢ 
                             rpm 
                           
                           
                             rad 
                             ⁢ 
                             
                               / 
                             
                             ⁢ 
                             s 
                           
                         
                         ) 
                       
                       2 
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   10 
                 
               
             
           
         
       
     
     A rate of change in the speed of the high pressure turbocharger, 
                 dN   hpt     dt     ,         
is modeled by the sum of the torques on the high pressure turbine shaft and blades divided by the inertia of the high pressure turbocharger shaft and blades (i.e., Newton&#39;s second law for rotation). The sum of the torques is modeled by the difference between high pressure turbine power, {dot over (W)} hp   _   trb , and high pressure compressor power, {dot over (W)} hp   _   cmp , divided by the high pressure turbocharger speed, N hpt . The turbine power or compressor power can be calculated from the change in enthalpy of the gas as it goes through the turbine or compressor. The enthalpy change is equal to the mass flow rate multiplied by the specific heat at constant pressure, C p , multiplied by the delta temperature across the turbine or compressor. When turbine speed is expressed in units of RPM, turbine speed can be converted to rad/s using a factor of π/30. The inverse of this factor is squared in EQN. 11 to convert high pressure turbocharger speed, N hpt , in the denominator and also to express the solution,
 
                 dN   hpt     dt     ,         
in units of revolutions per minute per second (rpm/s).
 
     
       
         
           
             
               
                 
                   
                     
                       dN 
                       hpt 
                     
                     dt 
                   
                   = 
                   
                     
                       1 
                       
                         J 
                         hpt 
                       
                     
                     · 
                     
                       ( 
                       
                         
                           
                             
                               W 
                               . 
                             
                             
                               h 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               p 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               _ 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               trb 
                             
                           
                           - 
                           
                             
                               W 
                               . 
                             
                             
                               h 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               p 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               _ 
                               ⁢ 
                               
                                   
                               
                               ⁢ 
                               cmp 
                             
                           
                         
                         
                           N 
                           hpt 
                         
                       
                       ) 
                     
                     · 
                     
                       
                         ( 
                         
                           
                             
                               30 
                               / 
                               π 
                             
                             ⁢ 
                             
                                 
                             
                             ⁢ 
                             rpm 
                           
                           
                             rad 
                             ⁢ 
                             
                               / 
                             
                             ⁢ 
                             s 
                           
                         
                         ) 
                       
                       2 
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   11 
                 
               
             
           
         
       
     
     In addition to the state equations (i.e., EQNS. 1-11) associated with the engine system  600 , cylinder masses associated with the materials in the cylinders  685  (i.e., entering the cylinders  685  and exiting the cylinders  685 ) are also used to control the engine system  600 . The cylinders  685  of the engine  250  are described with respect to the mass of material entering a cylinder. The total mass of material entering a cylinder  685 , m cyli , is calculated based on the pressure in the intake manifold  680 , P im , the volume of the cylinder  685 , V cyl   _   disp , the volumetric efficiency, VE, of the cylinder  685  (e.g., based on engine speed to fuel tables), the temperature of the intake manifold  680 , T im , and the ideal gas constant, R, as shown below in EQN. 12: 
     
       
         
           
             
               
                 
                   
                     m 
                     cyli 
                   
                   = 
                   
                     
                       
                         P 
                         
                           i 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           m 
                         
                       
                       · 
                       
                         V 
                         
                           cyl 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           _ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           disp 
                         
                       
                       · 
                       VE 
                     
                     
                       R 
                       · 
                       
                         T 
                         
                           i 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           m 
                         
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   12 
                 
               
             
           
         
       
     
     The material entering the cylinder  685  is part diluent and part air. The diluent mass entering the cylinder  685 , m d   _   cyli , is calculated by multiplying the mass of material entering the cylinder  685 , m cyli , by the mass fraction of diluent in the intake manifold  680 , χ d   _   im , as shown below in EQN. 13:
 
 m   d   _   cyli   =m   cyli ·χ d   _   im   EQN. 13
 
     An air mass entering the cylinder  685 , m a   _   cyli , is calculated by multiplying the mass of material entering the cylinder  685 , m cyli , by the difference between one and the mass fraction of diluent in the intake manifold  680 , χ d   _   im , as shown below in EQN. 14:
 
 m   a   _   cyli   =m   cyli ·(1−χ d   _   im )  EQN. 14
 
     An amount of residual mass remaining in the cylinder  685 , m res , (e.g., gasses remaining from one cycle of the cylinder to the next cycle of the cylinder) is calculated based on the pressure in the exhaust manifold  705 , P em , the clearance volume between the piston and the cylinder head when the piston is at top-dead-center (“TDC”), V cyl   _   clear , a residual mass correction factor, CF res , for the cylinder  685 , the temperature of the output of the cylinder  685 , T cyclo , and the ideal gas constant, R, as shown below in EQN. 15: 
     
       
         
           
             
               
                 
                   
                     m 
                     res 
                   
                   = 
                   
                     
                       
                         P 
                         em 
                       
                       · 
                       
                         V 
                         
                           cyl 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           _ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           clear 
                         
                       
                       · 
                       
                         CF 
                         res 
                       
                     
                     
                       R 
                       · 
                       
                         T 
                         cylo 
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   15 
                 
               
             
           
         
       
     
     Residual material remaining in the cylinder  685  is also part diluent and part air. The diluent mass remaining in the cylinder  685 , m d   _   res , is calculated by multiplying the mass of residual material remaining in the cylinder  685 , m res , by the mass fraction of diluent at the output of the cylinder  685 , χ d   _   cylso , as shown below in EQN. 16:
 
 m   d   _   res   =m   res ·χ d   _   cylso   EQN. 16
 
     An air mass remaining in the cylinder  685 , m a   _   res , is calculated by multiplying the mass of residual material remaining in the cylinder  685 , m res , by the difference between one and the mass fraction of diluent at the output of the cylinder  685 , χ d   _   cylso , as shown below in EQN. 17:
 
 m   a   _   res   =m   res ·(1−χ d   _   cylso )  EQN. 17
 
     A mass of material in the cylinder  685  (i.e., when the intake valve closes), m cyl , can then be calculated as the sum total mass of material entering the cylinder  685 , m cyli , and the mass of residual material remaining in the cylinder  685  from a previous cycle, m res   _   previous , as shown below in EQN. 18:
 
 m   cyl   =m   cyli   +m   res   _   previous   EQN. 18
 
     A total mass of material in the cylinder  685 , m cyl , is also comprised of diluent and air, and each portion can be calculated. The mass of diluent in the cylinder  685 , m d   _   cyl , can be calculated as the sum of the mass of diluent entering the cylinder  685 , m d   _   cyli , and the mass of residual diluent from the previous cycle, m d   _   res   _   previous , as shown below in EQN. 19:
 
 m   d   _   cyl   =m   d     cyli     +m   d   _   res   _   previous   EQN. 19
 
     Similarly, a mass of air in the cylinder  685 , m a   _   cyl , can be calculated as the sum of the mass of air entering the cylinder  685 , m a   _   cyli , and the mass of residual air from the previous cycle, m a   _   res   _   previous , as shown below in EQN. 20:
 
 m   a   _   cyl   =m   a   _   cyli   +m   a   _   res   _   previous   EQN. 20
 
     A mass of material exiting the cylinder  685 , m cylo , can be calculated as the mass of material entering the cylinder  685 , m cyli , plus the mass of fuel in the cylinder  685 , m f , plus the mass of residual material remaining in the cylinder  685  from a previous cycle, m res   _   previous , minus the mass of residual material remaining in the cylinder  685 , m res , as shown below in EQN. 21:
 
 m   cylo   =m   cyli   +m   f   +m   res   _   previous   −m   res   EQN. 21
 
     A mass flow entering the cylinder  685 , {dot over (m)} cylsi , and the mass flow exiting the cylinder  685  can then be calculated based on the mass of material entering the cylinder, m cyli , and the mass of material exiting the cylinder, m cylo , respectively. The mass flow entering the cylinder  685  is calculated based on the speed of the engine  250 , N e , the number of cylinders in the engine  250 , n cyls , and the mass of material entering the cylinder  685 , m cyli , as shown below in EQN. 22: 
                       m   .     cylsi     =         N   e     ·     n   cyls     ·     m   cyli           (     2   ⁢           ⁢   rev   ⁢     /     ⁢   cycle     )     ·     (     60   ⁢           ⁢   sec   ⁢     /     ⁢   min     )                 EQN   .           ⁢   22               
The mass flow entering the cylinder  685 , {dot over (m)} cylsi  is converted for an intake event occurring every two revolutions of the engine  250  by dividing by two revolutions per cycle multiplied by 60 seconds per minute.
 
     Similarly, the mass flow exiting the cylinder, {dot over (m)} cylso , is calculated based on the speed of the engine  250 , N e , the number of cylinders in the engine  250 , n cyls , and the mass of material exiting the cylinder  685 , m cylo , as shown below in EQN. 23: 
                       m   .     cylso     =         N   e     ·     n   cyls     ·     m   cylo           (     2   ⁢           ⁢   rev   ⁢     /     ⁢   cycle     )     ·     (     60   ⁢           ⁢   sec   ⁢     /     ⁢   min     )                 EQN   .           ⁢   23               
Again, the mass flow exiting the cylinder  685 , {dot over (m)} cylso , is converted for an intake event occurring every two revolutions of the engine  250  by dividing by two revolutions per cycle multiplied by 60 seconds per minute.
 
     The inlet and outlet temperatures of each cooler  645  and  665  can be modeled and/or the temperatures can be measured. Half of the cooler can be assumed to be at the inlet temperature and half of the cooler can be assumed to be at the outlet temperature. The average cooler density can be calculated using the average temperature and average pressure. Assuming a linear drop in pressure and temperate across the cooler, the average temperature and average pressure can be calculated by averaging inlet and outlet values. The mass flow out for each cooler  645  and  665  can be calculated by multiplying the average density by the table output and then taking the square root. A CAC mass flow correction factor CF cac  and an EGR mass flow correction factor CF egr  can be included in these mass flow calculations for the coolers  645  and  665 , as shown below in EQNS. 24 and 25: 
     
       
         
           
             
               
                 
                   
                     
                       m 
                       . 
                     
                     caco 
                   
                   = 
                   
                     
                       CF 
                       cac 
                     
                     · 
                     
                       
                         
                           ρ 
                           
                             cac 
                             ⁢ 
                             
                                 
                             
                             ⁢ 
                             _ 
                             ⁢ 
                             
                                 
                             
                             ⁢ 
                             avg 
                           
                         
                         · 
                         
                           CACFlowSqOverDensityTbl 
                           ⁡ 
                           
                             ( 
                             
                               
                                 Δ 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 
                                   P 
                                   cac 
                                 
                               
                               , 
                               
                                 Δ 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 
                                   T 
                                   cac 
                                 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   24 
                 
               
             
             
               
                 
                   
                     
                       m 
                       . 
                     
                     egrco 
                   
                   = 
                   
                     
                       CF 
                       egrc 
                     
                     · 
                     
                       
                         
                           ρ 
                           
                             egrc 
                             ⁢ 
                             
                                 
                             
                             ⁢ 
                             _ 
                             ⁢ 
                             
                                 
                             
                             ⁢ 
                             avg 
                           
                         
                         · 
                         
                           EGRCFlowSqOverDensityTbl 
                           ⁡ 
                           
                             ( 
                             
                               
                                 Δ 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 
                                   P 
                                   egrc 
                                 
                               
                               , 
                               
                                 Δ 
                                 ⁢ 
                                 
                                     
                                 
                                 ⁢ 
                                 
                                   T 
                                   egrc 
                                 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   25 
                 
               
             
           
         
       
     
     The CAC mass flow correction factor, CF cac , can be applied as a correction to the compressor mass flow estimates and the CAC mass flow estimates. The EGR mass flow correction factor, CF egr , can be applied as a correction to the EGR cooler mass flow estimates and the EGR valve mass flow estimates. 
     The mass flows for the EGR valve  605 , the wastegate valve  615 , and the exhaust throttle  610  can be modeled using the compressible gas flow equation for an orifice, as shown below in EQNS. 26, 27, and 28, respectively: 
                       m   .     egrv     =       CF   egrv     ·       C     d   ⁢           ⁢   _   ⁢           ⁢   egr       ⁡     (     u   egr     )       ·     A   egr     ·       P   egrco         R   ·     T   egrco           ·     Ψ   ⁡     (       P     i   ⁢           ⁢   m         P   egrco       )                 EQN   .           ⁢   26                       ⁢         m   .     wg     =       CF   trb     ·       C     d   ⁢           ⁢   _   ⁢           ⁢   wg       ⁡     (     u   wg     )       ·     A   wg     ·       P   em         R   ·     T   em           ·     Ψ   ⁡     (       P     trb   ⁢           ⁢   _   ⁢           ⁢   inter         P   em       )                   EQN   .           ⁢   27                       ⁢         m   .     et     =       CF   trb     ·       C     d   ⁢           ⁢   _   ⁢           ⁢   et       ⁡     (     u   et     )       ·     A   et     ·       P   trbo         R   ·     T   trbo           ·     Ψ   ⁡     (       P   doci       P   trbo       )                   EQN   .           ⁢   28               
where C d   _   egr  is the discharge coefficient for the EGR valve  605 , which can be calibrated using a table with EGR valve position, u egr , as the input, C d   _   wg  is the discharge coefficient for the wastegate  615 , which can be calibrated using a table with wastegate valve position, u wg , as the input and C d   _   et  is the discharge coefficient for the exhaust throttle  610 , which can be calibrated using a table with exhaust throttle position, u et , as the input. The areas, A, can be calculated using actuator bore diameters. The term, R, is the ideal gas constant. The compressible gas flow function, Ψ, is a function of pressure ratio and can be calibrated using a table with pressure ratio as the input. The table values can be calculated off-line using EQNS. 29 and 30:
 
                       Ψ   ⁡     (       P   out       P     i   ⁢           ⁢   n         )       =         (       P   out       P     i   ⁢           ⁢   n         )       1   k       ·           2   ·   k       k   +   1       ·     (     1   -       (       P   out       P     i   ⁢           ⁢   n         )         k   -   1     k         )             ⁢     
     ⁢       for   ⁢           ⁢     (       P   out       P     i   ⁢           ⁢   n         )       ≥       (     2     k   +   1       )       k     k   -   1                   EQN   .           ⁢   29                   Ψ   ⁡     (       P   out       P     i   ⁢           ⁢   n         )       =       k   ·       (     2     k   +   1       )         k   +   1         k   -   1     ⁢                       ⁢     
     ⁢       for   ⁢           ⁢     (       P   out       P     i   ⁢           ⁢   n         )       &lt;       (     2     k   +   1       )       k     k   -   1                   EQN   .           ⁢   30               
where the term, k, represents the ratio of specific heats C p /C v .
 
     The state equations, cylinder masses, and engine mass flows described above can then be used to control the engine  250  using the air system state observer and control system  405 .  FIG. 7  illustrates the air system state observer and control system  405  from  FIG. 4  in more detail. In the system  405 , desired in-cylinder states are converted to manifold states. The desired mass flows to achieve the manifold states are calculated, and flow models and model corrections are used to calculate the desired actuator positions for the engine  250 . The control system  405  includes the engine  250 , an engine observer model  800 , an observer controller  805 , and an inverse engine model  810 . 
     The engine  250  experiences disturbances  815  (e.g., deposits in engine, air leaks, valves not opening, etc.) that are not modeled by the engine observer model  800 . Sensors monitoring the engine  250  provide a measured state  820 . The engine observer model  800  processes various inputs (including, for example, speeds, masses, pressures, temperatures, model corrections, etc.) and generates a measured state estimate  825  to be compared with the measured state  820 , as well as controlled state estimates  830  that are provided to the inverse engine model  810 . The engine observer model includes, for example, state equations, mass flow equations, and cylinder equations corresponding to EQNS. 1-30 above. The difference between the measured state  820  and the measured state estimate  825  provides an observer error  835  that is input to the observer controller  805 . The observer controller  805  generates model corrections  840  that are provided to the engine observer model  800  and the inverse engine model  810 . The model corrections generated by the observer controller  805  can include an integral term that drives the steady state error to zero. This can help keep the operation of the engine observer model  800  close to that of the engine  250 . 
     The inverse engine model or feed forward controller  810  takes the controlled state estimates  830  generated by the engine observer model  800 , the model corrections  840  generated by the observer controller  805 , the desired state inputs  845 , and various other system parameters and calculates desired engine state commands  850  to achieve the desired diluent-to-air ratio, D/A des , and fuel-to-air ratio, F/A des , values included in the desired state inputs  845 . 
     The inverse engine module  810  of  FIG. 7  is illustrated in more detail in  FIG. 8 . The inverse engine module  810  includes a cylinders model module  900 , a feed forward and closed loop EGR control module  905 , an EGR cooler and Valve model module  910 , an EGR mixer model module  915 , a compressor and CAC model module  920 , an EGR cooler and valve model module  925 , a limits and filter module  930  and exhaust pressure control module  935 , a turbine and wastegate model module  940 , an exhaust throttle model module  945 , and a wastegate solenoid control module  950 . 
     The inverse engine module  810  is divided into two primary control portions: an EGR control portion  955 ; and an exhaust throttle and wastegate control portion  960  (i.e., a turbocharger control portion). The cylinders model module  900  receives the desired diluent-to-air ratio, D/A des , and the desired fuel-to-air ration, F/A des . The cylinders model  900  outputs a desired intake manifold diluent mass fraction for fast control χ d   _   im   _   fast   _   des , to the feed forward and closed loop EGR control module  905 . The desired intake manifold diluent mass fraction for fast control χ d   _   im   _   fast   _   des , is calculated by the cylinders model module  900  and using EQNS. 31-33. A desired cylinder diluent mass for fast control, m d   _   cyl   _   fast   _   des  (i.e., EGR valve control), is equal to the desired diluent-to-air ratio, D/A des , multiplied by a cylinder air mass, m a   _   cyl , as shown below in EQN. 31:
 
 m   d   _   cyl   _   fast   _   des   =D/A   des   ·m   a   _   cyl   EQN. 31
 
     A desired cylinder-in diluent mass for fast control, m d   _   cyli   _   fast   _   des , is equal to the desired cylinder diluent mass for fast control, m d   _   cyl   _   fast   _   des , minus a cylinder residual diluent mass, m d   _   res , as shown below in EQN. 32:
 
 m   d   _   cyli   _   fast   _   des   =m   d   _   cyl   _   fast   _   des   −m   d   _   res   EQN. 32
 
     The desired intake manifold diluent mass fraction for fast control, χm d   _   im   _   fast   _   des , is then equal to the desired cylinder in diluent mass for fast control, m d   _   cyli   _   fast   _   des , divided by a cylinder in mass estimate, m cycli , as shown below in EQN. 33: 
     
       
         
           
             
               
                 
                   
                     χ 
                     
                       d 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       _ 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       im 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       _ 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       fast 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       _ 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       des 
                     
                   
                   = 
                   
                     
                       m 
                       
                         d 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         _ 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         cyli 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         _ 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         fast 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         _ 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         des 
                       
                     
                     
                       m 
                       cyli 
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   33 
                 
               
             
           
         
       
     
     The feed forward and closed loop EGR control module  905  receives the desired intake manifold diluent mass fraction for fast control χ d   _   im   _   fast   _   des , a mass flow into the engine cylinders, {dot over (m)} cylsi , a CAC diluent mass fraction, χ d   _   cac , an exhaust manifold diluent mass fraction, χ d   _   em , and an intake manifold diluent mass fraction, χ d   _   im . 
     A desired intake manifold EGR mass fraction for fast control, χ egr   _   im   _   fast   _   des  (i.e., EGR valve control), is calculated by taking the difference between the desired intake manifold diluent mass fraction for fast control χ d   _   im   _   fast   _   des , and a CAC diluent mass fraction estimate, χ d   _   cac , and then dividing by a difference between the exhaust manifold diluent mass fraction, χ d   _   em , and the CAC diluent mass fraction, χ d   _   cac , as shown below in EQN. 34. The CAC diluent mass fraction, χ d   _   cac , will be non-zero when there is humidity in the ambient air. The CAC diluent mass fraction is calculated using a humidity measurement from the humidity sensor  635  at the low pressure compressor inlet. 
     
       
         
           
             
               
                 
                   
                     χ 
                     
                       egr 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       _ 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       i 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       m 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       _ 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       fast 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       _ 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       des 
                     
                   
                   = 
                   
                     
                       
                         χ 
                         
                           d 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           _ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           im 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           _ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           fast 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           _ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           des 
                         
                       
                       - 
                       
                         χ 
                         
                           d 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           _ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           cac 
                         
                       
                     
                     
                       
                         χ 
                         
                           d 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           _ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           em 
                         
                       
                       - 
                       
                         χ 
                         
                           d 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           _ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           cac 
                         
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   34 
                 
               
             
           
         
       
     
     A feed forward EGR mass flow, {dot over (m)} egr   _   ff , is calculated by multiplying the mass flow into cylinders, {dot over (m)} cylsi , by the desired intake manifold EGR mass fraction for fast control, χ egr   _   im   _   fast   _   des , as shown below in EQN. 35:
 
 {dot over (m)}   egr   _   ff   ={dot over (m)}   cylsi ·χ egr   _   im   _   fast   _   des   EQN.35
 
     A closed loop EGR mass flow, {dot over (m)} egr   _   cl , is calculated by multiplying an EGR mass flow proportional gain, K p   _   egr , by the difference between the desired intake manifold diluent mass fraction for fast control χ d   _   im   _   fast   _   des , and the intake manifold diluent mass fraction, χ d   _   im , as shown below in EQN. 36:
 
 {dot over (m)}   egr   _   cl   =K   p   _   egr ·(χ d   _   im   _   fast   _   des −χ d   _   im )  EQN.36
 
     A desired EGR mass flow for fast control, {dot over (m)} egr   _   fast   _   des , is equal to the sum of the feed forward EGR mass flow, {dot over (m)} egr   _   ff , and closed loop EGR mass flow, {dot over (m)} egr   _   cl , as shown below in EQN. 37:
 
 {dot over (m)}   egr   _   fast   _   des   ={dot over (m)}   egr   _   ff   +{dot over (m)}   egr   _   cl   EQN. 37
 
     The desired EGR mass flow for fast control, {dot over (m)} egr   _   fast   _   des , is output to the EGR cooler and valve model module  910 . The EGR cooler and valve model module  910  also receives an exhaust manifold pressure, P em , an intake manifold pressure, P im , an exhaust manifold temperature, T em , the EGR cooler mass flow correction factor, CF egrc , the EGR valve mass flow correction factor, CF egrv , and an EGR cooler outlet temperature, T egrco . 
     A desired EGR valve position, U egr   _   des , is then determined using EQNS. 25 and 26. EQN. 25 is used to find a desired EGR cooler outlet pressure that provides flow equal to the desired EGR mass flow for fast control, {dot over (m)} egr   _   fast   _   des  (e.g., using an iterative solving process). EQN. 26 is then used to find the desired EGR valve position, U egr   _   des , that provides flow equal to the desired EGR mass flow for fast control, {dot over (m)} egr   _   fast   _   des , with desired EGR cooler outlet pressure, P egrco   _   des . 
     The cylinders model  900  also outputs a desired cylinder in mass, {dot over (m)} cylsi   _   des , a desired intake manifold diluent mass fraction for slow control, χ d   _   im   _   slow   _   des , and a desired exhaust manifold diluent mass fraction, χ d   _   em   _   des , to the EGR mixer module  915 . 
     A desired cylinder air mass, m a   _   cyl   _   des , is equal to a fuel mass injected into a cylinder, m f , divided by a desired fuel to air ratio, F/A des , as shown below in EQN. 38: 
     
       
         
           
             
               
                 
                   
                     m 
                     
                       a 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       _ 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       cyl 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       _ 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       des 
                     
                   
                   = 
                   
                     
                       m 
                       f 
                     
                     
                       F 
                       / 
                       
                         A 
                         des 
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   38 
                 
               
             
           
         
       
     
     A cylinder in air mass estimate, m a   _   cyl   _   des , is equal to the desired cylinder air mass, m a   _   cyl   _   des , minus the previous cylinder residual air mass estimate, m a   _   res   _   previous , as shown below in EQN. 39:
 
 m   a   _   cyli   _   des   =m   a   _   cyl   _   des   −m   a   _   res   _   previous   EQN. 39
 
     A desired cylinder diluent mass for slow control, m d   _   cyl   _   slow   _   des  (i.e., wastegate and exhaust throttle control), is equal to the desired diluent-to-air ratio, D/A des , multiplied by the desired cylinder air mass, m a   _   cyl   _   des , as shown below in EQN. 40.
 
 m   d   _   cyl   _   slow   _   des   =D/A   des   ·m   a   _   cyl   _   des   EQN. 40
 
     A desired cylinder in diluent mass for slow control, m d   _   cyli   _   slow   _   des , is equal to the desired cylinder diluent mass for slow control, m d   _   cyl   _   slow   _   des , minus the previous cylinder residual diluent mass estimate, m d   _   res   _   previous , as shown below in EQN. 41:
 
 m   d   _   cyli   _   slow   _   des   =m   d   _   cyl   _   slow   _   des   −m   d   _   res   _   previous   EQN. 41
 
     A desired cylinder in mass, m cyli   _   des , is equal to the desired cylinder in air mass, m a   _   cyli   _   des , plus the desired cylinder in diluent mass for slow control, m d   _   cyl   _   slow   _   des , as shown below in EQN. 42:
 
 m   cyli   _   des   =m   a   _   cyli   _   des   +m   d   _   cyli   _   slow   _   des   EQN. 42
 
     The desired mass flow into the cylinders, {dot over (m)} cylsi   _   des , is then calculated using engine speed, N e , the number of engine cylinders, n cyls , and the desired cylinder in mass, m cyli   _   des , as shown below in EQN. 43: 
     
       
         
           
             
               
                 
                   
                     
                       m 
                       . 
                     
                     
                       cylsi 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       _ 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       des 
                     
                   
                   = 
                   
                     
                       
                         N 
                         e 
                       
                       · 
                       
                         n 
                         cyls 
                       
                       · 
                       
                         m 
                         
                           cyli 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           _ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           des 
                         
                       
                     
                     
                       
                         ( 
                         
                           2 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           rev 
                           ⁢ 
                           
                             / 
                           
                           ⁢ 
                           cycle 
                         
                         ) 
                       
                       · 
                       
                         ( 
                         
                           60 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           min 
                           ⁢ 
                           
                             / 
                           
                           ⁢ 
                           sec 
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   43 
                 
               
             
           
         
       
     
     The desired intake manifold pressure, P im   _   des , is equal to the desired cylinder in mass, m cyli   _   des , multiplied by the ideal gas constant, R, multiplied by an intake manifold temperature, T im , divided by a cylinder displacement volume, V cyl   _   disp , and volumetric efficiency, VE, as shown below in EQN. 44: 
     
       
         
           
             
               
                 
                   
                     P 
                     
                       i 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       m 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       _ 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       des 
                     
                   
                   = 
                   
                     
                       
                         m 
                         
                           cyli 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           _ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           des 
                         
                       
                       · 
                       R 
                       · 
                       
                         T 
                         
                           i 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           m 
                         
                       
                     
                     
                       
                         V 
                         
                           cyl 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           _ 
                           ⁢ 
                           
                               
                           
                           ⁢ 
                           disp 
                         
                       
                       · 
                       VE 
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   44 
                 
               
             
           
         
       
     
     The desired intake manifold diluent mass fraction for slow control, χ d   _   im   _   slow   _   des , is equal to the desired cylinder in diluent mass for slow control, m d   _   cyli   _   slow   _   des , divided by cylinder in mass estimate, m cyli   _   des , as shown below in EQN. 45: 
     
       
         
           
             
               
                 
                   
                     χ 
                     
                       d 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       _ 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       i 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       m 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       _ 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       slow 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       _ 
                       ⁢ 
                       
                           
                       
                       ⁢ 
                       des 
                     
                   
                   = 
                   
                     
                       m 
                       
                         d 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         _ 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         cyli 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         _ 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         slow 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         _ 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         des 
                       
                     
                     
                       m 
                       
                         cyli 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         _ 
                         ⁢ 
                         
                             
                         
                         ⁢ 
                         des 
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   45 
                 
               
             
           
         
       
     
     The desired exhaust manifold diluent mass fraction χ d   _   em   _   des , is determined using EQNS. 46-48. A desired cylinder mass when the exhaust valve opens, m cyl   _   evo   _   des , is equal to the desired cylinder air mass, m a   _   cyl   _   des , plus the desired cylinder diluent mass for slow control, m d   _   cyl   _   slow   _   des , plus a fuel mass injected into the cylinder, m f , as shown below in EQN. 46:
 
 m   cyl   _   evo   _   des   =m   a   _   cyl   _   des   +m   d   _   cyl   _   slow   _   des   +m   f   EQN. 46
 
     A desired cylinder diluent mass when the exhaust valve opens, m d   _   cyl   _   evo   _   des , is equal to the desired cylinder diluent mass for slow control, m d   _   cyl   _   slow   _   des , plus fuel mass injected into the cylinder, m f , multiplied by the quantity one plus one over the Stoichiometric fuel-to-air ratio, F/A stoich , as shown below in EQN. 47: 
     
       
         
           
             
               
                 
                   
                     m 
                     
                       d_cyl 
                       ⁢ 
                       _evo 
                       ⁢ 
                       _des 
                     
                   
                   = 
                   
                     
                       m 
                       
                         d_cyl 
                         ⁢ 
                         _slow 
                         ⁢ 
                         _des 
                       
                     
                     + 
                     
                       
                         m 
                         f 
                       
                       ⁡ 
                       
                         ( 
                         
                           1 
                           + 
                           
                             1 
                             
                               F 
                               / 
                               
                                 A 
                                 stoich 
                               
                             
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   47 
                 
               
             
           
         
       
     
     The desired exhaust manifold diluent mass fraction, χ d   _   em   _   des , is then equal to the desired cylinder diluent mass when the exhaust valve opens, m d   _   cyli   _   evo   _   des , divided by the desired cylinder mass when the exhaust valve opens, m cyl   _   evo   _   des , as shown below in EQN. 48: 
     
       
         
           
             
               
                 
                   
                     χ 
                     
                       d_em 
                       ⁢ 
                       _des 
                     
                   
                   = 
                   
                     
                       m 
                       
                         d_cyl 
                         ⁢ 
                         _evo 
                         ⁢ 
                         _des 
                       
                     
                     
                       m 
                       
                         cyl_evo 
                         ⁢ 
                         _des 
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   48 
                 
               
             
           
         
       
     
     The EGR mixer module  915  receives the desired cylinder in mass flow, {dot over (m)} cylsi   _   des , the desired intake manifold diluent mass fraction for slow control, χ d   _   im   _   slow   _   des , and the desired exhaust manifold diluent mass fraction, χ d   _   em   _   des . The EGR mixer module  915  generates a desired compressor mass flow, {dot over (m)} cmp   _   des , and a desired EGR mass flow for slow control, {dot over (m)} egr   _   slow   _   des . 
     A desired intake manifold EGR mass fraction for slow control, χ egr   _   im   _   slow   _   des  (i.e., for wastegate and exhaust throttle control), is calculated by taking the difference between the desired intake manifold diluent mass fraction for slow control, χ d   _   im   _   slow   _   des , and the CAC diluent mass fraction, χ d   _   cac , and then dividing by the difference between the desired exhaust manifold diluent mass fraction, χ d   _   em   _   des , and the CAC diluent mass fraction, χ d   _   cac , as shown below in EQN. 49: 
     
       
         
           
             
               
                 
                   
                     χ 
                     
                       egr_im 
                       ⁢ 
                       _slow 
                       ⁢ 
                       _des 
                     
                   
                   = 
                   
                     
                       
                         χ 
                         
                           d_im 
                           ⁢ 
                           _slow 
                           ⁢ 
                           _des 
                         
                       
                       - 
                       
                         χ 
                         d_cac 
                       
                     
                     
                       
                         χ 
                         
                           d_em 
                           ⁢ 
                           _des 
                         
                       
                       - 
                       
                         χ 
                         d_cac 
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   49 
                 
               
             
           
         
       
     
     The desired EGR mass flow for slow control, {dot over (m)} egr   _   slow   _   des , is then equal to the desired mass flow into cylinders, {dot over (m)} cylsi   _   des , multiplied by the desired intake manifold EGR mass fraction for slow control, χ egr   _   im   _   slow   _   des , as shown below in EQN. 50:
 
 {dot over (m)}   egr   _   slow   _   des   ={dot over (m)}   cylsi   _   des ·χ egr   _   im   _   slow   _   des   EQN. 50
 
     The desired compressor mass flow, {dot over (m)} cmp   _   des , is equal to the difference between the desired mass flow into cylinders, {dot over (m)} cylsi   _   des , and the desired EGR mass flow for slow control, {dot over (m)} egr   _   slow   _   des , as shown below in EQN. 51:
 
 {dot over (m)}   cmp   _   des   ={dot over (m)}   cylsi   _   des   −{dot over (m)}   egr   _   slow   _   des   EQN. 51
 
     The compressor and CAC model module  920  receives the desired compressor mass flow, {dot over (m)} cmp   _   des , as well as the desired intake manifold pressure, P im   _   des . The compressor and CAC models are used to determine how much power, {dot over (W)} trb   _   des , is required to achieve the desired compressor mass flow, {dot over (m)} cmp   _   des , with the desired intake manifold pressure, P im   _   des . To determine the pressure drop across the CAC  645 , a compressor outlet pressure, P cmpo , and intake manifold pressure, P im , are measured or calculated from mass and temperature state estimates using the ideal gas law. 
     The compressor outlet pressure, P cmpo , is equal to the CAC mass, m cac , multiplied by the ideal gas constant, R, multiplied by the average temperature of the CAC (i.e., the sum of compressor outlet temperature, T cmpo , and CAC outlet temperature, T caco , divided by two), all divided by the CAC volume, V cac , as shown below in EQN. 52: 
     
       
         
           
             
               
                 
                   
                     P 
                     cmpo 
                   
                   = 
                   
                     
                       
                         
                           m 
                           cac 
                         
                         · 
                         R 
                       
                       
                         V 
                         cac 
                       
                     
                     · 
                     
                       ( 
                       
                         
                           
                             T 
                             cmpo 
                           
                           + 
                           
                             T 
                             caco 
                           
                         
                         2 
                       
                       ) 
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   52 
                 
               
             
           
         
       
     
     The intake manifold pressure, P im , is equal to the intake manifold mass, m im , multiplied by the ideal gas constant, R, multiplied by the intake manifold temperature, T im , divided by the intake manifold volume, V im , as shown below in EQN. 53: 
     
       
         
           
             
               
                 
                   
                     P 
                     im 
                   
                   = 
                   
                     
                       
                         m 
                         im 
                       
                       · 
                       R 
                       · 
                       
                         T 
                         im 
                       
                     
                     
                       V 
                       im 
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   53 
                 
               
             
           
         
       
     
     A desired compressor outlet pressure, P cmpo   _   des , is equal to the desired intake manifold pressure, P im   _   des , plus the compressor outlet pressure, P cmpo , minus the intake manifold pressure, P im , as shown below in EQN. 54:
 
 P   cmpo   _   des   =P   im   _   des +( P   cmpo   −P   im )  EQN. 54
 
     The compressor outlet pressure, P cmpo , and intake manifold pressure, P im , were previously calculated for the air system state observer and control system  405 , so they can conveniently be used in EQN. 54. Some error can be introduced when calculating desired compressor outlet pressure, P cmpo   _   des , in this way under transient conditions because the pressure drop across the CAC  645  is for a present flow instead of a desired flow. In some embodiments, EQN. 24 is used to solve for the CAC pressure drop at the desired compressor mass flow, {dot over (m)} cmp   _   des . EQN. 24 would produce a more accurate calculation, but would involve an iterative solution. 
     A desired compressor interstage pressure, P cmp   _   inter   _   des , is determined using a current compressor interstage pressure, P cmp   _   inter , and current compressor outlet pressure, P cmpo . An interpolation factor is calculated using the current pressures, and the desired compressor interstage pressure, P cmp   _   inter   _   des , is calculated to be the same fractional distance between the compressor inlet pressure, P cmpi , and the desired compressor outlet pressure, P cmpo   _   des , as shown below in EQN. 55: 
     
       
         
           
             
               
                 
                   
                     P 
                     
                       cmp_inter 
                       ⁢ 
                       _des 
                     
                   
                   = 
                   
                     
                       P 
                       cmpi 
                     
                     + 
                     
                       
                         ( 
                         
                           
                             
                               P 
                               cmp_inter 
                             
                             - 
                             
                               P 
                               cmpi 
                             
                           
                           
                             
                               P 
                               cmpo 
                             
                             - 
                             
                               P 
                               cmpi 
                             
                           
                         
                         ) 
                       
                       · 
                       
                         ( 
                         
                           
                             P 
                             cmpo_des 
                           
                           - 
                           
                             P 
                             cmpi 
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   55 
                 
               
             
           
         
       
     
     A desired high pressure compressor pressure ratio, r p   _   hp   _   cmp   _   des , is equal to the desired compressor outlet pressure, P cmpo   _   des , divided by the desired compressor interstage pressure, P cmp   _   inter   _   des , as shown below in EQN. 56: 
     
       
         
           
             
               
                 
                   
                     r 
                     
                       p_hp 
                       ⁢ 
                       _cmp 
                       ⁢ 
                       _des 
                     
                   
                   = 
                   
                     
                       P 
                       cmpo_des 
                     
                     
                       P 
                       
                         cmp_inter 
                         ⁢ 
                         _des 
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   56 
                 
               
             
           
         
       
     
     A desired low pressure compressor pressure ratio, r p   _   lp   _   cmp   _   des , is equal to the desired compressor interstage pressure, P cmp   _   inter   _   des , divided by the compressor inlet pressure, P cmpi , as shown below in EQN. 57: 
     
       
         
           
             
               
                 
                   
                     r 
                     
                       p_lp 
                       ⁢ 
                       _cmp 
                       ⁢ 
                       _des 
                     
                   
                   = 
                   
                     
                       P 
                       
                         cmp_inter 
                         ⁢ 
                         _des 
                       
                     
                     
                       P 
                       cmpi 
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   57 
                 
               
             
           
         
       
     
     A desired high pressure compressor delta temperature, ΔT hp   _   cmp   _   des , is calculated using the ratio of specific heats, k, and a high pressure compressor efficiency, ε hp   _   cmp , as shown below in EQN. 58. The efficiency, ε hp   _   cmp , is determined in the air system state observer and control system  405  using a compressor efficiency map. The map is a table lookup with corrected turbo speed on one axis and pressure ratio of the other axis. The efficiency is determined using the current pressure ratio instead of the desired pressure ratio. 
     
       
         
           
             
               
                 
                   
                     Δ 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     
                       T 
                       
                         hp_cmp 
                         ⁢ 
                         _des 
                       
                     
                   
                   = 
                   
                     
                       
                         r 
                         
                           p_hp 
                           ⁢ 
                           _cmp 
                           ⁢ 
                           
                             _des 
                             
                               
                                 ( 
                                 
                                   k 
                                   - 
                                   1 
                                 
                                 ) 
                               
                               / 
                               k 
                             
                           
                         
                       
                       - 
                       1 
                     
                     
                       ɛ 
                       hp_cmp 
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   58 
                 
               
             
           
         
       
     
     A desired low pressure compressor delta temperature, ΔT lp   _   cmp   _   des , is calculated using the ratio of specific heats and a low pressure compressor efficiency, ε lp   _   cmp , as shown below in EQN. 59: 
     
       
         
           
             
               
                 
                   
                     Δ 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     
                       T 
                       
                         
                           l 
                           ⁢ 
                           p_cmp 
                         
                         ⁢ 
                         _des 
                       
                     
                   
                   = 
                   
                     
                       
                         r 
                         
                           
                             p_l 
                             ⁢ 
                             p 
                           
                           ⁢ 
                           _cmp 
                           ⁢ 
                           
                             _des 
                             
                               
                                 ( 
                                 
                                   k 
                                   - 
                                   1 
                                 
                                 ) 
                               
                               / 
                               k 
                             
                           
                         
                       
                       - 
                       1 
                     
                     
                       ɛ 
                       
                         l 
                         ⁢ 
                         p_cmp 
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   59 
                 
               
             
           
         
       
     
     A desired compressor power, {dot over (W)} cmp   _   des , is equal to the desired compressor mass flow, {dot over (m)} cmp   _   des , multiplied by the specific heat at constant pressure, C p , multiplied by the desired low pressure compressor delta temperature, ΔT lp   _   cmp , plus the desired high pressure compressor delta temperature, ΔT hp   _   cmp , as shown below in EQN. 60:
 
 {dot over (W)}   cmp   _   des   ={dot over (m)}   cmp   _   des   ·C   p ·(Δ T   lp   _   cmp   +ΔT   hp   _   cmp )  EQN. 60
 
     The desired turbine power, {dot over (W)} trb   _   des , is set equal to the desired compressor power, {dot over (W)} cmp   _   des , as shown below in EQN. 61.
 
 {dot over (W)}   trb   _   des   ={dot over (W)}   cmp   _   des ,  EQN. 61
 
     It should be noted that, although EQN. 61 appears to indicate no mechanical losses, mechanical losses were previously accounted for in the turbine efficiency maps used in EQNS. 58 and 59. 
     The EGR cooler and valve model module  925  receives the desired EGR mass flow for slow control, {dot over (m)} egr   _   slow   _   des , as well as the desired intake manifold pressure, P im   _   des , an EGR cooler mass flow correction factor, CF egrc , and an EGR valve mass flow correction factor, CF egrv , An exhaust manifold pressure minimum, P em   _   min , to achieve the desired EGR mass flow for slow control, {dot over (m)} egr   _   slow   _   des ′ is determined using EQNS. 25 and 26. EQN. 26 is used to find the desired EGR cooler outlet pressure, P egrco   _   des , that provides flow equal to the desired EGR mass flow for slow control, {dot over (m)} egr   _   slow   _   des . This calculation is done with the EGR valve position at its maximum, or slightly below the maximum to provide some reserve for control. In some embodiments, an iterative process can be used to find the solution. EQN. 25 is then used to find the exhaust manifold pressure minimum, P em   _   min . In some embodiments, an iterative process can also be used to find this solution. 
     A desired exhaust manifold pressure, P em   _   des , is then calculated by adding the exhaust manifold pressure minimum, P em   _   min , and desired exhaust manifold pressure offset, ΔP em   _   des , the result of which is limited to the exhaust manifold pressure maximum, P em   _   max , as shown below in EQN. 62. The exhaust manifold pressure maximum, P em   _   max , is a calculated parameter that provides protection from high exhaust manifold pressure, as well as high engine delta pressure. High exhaust manifold pressure may cause damage to gaskets, seals, and the EGR cooler  665 . Engine delta pressure is the difference between intake manifold pressure and exhaust manifold pressure. If the exhaust manifold pressure exceeds the intake manifold pressure by a large amount, the exhaust valves may be pushed open during the intake stroke of the engine  250 . Such a condition may affect combustion and could damage the engine and should be avoided.
 
 P   em   _   des =minimum( P   em   _   min   +ΔP   em   _   des   ,P   em   _   max )  EQN. 62
 
     In some embodiments, it is desirable to filter the desired exhaust manifold pressure, P em   _   des , to reduce actuator movement. A first order filter similar to that provided below in EQN. 75 can be used. 
     The desired exhaust manifold pressure, P em   _   des , is provided to the exhaust pressure control module  935 . The exhaust pressure control module  935  also receives the mass flow out of cylinders, {dot over (m)} cylso , the EGR mass flow, {dot over (m)} egr , and the exhaust manifold pressure, P em . 
     A feed forward low pressure turbine mass flow, {dot over (m)} lp   _   trb   _   ff , is equal to the mass flow out of cylinders, {dot over (m)} cylso  minus the EGR mass flow, {dot over (m)} egr , as shown below in EQN. 63:
 
 {dot over (m)}   lp   _   trb   _   ff   ={dot over (m)}   cylso   −{dot over (m)}   egr   EQN. 63
 
     A closed loop low pressure turbine mass flow, {dot over (m)} lp   _   trb   _   cl , is equal to an exhaust manifold pressure proportional gain, K p   _   em , multiplied by the difference between the desired exhaust manifold pressure, P em   _   des  and the exhaust manifold pressure, P em , as shown below in EQN. 64:
 
 m   lp   _   trb   _   cl   =K   p   _   em ·( P   em   −P   em   _   des )  EQN. 64
 
     A low pressure turbine mass flow setpoint, {dot over (m)} lp   _   trb   _   sp , is then equal to the sum of the feed forward low pressure turbine mass flow, {dot over (m)} lp   _   trb   _   ff , and the closed loop low pressure turbine mass flow, {dot over (m)} lp   _   trb   _   cl , as shown below in EQN. 65:
 
 {dot over (m)}   lp   _   trb   _   sp   ={dot over (m)}   lp   _   trb   _   ff   +{dot over (m)}   lp   _   trb   _   cl   EQN. 65
 
     The term “setpoint” is used as opposed to the term “desired” in EQN. 65 because a subsequent control step in the turbine and wastegate model module  940  determines a desired mass flow that is achievable and as close as possible to the setpoint of EQN. 65. 
     The turbine and wastegate model module  940  receives the low pressure turbine mass flow setpoint, {dot over (m)} lp   _   trb   _   sp , and the desired turbine power, {dot over (W)} trb   _   des , as well as a variety of other parameters. The turbine and wastegate model module  940  is used to determine a desired low pressure turbine mass flow, {dot over (m)} lp   _   trb   _   des , a desired turbine outlet pressure, P trbo   _   des , a desired turbine outlet temperature, T trbo   _   des , and a desired wastegate position, u wg   _   des . Turbine mass flow and efficiency are determined using turbine maps, temperature change across the turbine is calculated using the pressure ratio and efficiency, power is calculated using mass flow and temperature change, and wastegate mass flow is determined using EQN. 29. A three-dimensional search is used to find the states that provide the desired turbine power, {dot over (W)} trb   _   des , and achieve the low pressure turbine mass flow setpoint, {dot over (m)} lp   _   trb   _   sp . 
     The first level of the search evaluates different desired turbine outlet pressures, P trbo   _   des  with the goal of achieving the desired turbine power, {dot over (W)} trb   _   des . The first level of the search is shown in and described with respect to a process  1000  in  FIG. 9 . During each iteration of the process  1000 , a second level search is performed to evaluate different desired wastegate positions, u wg   _   des , with the goal of achieving the desired low pressure turbine mass flow, {dot over (m)} lp   _   trb   _   des . The second level of the search is shown in and described with respect to a process  1100  in  FIG. 10 . During each iteration of the process  1100 , a third level search is performed to evaluate different turbine interstage pressures, P trb   _   inter , with the goal of achieving a low pressure turbine mass flow, {dot over (m)} lp   _   trb , equal to the sum of a high pressure turbine mass flow, {dot over (m)} hp   _   trb , and wastegate mass flow, {dot over (m)} wg . During the third level search, the turbine maps are used to determine mass flow, efficiency, temperature, and power. The third level search applies to two-stage turbochargers. With a single turbocharge, these calculations would be performed once for each turbine outlet pressure and wastegate valve position combination. The third level of the search is shown in and described with respect to a process  1200  in  FIG. 11 . 
     The process  1000  of  FIG. 9  begins with receiving the desired turbine power, {dot over (W)} trb   _   des , the exhaust manifold pressure, P em , and the DOC inlet pressure, P doci , at step  1005 . In some embodiments, an after-treatment system inlet pressure is used. At step  1010 , a delta pressure across the turbine and the exhaust throttle, ΔP trb   _   et , is calculated as the difference between the exhaust manifold pressure, P em , and the DOC inlet pressure, P doci , as shown below in EQN. 66:
 
Δ P   trb   _   et   =P   em   −P   doci   EQN. 66
 
     Also at step  1010 , a first factor, Factor1, and a factor adjustment, FactorAdj1, are respectively set to the values for the previous Factor1, PreviousFactor1, and an initial factor adjustment, FactorAdjInit, for variable i=0. At step  1015 , the variable, i, is compared to a maximum value for the variable, i max , which corresponds to a number of iterations for the search. If the variable, i, is less than i max , the process  1000  proceeds to step  1020 . 
     At step  1020 , a desired turbine output pressure, P trbo   _   des , is calculated as the sum of the DOC inlet pressure, P doci , and the product of Factor1 and the delta pressure across the turbine and the exhaust throttle, ΔP trb   _   et , A as shown below in EQN. 67:
 
 P   trb   _   des   =P   doci +(Factor1·Δ P   trb   _   et )  EQN. 67
 
     At step  1020 , FactorAdj1 is also reset to a value of FactorAdj1 divided by 2. At step  1025 , a desired wastegate position, u wg   _   des , a low pressure turbine mass flow, {dot over (m)} lp   _   trb , a turbine power, {dot over (W)} trb , and a turbine outlet temperature, T trbo , are calculated, as is described in more detail below with respect to  FIG. 10  and process  1100 . At step  1030 , the desired turbine power, {dot over (W)} trb   _   des , is compared to the turbine power, {dot over (w)} trb , calculated in step  1025 . If the desired turbine power, {dot over (W)} trb     —des   , is greater than the turbine power, {dot over (W)} trb , the process  1000  proceeds to step  1035  where Factor1 is updated to a value of Factor1 plus FactorAdj1, and the variable, i, is updated to a value of i+1 (step  1040 ). If the desired turbine power, {dot over (W)} trb   _   des ′ is not greater than the turbine power, {dot over (W)} trb , the process  1000  proceeds to step  1045  where Factor1 is updated to a value of Factor1 minus FactorAdj1, and the variable, i, is updated to a value of i+1 (step  1040 ). Steps  1015 - 1040  are repeated until the variable, i, is equal to i max . When the variable, i, is equal to i max  (i.e., no longer less than), the process proceeds to step  1050 . At step  1050 , the desired turbine outlet temperature, T trbo   _   des , is set to the calculated value of the turbine outlet temperature, T trbo , the desired low pressure turbine mass flow, {dot over (m)} lp   _   trb   _   des , is set to the value for the calculated low pressure turbine mass flow, {dot over (m)} lp   _   trb , and PreviousFactor1 is set equal to Factor1. The process  1000  then outputs the desired turbine outlet pressure, P trbo   _   des , the desired turbine outlet temperature, T trbo   _   des , the desired wastegate position, u wg   _   des , and the desired low pressure turbine mass flow, {dot over (m)} lp   _   trb   _   des . The process  1000  can then be executed again by the ECU  200 . 
     The process  1100  of  FIG. 10  begins with receiving the wastegate maximum position, u wg   _   max , and the low pressure turbine mass flow setpoint, {dot over (m)} lp   _   trb   _   sp , at step  1105 . At step  1110 , a second factor, Factor2, and a second factor adjustment, FactorAdj2, are respectively set to the values for the previous Factor2, PreviousFactor2, and an initial factor adjustment, FactorAdjInit, for variable j=0. As step  1115 , the variable, j, is compared to a maximum value for the variable, j max , which corresponds to a number of iterations for the search. If the variable, j, is less than j max , the process  1100  proceeds to step  1120 . 
     At step  1120 , a desired wastegate position, u wg   _   des , is calculated as the product of Factor2 and the wastegate maximum position, u wg   _   max , as shown below in EQN. 68:
 
 u   wg   _   des =Factor2· u   wg   _   max   EQN. 68
 
     At step  1120 , FactorAdj2 is also reset to a value of FactorAdj2 divided by 2. At step  1125 , a low pressure turbine mass flow, {dot over (m)} lp   _   trb , a turbine power, {dot over (W)} trb , and a turbine outlet temperature, T trbo , are calculated, as is described in more detail below with respect to  FIG. 11  and process  1200 . At step  1130 , the low pressure turbine mass flow setpoint, {dot over (m)} lp   _   trb   _   sp , is compared to the low pressure turbine mass flow, {dot over (m)} lp   _   trb , calculated in step  1125 . If the low pressure turbine mass flow, {dot over (m)} lp   _   trb , is greater than the low pressure turbine mass flow setpoint, {dot over (m)} lp   _   trb   _   sp , the process  1100  proceeds to step  1135  where Factor2 is updated to a value of Factor2 plus FactorAdj2, and the variable, j, is updated to a value of j+1 (step  1140 ). If the low pressure turbine mass flow, {dot over (m)} lp   _   trb , is not greater than the low pressure turbine mass flow setpoint, {dot over (m)} lp   _   trb   _   sp , the process  1100  proceeds to step  1145  where Factor2 is updated to a value of Factor2 minus FactorAdj2, and the variable, j, is updated to a value of j+1 (step  1140 ). Steps  1115 - 1140  are repeated until the variable, j, is equal to j max . When the variable, j, is equal to j max  (i.e., no longer less than), the process proceeds to step  1150 . At step  1150 , PreviousFactor2 is set equal to Factor2. The process  1100  then outputs the turbine outlet temperature, T trbo , the desired wastegate position, u wg   _   des , the low pressure turbine mass flow, {dot over (m)} lp   _   trb , and the turbine power, {dot over (W)} trb . The process  1100  can then be executed again by the ECU  200 . 
     The process  1200  of  FIG. 11  begins with receiving a high pressure turbocharge speed, N hpt , a low pressure turbocharge speed, N lpt , the exhaust manifold pressure, P em , the exhaust manifold temperature, T em , the desired turbine outlet pressure, P trbo   _   des , and the desired wastegate position, u wg   _   des , at step  1205 . At step  1210 , a delta turbine pressure, ΔP trb , is calculated as the difference between the exhaust manifold pressure, P em , and the desired turbine outlet pressure, P trbo   _   des , as shown below in EQN. 69:
 
Δ P   trb   =P   em   −P   trbo   _   des   EQN. 69
 
     At step  1210 , a third factor, Factor3, and a third factor adjustment, FactorAdj3, are respectively set to the values for the previous Factor3, PreviousFactor3, and an initial factor adjustment, FactorAdjInit, for variable k=0. As step  1215 , the variable, k, is compared to a maximum value for the variable, k max , which corresponds to a number of iterations for the search. If the variable, k, is less than k max , the process  1200  proceeds to step  1220 . 
     At step  1220 , an interstage turbine pressure, P trb   _   inter  is calculated as the sum of the desired turbine outlet pressure, P trbo   _   des , and the product of Factor3 and the delta turbine pressure, ΔP trb , as shown below in EQN. 70:
 
 P   trb   _   inter   =P   trbo   _   des +(Factor3·Δ P   trb )  EQN. 70
 
     At step  1220 , FactorAdj3 is also reset to a value of FactorAdj3 divided by 2. At step  1225 , a low pressure turbine mass flow, {dot over (m)} lp   _   trb , a high pressure turbine mass flow, {dot over (m)} hp   _   trb , a turbine outlet temperature, T trbo , an interstage turbine temperature, T trb   _   inter , and a wastegate mass flow, {dot over (m)} wg , are calculated using the above-referenced turbine maps. At step  1230 , the low pressure turbine mass flow, m lp   _   trb , is compared to the sum of the high pressure turbine mass flow, {dot over (m)} hp   _   trb , and the wastegate mass flow, {dot over (m)} wg , calculated in step  1225 . If the sum of the high pressure turbine mass flow, {dot over (m)} hp   _   trb , and the wastegate mass flow, {dot over (m)} wg , is greater than the low pressure turbine mass flow, {dot over (m)} lp   _   trb , the process  1200  proceeds to step  1235  where Factor3 is updated to a value of Factor3 plus FactorAdj3, and the variable, k, is updated to a value of k+1 (step  1240 ). If sum of the high pressure turbine mass flow, {dot over (m)} hp   _   trb , and the wastegate mass flow, {dot over (m)} wg , is not greater than the low pressure turbine mass flow, {dot over (m)} lp   _   trb , the process  1200  proceeds to step  1245  where Factor3 is updated to a value of Factor3 minus FactorAdj3, and the variable, k, is updated to a value of k+1 (step  1240 ). Steps  1215 - 1240  are repeated until the variable, k, is equal to k max . When the variable, k, is equal to k max  (i.e., no longer less than), the process  1200  proceeds to step  1250 . At step  1250 , the high pressure turbine power, {dot over (W)} hp   _   trb , and the low pressure turbine power, {dot over (W)} trb , are calculated, and PreviousFactor3 is set equal to Factor3. Turbine power, {dot over (W)} trb , is also calculated as the sum of the low pressure turbine power, {dot over (W)} lp   _   trb , and the high pressure turbine power, {dot over (W)} hp   _   trb , as shown below in EQN. 71:
 
 {dot over (W)}   trb   ={dot over (W)}   hp   _   trb   +{dot over (W)}   lp   _   trb   EQN. 71
 
     The process  1200  then outputs the turbine outlet temperature, T trbo , the low pressure turbine mass flow, {dot over (m)} lp   _   trb  and the turbine power, {dot over (w)} trb (step  1255 ). The process  1200  can then be executed again by the ECU  200 . 
     With reference once again to  FIG. 8 , the exhaust throttle model module  945  receives the desired low pressure turbine mass flow, {dot over (m)} lp   _   trb   _   des , the desired turbine outlet pressure, P trbo   _   des , the desired turbine outlet temperature, T trbo   _   des , as well as a turbine mass flow correction factor, CF trb , and a DOC inlet pressure, P doci . The desired exhaust throttle position, u et   _   des , is determined using the desired turbine outlet pressure, P trbo   _   des , the desired turbine outlet temperature, T trbo   _   des , and the DOC inlet pressure, P doci , in EQN. 28. EQN. 28 can be rewritten to solve for the exhaust throttle discharge coefficient, C d   _   et , and a table with an input of the exhaust throttle discharge coefficient, C d   _   et , and output of exhaust throttle position, u et , is used to find the desired exhaust throttle position, u et   _   des . In some embodiments, an effective area, which is equal to area times discharge coefficient, is used to determine desired exhaust throttle position, U et   _   des . This technique eliminates an area calibration parameter and uses a table with effective area as the input and position as the output. 
     The wastegate solenoid control module  950  of  FIG. 8  is illustrated in more detail in  FIG. 12 . The wastegate solenoid control module  950  includes a wastegate delta pressure force module  1300 , a wastegate position to actuator force module  1305 , an actuator model  1310 , an actuator force to wastegate position module  1315 , and a solenoid control module  1320 . The wastegate solenoid control module  950  receives the desired wastegate position, U wg   _   des , from the turbine and wastegate model module  940 , as well as an exhaust manifold pressure, P em , an intake manifold pressure, P im , and a barometric pressure, P baro . A wastegate force from delta pressure, F wg   _   dp , is calculated in the wastegate delta pressure force module  1300  by taking the difference between the exhaust manifold pressure, P em , and turbine interstage pressure, P trb   _   inter , and multiplying the difference by wastegate area, A wg , as shown below in EQN. 72:
 
 F   wg   _   dp =( P   em   −P   trb   _   inter )· A   wg   EQN. 72
 
     A desired wastegate actuator force, F wg   _   act   _   des , is calculated in the wastegate position to actuator force module  1305  by: (1) calculating a force from actuator spring compression, which is the desired wastegate position, u wg   _   des , multiplied by wastegate actuator displacement maximum, d wg   _   act   _   max , multiplied by a wastegate actuator spring constant, k wg   _   act   _   spring ; (2) subtracting the wastegate force from delta pressure, F wg   _   dp , adjusted for actuator linkage (i.e., multiply by pivot arm radius to wastegate valve, r wg   _   valve , and divide by pivot arm radius to wastegate actuator, r wg   _   act ); and (3) subtracting the wastegate spring preload, F wg   _   preload  as shown below in EQN. 73: 
     
       
         
           
             
               
                 
                   
                     F 
                     
                       wg_act 
                       ⁢ 
                       _des 
                     
                   
                   = 
                   
                     
                       
                         u 
                         wg_des 
                       
                       · 
                       
                         d 
                         
                           wg_act 
                           ⁢ 
                           _max 
                         
                       
                       · 
                       
                         k 
                         
                           wg_act 
                           ⁢ 
                           _spring 
                         
                       
                     
                     - 
                     
                       
                         ( 
                         
                           
                             r 
                             wg_valve 
                           
                           
                             r 
                             wg_act 
                           
                         
                         ) 
                       
                       · 
                       
                         F 
                         wg_dp 
                       
                     
                     - 
                     
                       F 
                       wg_preload 
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   73 
                 
               
             
           
         
       
     
     The wastegate spring preload, F wg   _   preload , will be a negative number, indicating compression with the sign convention shown in EQN. 67. The spring preload, F wg   _   preload , tends to hold the wastegate valve  615  closed while the delta pressure across the wastegate valve  615  tends to push it open. A desired wastegate actuator pressure, P wg   _   act   _   des , is calculated by dividing the desired wastegate actuator force, F wg   _   act   _   des , by the wastegate actuator area, A wg   _   act , and adding barometric pressure, P baro , while limiting to intake manifold pressure, P im , as shown below in EQN. 74: 
     
       
         
           
             
               
                 
                   
                     P 
                     
                       wg_act 
                       ⁢ 
                       _des 
                     
                   
                   = 
                   
                     minimum 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     
                       ( 
                       
                         
                           
                             P 
                             baro 
                           
                           + 
                           
                             
                               F 
                               
                                 wg_act 
                                 ⁢ 
                                 _des 
                               
                             
                             
                               A 
                               wg_act 
                             
                           
                         
                         , 
                         
                           P 
                           im 
                         
                       
                       ) 
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   74 
                 
               
             
           
         
       
     
     A wastegate actuator pressure, P wg   _   act , is modeled using a first order filter with desired wastegate actuator pressure, P wg   _   act   _   des , as the input, as shown below in EQN. 75:
 
 P   wg   _   act   =P   wg   _   act   _   des +( P   wg   _   act   _   previous   −P   wg   _   act   _   des )· e   −T     s     /τ     wg     EQN. 75
 
where T s  is the software task time step and τ wg  is the wastegate actuator pressure time constant. A wastegate actuator force, F wg   _   act , is then calculated by taking the difference between the wastegate actuator pressure, P wg   _   act , and the barometric pressure, P baro , and multiplying by wastegate actuator area, A wg   _   act , as shown below in EQN. 76:
 
 F   wg   _   act =( P   wg   _   act   −P   baro )· A   wg   _   act   EQN. 76
 
     A wastegate actuator force maximum, F wg   _   act   _   max , is calculated in the actuator model module  1310  by taking the difference between intake manifold pressure, P im , and barometric pressure, and multiplying by wastegate actuator area, A wg   _   act  as shown below in EQN. 77:
 
 F   wg   _   act   _   max =( P   im   −P   baro )· A   wg   _   act   EQN. 77
 
     A wastegate position estimate, u wg , is calculated in the actuator model module  1310  by rewriting EQN. 73 and using the wastegate actuator force, F wg   _   act , as shown below in EQN. 78: 
     
       
         
           
             
               
                 
                   
                     u 
                     wg 
                   
                   = 
                   
                     
                       
                         F 
                         wg_act 
                       
                       + 
                       
                         
                           ( 
                           
                             
                               r 
                               wg_valve 
                             
                             
                               r 
                               wg_act 
                             
                           
                           ) 
                         
                         · 
                         
                           F 
                           wg_dp 
                         
                       
                       + 
                       
                         F 
                         wg_preload 
                       
                     
                     
                       
                         d 
                         
                           wg_act 
                           ⁢ 
                           _max 
                         
                       
                       · 
                       
                         k 
                         
                           wg_act 
                           ⁢ 
                           _spring 
                         
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   78 
                 
               
             
           
         
       
     
     A wastegate position maximum, u wg   _   max , is calculated using a similar equation but with the wastegate actuator force maximum, F wg   _   act   _   max , as shown below in EQN. 79: 
     
       
         
           
             
               
                 
                   
                     u 
                     wg_max 
                   
                   = 
                   
                     
                       
                         F 
                         
                           wg_act 
                           ⁢ 
                           _max 
                         
                       
                       + 
                       
                         
                           ( 
                           
                             
                               r 
                               wg_valve 
                             
                             
                               r 
                               wg_act 
                             
                           
                           ) 
                         
                         · 
                         
                           F 
                           wg_dp 
                         
                       
                       + 
                       
                         F 
                         wg_preload 
                       
                     
                     
                       
                         d 
                         
                           wg_act 
                           ⁢ 
                           _max 
                         
                       
                       · 
                       
                         k 
                         
                           wg_act 
                           ⁢ 
                           _spring 
                         
                       
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   79 
                 
               
             
           
         
       
     
     The relationship between wastegate solenoid current and actuation pressure is defined using a table. The output of the table is a feed forward wastegate solenoid current, i wg   _   sol   _   ff . The x-input to the table is intake manifold pressure, P im , and the y-input to the table is a normalized pressure that is calculated by taking the difference between the desired wastegate actuator pressure, P wg   _   act   _   des , and barometric pressure, P baro , and then dividing by the difference between intake manifold pressure, P im , and barometric pressure, P baro , as shown below in EQN. 80: 
     
       
         
           
             
               
                 
                   
                     i 
                     
                       wg_sol 
                       ⁢ 
                       _ff 
                     
                   
                   = 
                   
                     WastegateSolenoidCurrentTable 
                     ⁢ 
                     
                         
                     
                     ⁢ 
                     
                       ( 
                       
                         
                           P 
                           im 
                         
                         , 
                         
                           
                             
                               P 
                               
                                 wg_act 
                                 ⁢ 
                                 _des 
                               
                             
                             - 
                             
                               P 
                               baro 
                             
                           
                           
                             
                               P 
                               im 
                             
                             - 
                             
                               P 
                               baro 
                             
                           
                         
                       
                       ) 
                     
                   
                 
               
               
                 
                   EQN 
                   . 
                   
                       
                   
                   ⁢ 
                   80 
                 
               
             
           
         
       
     
     A wastegate solenoid proportional term, i wg   _   sol   _   prop , is calculated by multiplying the wastegate solenoid proportional gain, K p   _   wg , by the difference between the exhaust manifold pressure, P em  (estimate), and an exhaust manifold pressure sensor measurement, P em   _   sens , as shown below in EQN. 81:
 
 i   wg   _   sol   _   prop   =K   p   _   wg ·( P   em   −P   em   _   sens )  EQN. 81
 
     Numeric integration is used to update a wastegate solenoid integral term, i wg   _   sol   _   int . At each time step in the software, the wastegate solenoid integral term, i wg   _   sol   _   int , is updated by adding to the previous value, i wg   _   sol   _   int   _   previous , to the result of wastegate solenoid integral gain, K i   _   wg , multiplied by the difference between exhaust manifold pressure, P em , and the exhaust manifold pressure sensor measurement, P em   _   sens , as shown below in EQN. 82:
 
 i   wg   _   sol   _   int   =i   wg   _   sol   _   int   _   previous   +K   i   _   wg ·( P   em   −P   em   _   sens )  EQN. 82
 
     The desired wastegate solenoid current, i wg   _   sol   _   des , is equal to the sum of feed forward wastegate solenoid current, i wg   _   sol   _   ff , the wastegate solenoid current proportional term, i wg   _   sol   _   prop , and the wastegate solenoid current integral term, i wg   _   sol   _   int , as shown below in EQN. 83:
 
 i   wg   _   sol   _   des   =i   wg   _   sol   _   ff   +i   wg   _   sol   _   prop   +i   wg   _   sol   _   int   EQN. 83
 
     The wastegate solenoid current integral term, i wg   _   sol   _   int , the desired EGR valve position, u egr   _   des , and the desired exhaust throttle valve position, U et   _   des , are then provided to the engine  250  to control the operation of the engine  250 . 
     Thus, this disclosure provides, among other things, an air system state observer and control system including feed forward control for controlling the operation of an EGR valve, an exhaust throttle valve, and a wastegate valve for a diesel engine. Various features and advantages are set forth in the following claims.