# Model Predictive Control of Diesel Engine Emissions Based on Neural Network
Modeling

Jiadi Zhang1, Xiao Li1, Ilya Kolmanovsky1, Munechika Tsutsumi2, and Hayato
Nakada2 1J. Zhang, Xiao and I. Kolmanovsky are with the Department of
Aerospace Engineering, University of Michigan, Ann Arbor, MI 48109, USA
<EMAIL_ADDRESS>Nakada and M. Tsutsumi are with Hino Motors,
Ltd., Tokyo 191-8660, Japan<EMAIL_ADDRESS>
###### Abstract

This paper addresses the control of diesel engine nitrogen oxides (NOx) and
Soot emissions through the application of Model Predictive Control (MPC). The
developments described in the paper are based on a high-fidelity model of the
engine airpath and torque response in GT-Power, which is extended with a
feedforward neural network (FNN)-based model of engine out (feedgas) emissions
identified from experimental engine data to enable the controller co-
simulation and performance verification. A Recurrent Neural Network (RNN) is
then identified for use as a prediction model in the implementation of a
nonlinear economic MPC that adjusts intake manifold pressure and EGR rate set-
points to the inner loop airpath controller as well as the engine fueling
rate. Based on GT-Power engine model and FNN emissions model, the closed-loop
simulations of the control system and the plant model, over different driving
cycles, demonstrate the capability to shape engine out emissions response by
adjusting weights and constraints in economic MPC formulation.

##  I Introduction

Important priorities in diesel engine control development include the
reduction of engine emissions and establishing a streamlined and systematic
controller implementation and calibration process [1, 2]. Further
opportunities to address these priorities emerge due to rapid advances in
machine learning, artificial intelligence, and optimization-based control
methods while exploiting growing onboard computing power[3, 4].

This paper focuses on the interplay between neural networks-based modeling and
Model Predictive Control (MPC). A high-fidelity model of the engine airpath
and torque response is first augmented with a feedforward neural network
(FNN)-based model of engine out (feedgas) emissions. The FNN is identified
from experimental engine data, enabling controller co-simulation and
performance verification. While the FNN approach to modeling engine emissions
has also been adopted in our previous work on LPV MPC [5], in this paper a
systematic methodology is proposed and used to tune hyperparameters of the FNN
(such as the learning rate and momentum constants in the stochastic gradient
descent) to enhance the emissions prediction accuracy. The process we used in
informing a single training data set for FNN by merging data sets resulting
from open-loop steady-state dynamometer experiments and closed-loop transient
experiments (with an existing baseline controller) has also been modified and
we report it in detail.

A Recurrent Neural Network (RNN) is then identified for use as an MPC
prediction model. This RNN has a small number of inputs representing signals
available for engine control and is simpler as compared to FNN, thereby
facilitating MPC computational implementation. We adopt a “modular”
identification process that exploits an abstraction of the airpath controller
to uncouple the identification of the RNN model for emissions from the need to
have a fully calibrated airpath controller.

The economic MPC (EMPC) is designed next based on the RNN to adjust intake
pressure and EGR rate set-points (targets) to the inner loop airpath
controller as well as the fueling rate. The overall control system (see Figure
1) integrates this outer-loop EMPC with an inner-loop MPC for the airpath
system that we refer to as the airpath MPC. Such a hierarchical MPC
architecture, which is the focus in this paper, is adopted following [4],
where its capability to improve transient engine control and reduce emissions
has been demonstrated. However, our implementation of EMPC is novel as it
exploits RNN as the prediction model, and a different formulation of the cost
and constraints which explicitly reflect predicted $NOx$ and $Soot$ feedgas
emissions. The closed-loop simulations of the designed controller and the
plant model based on GT-Power engine model and FNN emissions model over FTP
and WHTC drive cycles that will be reported demonstrate the capability to
shape engine out emissions response by adjusting weights and constraints in
EMPC formulation.

The airpath MPC is used to follow the intake manifold pressure and EGR rate
set-points computed by EMPC. The airpath MPC adopted in this paper exploits a
combination of feedforward MPC and feedback rate-based MPC following [4, 6] to
control Exhaust Gas Recirculation (EGR) valve and Variable Geometry
Turbocharger (VGT) vane actuators of the engine (see Figure 2). In automotive
applications, a feedback tracking controller is typically integrated with a
feedforward controller which relies on look-up tables for set-points and
actuator positions to enhance transient response ([7]). The utilization of an
MPC-based feedforward strategy [4, 6], as an alternative to a look-up table
based implementation, has demonstrated further improvements in closed-loop
transient response.

Figure 1: A high-level control architecture diagram.

The development of a different neural network-based MPC solution for diesel
engines is pursued in [8], where the focus is on control of engine fueling to
reduce emissions. Our paper is distinguished by its focus on a hierarchical
MPC architecture, where EMPC is used as a supervisor adjusting set-points to
the airpath MPC, concurrently with adjusting/limiting main injection fuel
quantity. We also exploit a relatively simple RNN architecture as the
prediction model in EMPC versus LSTM in [8].

The paper is organized as follows. The FNN and RNN emission modeling is
addressed in Section II. The EMPC design is described in Section III. Section
IV reports simulation results. Finally, Section V presents concluding remarks.

##  II Diesel Engine Modeling

The diesel engine schematics are shown in Figure 2 which illustrates the
primary engine components, including a cylinder block, intake manifold,
exhaust manifold, an Exhaust Gas Recirculation (EGR) system, and a variable
geometry turbocharger (VGT) consisting of a turbine with the adjustable guide
vanes and a compressor on the same shaft. The EGR system is used to reduce
oxides of nitrogen ($NOx$) emissions. It achieves this by actuating EGR valve
that recirculates the exhaust gas into the intake manifold ($w_{\tt egr}$).
Once in-cylinder, recirculated burnt gas acts as an inert gas, and hence
reduces peak in-cylinder temperatures and $NOx$ formation. However, excessive
EGR can lead to an increase in $Soot$ emissions and engine roughness. There
are strong dynamic interactions between EGR valve and VGT actuators in their
effect on engine variables. In particular, the flows through EGR valve and VGT
depend on the exhaust pressure which in turn is influenced by these flows.
Similarly, both of these actuators affect the intake manifold pressure and the
air-to-fuel ratio.

The airpath controller regulates the intake manifold pressure ($p_{\tt im}$)
and EGR rate ($\chi_{\tt egr}$) to set-points (target values), where the EGR
rate is defined by

$\chi_{\tt egr}=\frac{w_{\tt egr}}{w_{\tt egr}+w_{\tt c}},$ (1)

and where $w_{\tt egr}$ is the flow through the EGR valve and $w_{\tt c}$ is
the flow through the compressor. The intake manifold pressure and EGR rate
set-points, $p_{\tt im}^{\tt adj}$ and $\chi_{\tt egr}^{\tt adj}$,
respectively, are computed and provided to the airpath controller by the EMPC
controller.

Figure 2: Diesel engine with exhaust gas recirculation (EGR) and a variable
geometry turbocharger (VGT).

The starting point for the developments in this paper is a high-fidelity
diesel engine airpath model in GT-Power. This model represents the responses
of flows and pressures in different parts of the engine at a crankangle
resolution, and it has been validated against experimental data from engine
dynamometer testing. This model has been extended in our work by an engine
feedgas emissions model. For the latter, we used available data sets from
engine dynamometer testing and implemented an FNN.

###  II-A Data-driven Engine Feedgas Emissions Modeling

As in our previous work [5], we rely on a multi-layer FNN
$f_{\text{FNN}}(\cdot)$ to represent engine $NOx$ and $Soot$ emissions. The
schematics of this FNN are shown in Figure 3. The output of each layer is
defined as

$y_{i}=\sigma_{ReLU}\left(W_{i}y_{i-1}+b_{i}\right),~{}~{}i=1,\dots,4,$ (2)

where $W_{i}$ and $b_{i}$ are the network parameters of the $i$th layer while
$y_{0}\in\mathbb{R}^{10}$ and $y_{4}\in\mathbb{R}^{2}$ are the inputs and
predicted emissions outputs, respectively. Note that ReLU functions are used
in (2) due to their good empirical performance in various neural network
architectures, e.g., Residual Networks [9], Graph Neural Networks [10], and
Transformers [11].

Figure 3: Schematic of the developed multi-layer neural network diesel
emissions model.

The transient and steady-state dynamometer datasets encompass respectively,
$12001$ and $306$ data points. After selecting the inputs and removing
outliers as detailed in [5], a single data set for FNN training has been
formed where $i$th data point has the form $(y_{0}^{(i)},y_{4}^{(i)})$. Here
the $y_{0}^{(i)}$ corresponds to the measurements of injection pressure, main
injection timing, main injection fuel flow rate, engine torque output, engine
speed, intake manifold pressure, exhaust manifold pressure, mass air flow, EGR
position, and VGT position. The $y_{4}^{(i)}$ corresponds to the measurements
of the oxides of nitrogen ($NOx$) and $Soot$ emissions.

The merging of transient and steady-state dynamometer datasets deserved
additional consideration as the transient data set was collected with a
nominal (non-MPC type) controller running and contained points close to those
that would be encountered in closed-loop transient operation over the driving
cycle with Soot values varying only over a small range which was achieved by
fuel limiting. On the other hand, the steady-state dataset has resulted from
open-loop steady-state dynamometer mapping and contained actuator setting and
Soot values over a much larger range (see Figure 4). At the same time, these
points were from steady state engine operation in stabilized engine conditions
and many of the points with larger Soot values would not be encountered in
closed-loop operation once the controller has been calibrated.

Using all points for FNN training would have been preferable, at first glance.
However, in practice, it has resulted in an FNN model overemphasizing matching
peaks in Soot present in the steady-state data set and over-predicting Soot
peaks in the range expected during closed-loop operation. On the other hand,
developing the model only from a transient dataset would limit model
extrapolation ability and, later, the ability of the EMPC controller to
control Soot through adjustment of airpath set-points rather than only fueling
rate (and hence lead to worse drivability). Consequently, a compromise
approach was chosen where we removed steady-state data points with $Soot$
value larger than $20\%$ from the training data set.

Figure 4: Histogram of $Soot$ measurements with a distribution fit for (a)
steady-state data and (b) transient data

With the data set encompassing both transient and steady-state data,
$\mathcal{D}=\left\\{(y_{0}^{(i)},y_{4}^{(i)})\right\\}_{i}$, we now train an
FNN to represent a mapping from $y_{0}^{(i)}$ to $y_{4}^{(i)}$ that minimizes
a loss function, i.e., we solve the following optimization problem,

$\begin{array}[]{c}\min\limits_{\theta=\left\\{W_{j},b_{j}\right\\}_{j=1,\dots,4}}\mathcal{L}(\mathcal{D}|\theta),\\\
\mathcal{L}(\mathcal{D}|\theta)=\frac{1}{\left|\mathcal{D}\right|}\sum\limits_{i}\left\lVert
f_{\text{FNN}}(y_{0}^{(i)}|\theta)-y_{4}^{(i)}\right\rVert_{2}^{2},\end{array}$
(3)

where $\theta$ is the vector of FNN parameters (weights),
$\left|\mathcal{D}\right|$ is the number of data points in the dataset
$\mathcal{D}$, and $\mathcal{L}(\mathcal{D}|\theta)$ is the empirical mean-
squared error (MSE) between the actual outputs $y_{4}^{(i)}$ and the
predictions $f_{\text{FNN}}(y_{0}^{(i)})$.

For FNN training we use the Pytorch package[12]. The hyperparameters used in
neural network training are typically selected through trial and error. In
this work, we have developed a more systematic procedure to search for the
hyperparameter settings for the Batch Stochastic Gradient Descent (SGD)
algorithm with momentum. The Batch SGD algorithm admits the following
iterative form

$\begin{array}[]{c}\theta_{k+1}=\theta_{k}-\lambda d_{k},\\\
d_{k}=\nabla_{\theta_{k}}\mathcal{L}(\mathcal{D}_{k}|\theta_{k})+\rho
d_{k-1},\\\
d_{0}=\nabla_{\theta_{0}}\mathcal{L}(\mathcal{D}_{0}|\theta_{0}),\\\
\end{array}$ (4)

where the learning rate $\lambda$ and momentum $\rho$ are the hyperparameters,
and $k$ is the index of current iteration. Here
$\mathcal{D}_{k},k=0,1,2,\dots$ are equal-size (the size is named batch size)
and disjoint batch datasets such that $\mathcal{D}=\cup_{k}\mathcal{D}_{k}$.

To select the hyperparameters $(\rho,\lambda)$, as illustrated in Figure 5(a),
we first define a region of interest in the 2D hyperparameter plane
$\rho-\lambda$, and generate a coarse grid where each grid point is a
plausible choice of $(\rho,\lambda)$ values for FNN training. For each grid
point, we train an FNN using values of $(\rho,\lambda)$ at this grid for one
epoch on the training dataset. Based on the validation dataset, we calculate
the validation loss defined as the MSE between the actual and predicted
emissions values using the trained FNN.

We repeated the aforementioned procedure for all grid points, and the results
are presented in Figure 5. From Figure 5(a), we can identify three learning
rate values $\lambda=1\times 10^{-4},5.5\times 10^{-5},1\times 10^{-5}$ that
correspond to the smallest validation loss for all momentum values. After a
detailed examination of Figure 5(b) we observe that the choice of $\rho=0.9$
yields the lowest validation loss for all three desired learning rates. As a
result, we choose $(\rho,\lambda)=(0.9,1\times 10^{-4})$ as our initial FNN
training hyperparameter settings. We also set the learning rate decay to
$\gamma=0.5$ for every $100$ epoch (i.e., we multiply the learning rate by
$\gamma$ every $100$ epochs) and we, finally, train the FNN for $1000$ epochs
with the MSE loss function defined above and a batch size of $40$. Note that
the chosen value of $\gamma$ is fairly large to enable exploration of FNN
weight landscape during learning.

Figure 5: Visualization of validation loss versus different combinations of
momentum $\rho$ and learning rate $\lambda$: (a) Heatmap of validation loss
versus $(\rho,\lambda)$. (b) Validation loss versus $\rho$ for three desired
learning rates $\lambda$.

We compare the predicted emissions using our FNN with the actual dynamometer
measurements in the testing part of the data set in Figure 6. In Figure 6 and
subsequent figures, we are not able to report the $y$-axis values in order to
protect OEM proprietary data. For $NOx$ prediction, our FNN can achieve mean
absolute prediction errors of $14.67\rm ppm$ for transient data and $25.39\rm
ppm$ for steady-state data. For $Soot$ prediction, the mean absolute
prediction errors are $0.21\%$ for transient data and $0.72\%$ for steady-
state data, respectively. In Figure 6, our predictions plotted in blue dash
lines and crosses closely match the actual measurements (red lines and
circles). This demonstrates good accuracy of our FNN model.

Figure 6: The NN-based diesel emissions prediction performance of (a)
transient and (b) steady-state data against the actual dynamometer data.

###  II-B Emissions Control-oriented Modeling

To implement EMPC, a control-oriented model is needed for predicting the
emissions response over the MPC optimization horizon. In our previous work
[5], we used a linear parameter-varying model (LPV) as a control-oriented
model. In this paper, a Recurrent neural network (RNN) model is developed and
validated to improve the ability to predict the emissions. To address the
larger computational footprint of the RNN, we adopted a simple RNN
architecture with a small number of inputs, layers and neurons. In this model,
$NOx$ and $Soot$ are selected as the model states ($x$). The current values of
the $NOx$ and $Soot$ emission outputs are assumed to be measured or accurately
estimated in the ECU. Feedgas $NOx$ is often measured in diesel engines (even
for the purpose of OBD) while for $Soot$ an estimator (not necessarily the
same as our control-oriented RNN) or a sensor based on advances in sensor
technology is assumed (see e.g., [13]). The input ($u$) for the RNN model
encompasses the intake manifold pressure ($p_{\tt im}$), EGR rate ($\chi_{\tt
egr}$), engine speed ($N_{e}$) and fuel injection rate ($w_{\tt inj}$). To
that end, the prediction model has the following form,

$x_{k+1}=f_{\text{RNN}}(x_{k},u_{k}),$ (5)

where $k$ denotes the discrete time instant.

Figure 7 illustrates the adopted RNN model architecture with the two hidden
layers of size $15$ and $5$ neurons, respectively. The output of each layer is
defined by

$s_{i}=\sigma_{Tanh}\left(\tilde{W}_{i}s_{i-1}+\tilde{b}_{i}\right),~{}~{}i=1,2,3,$
(6)

where $\tilde{W}_{i}$ and $\tilde{b}_{i}$ are the network parameters of the
$i$th layer while $[s_{0,1};s_{0,2}]\in\mathbb{R}^{2}$ are emission states
(i.e., $x$), $s_{0,n}\in\mathbb{R}^{4}$ and $s_{3}\in\mathbb{R}^{2}$ are the
inputs $u$ and the predicted emissions outputs, respectively. Note that
hyperbolic tangent functions $Tanh$ are used in (6) rather than ReLU in (2) to
ensure sufficient regularity of the model for first and second derivatives to
be everywhere defined.

Figure 7: Schematics of the multi-layer Recurrent Neural Network-based
control-oriented model.

For identification of our RNN model, we use the data generated by a higher
fidelity model consisting of the diesel engine airpath model in GT-Power and
of FNN, which is used to predict $NOx$ and $Soot$ emissions based on GT-Power
airpath model outputs. The higher fidelity model is simulated over FTP and
WHTC transient cycles to generate the data for RNN identification.

The data generation procedure is summarized in Figure 8. The EGR valve and VGT
positions are computed from a look-up table as functions of engine speed and
fueling rate. Note that the airpath controller is not used as a part of this
simulation. Such an approach is beneficial in that it uncouples the
identification of RNN for EMPC from the need to have a fully calibrated
airpath controller, thereby facilitating a modularized controller development
process. The training of the RNN employs the minimization of Mean Square Error
(MSE) loss across the entire prediction horizon for each time step. This
prediction horizon is aligned with the one utilized in our subsequent control
simulation. The hyperparameters were tuned using the same process in Section
II-A. The data points used for training, validation, and testing have been
chosen in proportion to the ratio of 70%:15%:15%.

Figure 8: Data generation procedure for identification of control-oriented RNN
model of diesel emissions. Here $N_{e}$ is the engine speed, $p_{\tt im}$ is
the intake manifold pressure, $\chi_{\tt egr}$ is the EGR rate, and $w_{\tt
inj}$ is the fuel injection quantity.

Figure 9 compares the emissions predicted by the RNN model versus the FNN
model. These simulations are based on the last 15% data of the WHTC driving
cycle, which has not been used for RNN training. Both emission models are co-
simulated with the GT-Power airpath model and respond to the same input
trajectories of engine speed, fuel injection rate, target intake manifold
pressure, and target EGR rate. The trajectories of the target intake manifold
pressure and target EGR rate for these simulations were generated from look-up
tables that specify desired $p_{\tt im}$ and $\chi_{\tt egr}$ in steady-state
as functions of the engine speed and fuel injection rate.

The average errors in $NOx$ and $Soot$ prediction for the RNN model as
compared to the higher-fidelity FNN model are less than $43.3~{}ppm$ and
1.21%, respectively. Larger errors are observed in $Soot$ prediction Although
these transient errors could be reduced using higher complexity neural network
models, as we will illustrate in the following sections, the proposed
relatively simple RNN model effectively supports EMPC design.

Figure 9: The comparison between control-oriented RNN emissions model co-
simulated with the GT-Power model and higher fidelity FNN emissions model over
the last 15% of WHTC driving cycle: (a) $NOx$, and (b) $Soot$.

##  III Economic MPC Design for Control of Engine Emissions

The overall schematics of the control system considered in this paper are
shown in Figure 10. Given engine speed ($N_{\tt e}$) and fuel injection rate
target ($w_{\tt inj}^{trg}$), the outer-loop EMPC controller generates
adjusted target values for intake manifold pressure ($p_{\tt im}^{adj}$), EGR
rate ($\chi_{\tt egr}^{adj}$) and fuel injection command ($w_{\tt inj}^{adj}$)
to both reduce $NOx$ emissions and enforce the $Soot$ constraint. While the
fuel injection rate directly affects the engine operation, the adjusted intake
manifold pressure and EGR rate target values are passed to the airpath MPC.
The airpath MPC then coordinates the EGR valve and VGT positions to track
these adjusted targets.

The design and tuning of the airpath MPC have been detailed in [6]. Our
airpath MPC includes a feedforward (FF) MPC, to provide fast transient
response, and a feedback (FB) rate-based MPC that provides integral action and
ensures offset-free tracking.

Figure 10: The block diagram of the integrated emissions and airpath control
system.

In EMPC design, we use the model (5) as the prediction model but with the
input set to $u_{k}=[p_{\tt im}^{adj},~{}\chi_{\tt egr}^{adj},~{}w_{\tt
inj}^{adj}]^{\sf T}$, i.e., with intake manifold pressure, EGR rate and
fueling rate replaced by the airpath MPC set-points.

Rate-based MPC is used to ensure offset-free tracking and to compensate for
model mismatch. Its design and properties are well-understood in the linear
quadratic MPC case, see e.g., [14, 15]. For nonlinear MPC of diesel engines,
rate-based design has been considered in [16] where, under certain
assumptions, it was shown that the closed-loop system resulting from the rate-
based formulation maintains the desired equilibrium despite offsets. Our RNN-
based EMPC for emissions control also adopts a rate-based formulation.

First, in reference to the model (5), we define rate variables $\Delta x_{k}$
and $\Delta u_{k}$ as

$\Delta x_{k}=x_{k}-x_{k-1},\quad\Delta u_{k}=u_{k}-u_{k-1},$

that correspond to the increments in the state and control variables,
respectively. Then, according to the prediction model (5),

$\Delta x_{k+1}=x_{k+1}-x_{k}=f_{\text{RNN}}(x_{k},u_{k})-x_{k}.$ (7)

We let $x_{j|k}$ and $u_{j|k}$ denote the predicted state and control values
at time step $j,$ $0\leq j\leq N$, over the prediction horizon when the
prediction is made at the time step $k$. Then, to be able to impose
constraints on $x_{j|k}$ and $u_{j|k}$ and compute the MPC cost that penalizes
the rate of change of input, $\Delta u_{k}$, we define the augmented state
vector,

$x_{j|k}^{\tt ext}=\left[\begin{array}[]{cccc}\Delta x_{j|k}^{\sf
T},&x_{j-1|k}^{\sf T},&u_{j-1|k}^{\sf T}\end{array}\right]^{\sf T}.$

Using (7) it follows that

$\displaystyle x_{j+1|k}^{\tt
ext}=\begin{bmatrix}f_{\text{RNN}}(x_{j-1|k}+\Delta x_{j|k},u_{j-1|k}+\Delta
u_{j|k})-\\\
\quad\quad\quad\quad\quad\quad\quad\quad\quad\quad(x_{j-1|k}+\Delta
x_{j|k})\\\ x_{j-1|k}+\Delta x_{j|k}\\\ u_{j-1|k}+\Delta
u_{j|k}\end{bmatrix},$ (8)

where $\Delta u_{j|k}$ is the control input in the extended system (8).

The EMPC design takes into account safety and drivability, ensuring that the
fuel injection rate adheres to specified upper and lower limits, while also
addressing emission requirements such as $NOx$ reduction and $Soot$
constraints. At each time step, the following optimal control problem is
solved to optimize the sequence of set-points for the intake manifold
pressure, EGR rate, and fuel injection rate:

$\min_{\Delta u_{0|k},...,\Delta u_{N-1|k},\epsilon_{k}}J(\Delta
u,\epsilon,\rho)=\sum_{j=0}^{N}l(\Delta u_{j|k},\epsilon_{j|k},\rho_{k})$ (9a)
subject to $\displaystyle\Delta
x_{j+1|k}=x_{j+1|k}-x_{j|k}=f(x_{j|k},u_{j|k})-x_{j|k},$ (9b) $\displaystyle
u_{j|k}=u_{j-1|k}+\Delta u_{j|k},j={0},\ldots,N-1,$ (9c)
$\displaystyle{Soot}_{j|k}\leq{Soot}^{lim}+\epsilon_{j|k},j=1,\ldots,N,$ (9d)
$\displaystyle 0.9w_{\tt inj}^{trg}\leq{w_{\tt inj}^{adj}}_{j|k}\leq w_{\tt
inj}^{trg},j=0,\ldots,N-1,$ (9e) $\displaystyle\epsilon_{j|k}\geq
0,j=0,\ldots,N-1,$ (9f)

where $N$ is the prediction horizon and $\epsilon_{k}$ is the slack variable
introduced to avoid infeasibility of the $Soot$ constraints. The stage cost
function $l$ is defined as

$\displaystyle l(\Delta u,\epsilon,\rho)=$ $\displaystyle\alpha(p_{\tt
im}^{trg}(\rho)-p_{\tt im}^{adj})^{2}+\beta(\chi_{\tt
egr}^{trg}(\rho)-\chi_{\tt egr}^{adj})^{2}+$ $\displaystyle\gamma(w_{\tt
inj}^{trg}-w_{\tt inj}^{adj})+\eta{NOx}+\zeta\epsilon+\Delta u^{\sf T}R\Delta
u$

where $\alpha,\beta,\gamma,\eta,\zeta>0$ and $R>0$ are tuning parameters and
reflect tracking objectives for the intake manifold pressure target, EGR rate
target, and fuel injection rate, a penalty on $NOx$ value, a penalty to soften
the $Soot$ constraint to guarantee feasibility and a damping term. The cost
terms for fuel tracking, $NOx$, and slack variables use 1-norm penalties since
they are more robust to ill-conditioning compared to quadratic penalties [4],
facilitating the solution of (9) numerically.

Once the solution to (9) is determined, the control is informed by the first
move $\Delta u_{0|k}^{*}$ of the optimal control increment sequence, i.e.,

$u_{k}=u_{k-1}+\Delta u_{0|k}^{*}.$

##  IV Simulation Results and Discussions

The EMPC implementation employs the RNN model established in Section II-B, and
incorporates both soft state constraints and hard control constraints. For MPC
implementation and prototyping the package MPCTools [17] is employed. The
IPOPT solver is utilized for the numerical solution of the optimization
problem in EMPC. Notably, MPCTools offers the ability to generate symbolic
expressions of the RNN model, facilitating the computation of Hessians and
derivatives essential for the optimization problem.

We examine four different tuning scenarios to explore how emissions can be
modified based on varying control objectives:

  * •

EMPC-A: Low $NOx$ penalty $\eta$ without $Soot$ limit;

  * •

EMPC-B: High $NOx$ penalty $\eta$ without $Soot$ limit;

  * •

EMPC-C: Low $NOx$ penalty $\eta$ with $Soot$ limit;

  * •

EMPC-D: High $NOx$ penalty $\eta$ with $Soot$ limit.

A baseline scenario without EMPC (w/o EMPC) was also defined, in which the
adjusted targets for $p_{\tt im}$, $\chi_{\tt egr}$ are the same as the values
from look-up table while $w_{\tt inj}$ is the same as defined by the operating
condition.

###  IV-A Case Study with Steps/Ramps

Figure 11 presents simulation results applying EMPC-A, EMPC-B, EMPC-D, and w/o
EMPC controllers for a trace that encompasses a fuel tip-in, a fuel tip-out,
and a subsequent ramp change in engine speed at a particular operating point.
Given that the $Soot$ values for EMPC-A are mostly below the soft constraint,
EMPC-C to EMPC-A exhibits a similar behavior and is not included in the
subsequent figure and plot. As detailed in Table I, the EMPC strategy reduces
both cumulative and peak $NOx$ values, where the cumulative $NOx$ is defined
as

$\int{w_{\tt ext}\times{\tt ppm}_{NOx}}{\tt dt}.$ (10)

In (10), $w_{\tt ext}$ is the exhaust flow and ${\tt ppm}_{NOx}$ is the
instantaneous $NOx$ concentration value in ppm. Figure 12 illustrates the time
histories of the intake manifold pressure, EGR rate, and fuel injection rate
and of the corresponding targets. As these simulation results show, EMPC
dynamically adjusts the targets for $p_{\tt im}$ and $\chi_{\tt egr}$ to
facilitate $NOx$ reduction, while the airpath MPC controls the EGR (% open)
and VGT (% close) actuators as shown in Figure 13 to accurately track these
adjusted targets without steady-state errors.

Furthermore, as evident from Figure 11, upon introducing the $Soot$
constraint, EMPC-D is able to maintain $Soot$ close to or below a
predetermined limit. Table II indicates that $NOx$ reduction may come at the
expense of $Soot$ increase. However, the introduction of a $Soot$ constraint
yields reductions in both average and peak $Soot$ values. Computing the ratio
of the time during which $Soot$ exceeds the specified limit over the total
simulation time also confirms that imposing $Soot$ constraint results in
$Soot$ reduction. Note that $Soot$ values for EMPC-D are lower versus EMPC-B,
which illustrates the impact of imposing the $Soot$ limit.

Oscillations in the adjusted targets $p_{\tt im}^{adj}$ and $\chi_{\tt
egr}^{adj}$ are observed in Figure 14 for EMPC-D when the $Soot$ output
“rides” the constraint boundary. These oscillations are attributed to the
mismatch between the RNN model and the higher fidelity plant model. While
these oscillations are undesirable as they can potentially increase the noise
and wear, we note that the amplitude of these oscillations is small, and could
be further reduced by increasing the damping term ($R$) in the MPC cost
function.

Figure 11: Comparison of (a) $NOx$ and (b) $Soot$ with different $NOx$ penalties during first, a fuel ($w_{\tt inj}$) tip-in and tip-out and then, a ramp change of $N_{\tt e}$.  Figure 12: Comparison of actual values, target values from look-up table, and adjusted target values by EMPC of the following physical quantities: (a) intake manifold pressure, (b) EGR rate and (c) fuel injection rate with EMPC-B. Figure 13: (a) EGR and (b) VGT actuator behavior with EMPC-B. Figure 14: Comparison of actual values, target values from look-up table, and adjusted target values by EMPC of the following physical quantities: (a) intake manifold pressure, (b) EGR rate and (c) fuel injection rate with EMPC-D. TABLE I: Comparison of the $NOx$ results for different EMPC scenarios. MPC |  Cumulative $NOx$ |  Peak $NOx$
---|---|---
w/o EMPC | reference | reference
(baseline) |  |
EMPC-A |  $\downarrow$ 1.941% |  $\downarrow$ 14.629%
EMPC-B |  $\downarrow$ 6.116% |  $\downarrow$ 18.953%
EMPC-D |  $\downarrow$ 4.994% |  $\downarrow$ 18.953%
TABLE II: Comparison of the $Soot$ results for different EMPC scenarios. MPC |  Average $Soot$ |  Peak $Soot$ |  ${\text{R}}_{Soot>Soot^{lim}}$
---|---|---|---
w/o EMPC | reference | reference | 0%
(baseline) |  |  |
EMPC-A |  $\uparrow$ 2.301% |  $\uparrow$ 5.095% | 2.997%
EMPC-B |  $\uparrow$ 4.873% |  $\uparrow$ 16.482% | 17.383%
EMPC-D |  $\uparrow$ 3.740% |  $\uparrow$ 9.298% | 14.386%

###  IV-B Transient Drive Cycle Simulations

We next proceed to assess our integrated emissions and airpath control
strategy in higher complexity simulation scenarios encompassing the Federal
Test Procedure (FTP) and the World Harmonized Transient Cycle (WHTC). The
results are presented in Tables III and IV. Figures 15 and 16 offer a
comparison of EMPC-B and EMPC-C against the baseline scenario over the FTP and
WHTC cycles, respectively.

The application of EMPC-A leads to a slight reduction in $NOx$ emissions
across both drive cycles. Subsequently, increasing the $NOx$ penalty, as seen
for EMPC-B in Table III, yields more reduction in cumulative $NOx$. However,
this may lead to an increase in average and peak $Soot$ values across the
drive cycles.

Upon introducing a $Soot$ limit, EMPC-C reduces both average and peak $Soot$
values in both drive cycles compared to the baseline scenario. Furthermore,
analysis of Figures 15-(b) and 16-(b) demonstrates the substantial reduction
of $Soot$ peaks exceeding its soft constraint, thereby showing EMPC-C’s
capability to diminish visible smoke emissions. The results corresponding to
EMPC-D are exclusively presented in Tables III and IV, revealing a reduction
in both cumulative $NOx$ and average $Soot$ concentrations when using a more
aggressive EMPC strategy targeting both $NOx$ reduction and $Soot$ limits.

In addition, it’s noteworthy that the total fuel consumption for all the cases
in the FTP cycle and those in the WHTC cycle, when compared with the baseline,
is reduced by 0.4% and 0.6%, respectively. This illustrates a more fuel-
efficient control strategy without significantly compromising drivability.

Figure 15: Comparison of (a) $NOx$ and (b) $Soot$ control results over the FTP cycle. Figure 16: Comparison of (a) $NOx$ and (b) $Soot$ control results over the WHTC cycle. TABLE III: Comparison of $NOx$ control results over FTP and WHTC cycles. MPC |  Cumulative $NOx$ |  Peak $NOx$
---|---|---
w/o EMPC | reference | reference
(baseline) | FTP/WHTC | FTP/WHTC
EMPC-A |  $\downarrow$ 4.637%/$\downarrow$ 1.913% |  $\downarrow$ 1.348%/$\downarrow$ 5.514%
EMPC-B |  $\downarrow$ 9.463%/$\downarrow$ 12.921% |  $\uparrow$ 0.064%/$\downarrow$ 12.970%
EMPC-C |  $\uparrow$ 9.286%/$\uparrow$ 4.962% |  $\downarrow$ 1.649%/$\downarrow$ 0.719%
EMPC-D |  $\downarrow$ 0.867%/$\downarrow$ 8.299% |  $\downarrow$ 6.308%/$\downarrow$ 12.968%
TABLE IV: Comparison of $Soot$ control results over FTP and WHTC cycles. MPC |  Average $Soot$ |  Peak $Soot$ |  ${\text{R}}_{Soot>Soot^{lim}}$
---|---|---|---
w/o EMPC | reference | reference | 10.21%/5.22%
(baseline) | FTP/WHTC | FTP/WHTC | FTP/WHTC
EMPC-A |  $\downarrow$ 3.39%/$\uparrow$ 3.44% |  $\downarrow$ 5.27%/$\uparrow$ 12.62% | 10.88%/5.56%
EMPC-B |  $\downarrow$ 0.77%/$\uparrow$ 10.39% |  $\downarrow$ 0.41%/$\uparrow$ 11.18% | 11.67%/6.81%
EMPC-C |  $\downarrow$ 4.56%/$\downarrow$ 3.70% |  $\downarrow$ 24.69%/$\downarrow$ 14.97% | 6.47%/2.93%
EMPC-D |  $\downarrow$ 7.425%/$\uparrow$ 4.62% |  $\downarrow$ 16.07%/$\downarrow$ 14.27% | 7.46%/3.94%

##  V Summary and Conclusions

The paper illustrated the use of neural networks both as part of simulation
models and as a part of a prediction model for the implementation of an MPC-
based diesel engine controller for emissions reduction. The capability to
shape engine feedgas emissions response has been demonstrated by adjusting
weights in the cost function and constraints. To maintain low computational
complexity we have adopted a relatively simple RNN architecture for the
prediction model in EMPC. Further optimizing the computational characteristics
of the resulting EMPC controller remains a topic for continuing research.

## References

  * [1] B. Ashok, S. D. Ashok, and C. R. Kumar, “A review on control system architecture of a si engine management system,” _Annual Reviews in Control_ , vol. 41, pp. 94–118, 2016.
  * [2] A. Dewangan, A. Mallick, A. K. Yadav, and R. Kumar, “Combustion-generated pollutions and strategy for its control in ci engines: A review,” _Materials Today: Proceedings_ , vol. 21, pp. 1728–1733, 2020.
  * [3] M. Hafner, M. Schüler, O. Nelles, and R. Isermann, “Fast neural networks for diesel engine control design,” _Control Engineering Practice_ , vol. 8, no. 11, pp. 1211–1221, 2000.
  * [4] D. Liao-McPherson, M. Huang, S. Kim, M. Shimada, K. Butts, and I. Kolmanovsky, “Model predictive emissions control of a diesel engine airpath: Design and experimental evaluation,” _International Journal of Robust and Nonlinear Control_ , vol. 30, no. 17, pp. 7446–7477, 2020.
  * [5] J. Zhang, X. Li, M. R. Amini, I. Kolmanovsky, M. Tsutsumi, and H. Nakada, “Modeling and control of diesel engine emissions using multi-layer neural networks and economic model predictive control,” in _IFAC World Congress_ , 2023.
  * [6] J. Zhang, M. R. Amini, I. Kolmanovsky, M. Tsutsumi, and H. Nakada, “Benefits of feedforward for model predictive airpath control of diesel engines,” in _10th IFAC Symposium on Robust Control Design_ , 2022, pp. 181–186.
  * [7] A. Norouzi, H. Heidarifar, M. Shahbakhti, C. R. Koch, and H. Borhan, “Model predictive control of internal combustion engines: A review and future directions,” _Energies_ , vol. 14, no. 19, p. 6251, 2021.
  * [8] D. C. Gordon, A. Norouzi, A. Winkler, J. McNally, E. Nuss, D. Abel, M. Shahbakhti, J. Andert, and C. R. Koch, “End-to-end deep neural network based nonlinear model predictive control: experimental implementation on diesel engine emission control,” _Energies_ , vol. 15, no. 24, p. 9335, 2022\.
  * [9] K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” in _Proceedings of the IEEE conference on computer vision and pattern recognition_ , 2016, pp. 770–778.
  * [10] T. N. Kipf and M. Welling, “Semi-supervised classification with graph convolutional networks,” in _International Conference on Learning Representations (ICLR)_ , 2017.
  * [11] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin, “Attention is all you need,” _Advances in neural information processing systems_ , vol. 30, 2017.
  * [12] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga _et al._ , “Pytorch: An imperative style, high-performance deep learning library,” _Advances in Neural Information Processing Systems_ , vol. 32, 2019.
  * [13] G. W. Malaczynski and G. Roth, “Real-time sensing of particulate matter in a vehicle exhaust system,” _SAE International Journal of Passenger Cars-Electronic and Electrical Systems_ , vol. 10, no. 2017-01-1639, pp. 216–230, 2017.
  * [14] L. Wang, “A tutorial on model predictive control: Using a linear velocity-form model,” _Developments in Chemical Engineering and Mineral Processing_ , vol. 12, no. 5-6, pp. 573–614, 2004.
  * [15] M. Huang, K. Zaseck, K. Butts, and I. Kolmanovsky, “Rate-based model predictive controller for diesel engine air path: Design and experimental evaluation,” _IEEE Transactions on Control Systems Technology_ , vol. 24, no. 6, pp. 1922–1935, 2016.
  * [16] M. Huang, “Low complexity model predictive control of a diesel engine airpath.” Ph.D. dissertation, 2016.
  * [17] M. Risbeck and J. Rawlings, “MPCTools: Nonlinear Model Predictive Control Tools for CasADi,” 2016, [online] Available: https://bitbucket.org/rawlings-group/octave-mpctools.