1 Introduction

Wheel loaders, typical construction vehicles, are widely used in earthwork construction for short-distance earthwork transport. The electrification of the construction industry lags due to the high power requirements of construction machinery and the substantial costs associated with infrastructure upgrades. Consequently, most wheel loaders continue to rely on heavy-duty (HD) diesel engines, which produce significant air pollution, leading to adverse environmental impacts [1].

1.1 Background and Motivation

Nitrogen oxides (NOx) are one of the harmful pollutants in tailpipe emissions and have always been a major concern in the emission legislations for HD diesel engines. To address environmental concerns and comply with stringent emission regulations, on-board predictions of engine-out NOx are an essential part of emission control [2]. For example, the selective catalytic reduction (SCR) system requires accurate real-time measurement or estimation of engine-out NOx to keep vehicle emissions below regulatory limits while avoiding ammonia tailpipe slip [3, 4].

Compared to physical sensors, NOx prediction models provide cost efficiency and flexibility for emissions control and diagnostics. These models can be further upgraded by integrating diverse data, including real-time operational data, historical performance metrics, and environmental conditions. However, rather than replacing physical NOx sensors with the NOx model (i.e., serving as a virtual sensor), the NOx prediction can complement and enhance the performance of physical sensors, providing a reference for estimating their reliability. For instance, applying engine-out NOx predictions can refine the signal quality of physical sensors and facilitate the detection of malfunctions and aging in the aftertreatment system [5]. Additionally, real-time NOx estimation can be a necessary parameter required by the vehicle on-board diagnostics (OBD) system for monitoring engine states [6].

1.2 Literature Review

NOx formation in diesel engines occurs during the combustion process through the Zeldovich mechanism. High combustion temperatures in the post-diffusion flame zone facilitate chemical reactions between nitrogen and oxygen in the local stoichiometric area of the diesel spray. In the literature, engine-out NOx emissions have been modeled using various methods, ranging from high-fidelity three-dimensional combustion computational fluid dynamics (CFD) simulations coupled with chemical reaction kinetics [7, 8] to reduced-order models for dynamic system identification, with the aim to detect the correlation between NOx emission levels and engine design or operational parameters [9]. CFD simulations have been extensively employed during the research and development phase. However, their application for real-time estimation of instantaneous NOx emissions has been limited by computational expenses. Therefore, with respect to online NOx emission estimation, many studies have focused on reduced-order models for engine-out NOx emission estimation and control.

On the other hand, the reduced-order models include many structures, ranging from complex physical models to simpler multiple linear regression models, depending on specific requirements and objectives. The physics-based NOx model considers the flame temperature and species concentrations relevant to NOx formation in the burned zone, and in most cases, the in-cylinder pressure is simultaneously needed [10]. For example, Asprion et al. [11] presented a detailed NOx formation model that considers instantaneous NOx emissions using setpoint-relative functions, describing how the underlying physics changes with deviations in engine speed and load. However, their high requirements for model calibration and additional sensors currently hinder the industrial application of physics-based NOx models. To reduce dependency on high-cost sensors, grey-box models have been developed to represent the causal relationship between pollutants and engine conditions while simplifying calculations related to combustion and chemical processes using statistical methods [12, 13].

Different from physics-based models or grey-box models, which are semi-physical models, black-box models such as multivariable regressions or artificial neural networks are merely developed to identify the correlation between emission levels and engine parameters but ignore the physical or chemical reasons that cause exhaust pollutants. Recently, many machine learning methods, such as a black-box approach, have been implemented and compared with regard to predicting NOx emissions [14]. For instance, random forest and deep neural networks (DNNs) were widely utilized to estimate on-road NOx emissions for various vehicle applications [15]. Meanwhile, Shin et al. [16] optimized the hyperparameters of a DNN model using Bayesian optimization to predict NOx emissions during light vehicle test cycles.

Both grey- and black-box models can be considered the data-driven model. Known for their flexibility and fast response, data-driven models are gaining popularity for online emission estimation [17]. Based on datasets from preliminary tests, these models are capable of providing accurate engine-out NOx predictions. In regard to online estimation, they can perform effectively without requiring detailed information about in-cylinder states, air-path conditions, or relevant chemical mechanisms [18]. Furthermore, compared with physical models that generally require extensive experimentation for model calibration, data-driven models can be developed more rapidly by training on existing data [19].

However, the accuracy of data-driven models highly depends on their datasets, which are generally obtained during engine bench tests. The model dependencies on training dataset may imply limitations. Firstly, one limitation arising from data dependencies is the model accuracy to predict outcomes under scenarios not covered in the training dataset. This drawback may become increasingly evident with black-box models which, when encountering real-world scenarios beyond their training data, may lead to model performance characterized by poor generalization and overfitting [20]. In practice, the training database from the preliminary engine tests which are mostly conducted at steady-state test points or through certain driving cycles required by emission regulations may not fully represent real-world operating conditions [21, 22]. Transient engine operations, characterized by rapid changes in workload and speed, can significantly influence emission levels. Notably, in the context of non-road applications, dynamic working conditions occur more frequently than in on-road scenarios, thereby causing significant NOx differences compared to steady-state map predictions [1, 22]. Another limitation of using data-driven models to predict engine NOx emissions is their lack of transparency and interpretability, particularly with neural network models that obscure the reasoning behind their predictions. Furthermore, the lack of transparency impedes the processes of regulatory approval, where a clear understanding of the model decision-making is often required [23]. Additionally, the inability to interpret model predictions complicates future improvements and fault diagnostics.

1.3 Objectives of the Present Work

According to the literature review in the previous section, there exists a research gap in utilizing data-driven models for predicting engine NOx emissions. Firstly, the reliance of these models on datasets from engine bench tests may not accurately reflect real-world conditions. This limitation is particularly evident during transient engine operations for non-road applications, where rapid changes in conditions result in emissions significantly deviating from steady-state predictions. Therefore, the use of emission maps for non-road engines needs to consider the emission characteristics under transient operations. Furthermore, the lack of interpretability in data-driven models presents challenges for making subsequent updates to NOx prediction models.

In this study, a self-learning approach integrating real-world operation dynamics has been developed to predict the instantaneous engine-out NOx emissions of a wheel loader. The proposed data-driven NOx emission model combines a steady-state map with a transient emission map, which is derived and iterative updated using the Kalman filter. The major contributions of this paper are as follows:

  • Comparing engine tests with real-world field tests during construction operations highlights the importance of including transient engine operations in NOx prediction models.

  • A data-driven NOx model is proposed, combining steady-state and iteratively refined transient emission maps using the Kalman filter, with a structure that allows for online model updates.

  • The NOx model structure, which classifies operating conditions, enhances prediction accuracy and robustness against engine dynamics.

1.4 Document Organization

The remainder of this work is organized as follows. Section 2 presents experiments containing engine steady-state tests and real-world NOx emission measurements for wheel loader operations. Then, the data processing method of real-world operations is introduced. Following this, the NOx emission model framework, as well as the algorithm for recursive iteration of the transient map, is also proposed. In Section 3, the experimental results are first presented, along with the corresponding analysis of the NOx emission changes caused by engine dynamics. Section 3 also evaluates the convergence of model iteration, along with model performance. Finally, Section 4 discusses the appropriate applications for the proposed model, as well as its strengths and weaknesses. Section 5 concludes the paper.

2 Methodology

2.1 Experimental Setup

The tested wheel loader is of the Z50 type with a rated workload of 5000 kg (see Fig. 1). The engine of the selected loader is a heavy-duty turbocharged engine fueled by conventional diesel. The main engine parameters are listed in Table 1. The emission standard for the test wheel loader conforms to its current local legislation, which is equivalent to the EU non-road Stage IV standard for non-road mobile machinery. The emission control techniques applied in the selected wheel loader include SCR and modifications to the fuel injection in the common rail (CR) system. These adjustments have been made by the manufacturer to meet legislative requirements for particulate matter (PM). Additionally, it should be mentioned that the engine was tested and satisfied both the regulation in the ISO 8178 test cycles (i.e., steady-state operating points) and the non-road transient cycle (NRTC) [21, 22].

Fig. 1
figure 1

Tested wheel loader and its accessory sensors: a Z50-type wheel loader, b NOx sensor installation, and c vehicle data acquisition linked with CAN bus

Table 1 Main parameters of the tested engine

The experiment consists of two parts: first, the engine in the test cell operated under steady-state conditions to generate an engine-out NOx emission map. Then, a field test was conducted with the loader operating on a construction site for earthmoving. The real-world engine operating conditions during construction activities were logged, along with the corresponding engine-out emissions.

2.1.1 Engine Test

The engine test (see Fig. 2) was conducted on a AVL PUMA Open control platform. Fuel consumption was measured using AVL7351 CST fuel flow meters. Regarding the intake and exhaust flow conditions, a STEELMASS air flow meter was used for measuring intake mass rates, FUTEK pressure transducers for pressure sampling, and K-type thermocouples for temperature measurement. An independent FPGA system managed the transmission of control signals to the engine control unit (ECU), thus regulating engine operations. Engine emissions were assessed with an AVL AMA i60 4000 emission analyzer.

Fig. 2
figure 2

Engine test and its measurement system

To evaluate the steady-state characteristics of the engine, tests were conducted in the engine cell, covering various speeds and torques within the engine external characteristic curve. Engine performance was measured, and data were collected at each operating point for 3 min following a 10-min period of steady-state operation. As shown in Fig. 3, the test sequence of the operating points was as follows: the speed started from the rated speed and decreased in 200 rpm increments to idle speed, while the torque began at 100% load and decreased in 10% increments down to 10% load. During this test, the test bench recorded the following data: engine speed, torque, fuel injection quantity, intake and exhaust parameters, and gas concentrations of emitted pollutants.

Fig. 3
figure 3

Test points for engine steady-state operations

2.1.2 Field Test of Wheel Loader Operations

The field test of the wheel loader was performed at a construction site for earthmoving. The acquisition system was connected to OBD system via a controller area network (CAN) bus to record the operations of the tested loader. Vehicle motion and location were also recorded by the GPS system and cameras. In particular, a Continental UniNOx Sensor was installed before the SCR system to measure NOx concentration in the exhaust gas. The measuring range of the NOx sensor is up to 2000 ppm with a sensor accuracy of ±5% for the readings above 100 ppm, while the accuracy below 100 ppm is 10 ppm. Wheel loader operational data, as well as NOx emission data, were simultaneously logged with a sampling frequency of 5 Hz. A low-pass filter was applied to the on-board measurement raw data with a window length of 15 samples.

Fig. 4
figure 4

An operational cycle of wheel loader to complete a loading task in the field test. The arrows indicate the moving trajectory of wheel loader

The loading task for earthmoving at the construction site is repetitive [24]. As shown in Fig. 4, the operational cycle of a wheel loader can be divided into the following steps [25, 26]: It begins with filling the bucket with materials through a loading motion. Subsequently, with the load, the loader reverses from the material pile and returns to the reversing point. Then, it shifts into forward gear and drives with the load towards the dumping point (or dump truck). At the dumping point, the materials are unloaded. The loader then reverses with an empty bucket back to the gear shift point and shifts back into forward gear to drive without a load towards the material pile, initiating the next operational cycle for loading and material transportation.

The field test was conducted in an earthmoving area at a construction site, where the wheel loader transported a mixture of fine sand and crushed stones. During the loading operations, the distance covered by the wheel loader was within 15 m. To avoid operational and measurement errors, the analysis of vehicle movement and engine performance data was conducted in conjunction with GPS data and operational videos. Furthermore, to accurately represent real-world operational conditions and emission levels of the wheel loader, a total of 272 operational cycles were measured during the field test.

2.2 Data Processing

2.2.1 Time Alignment of NOx Sensor Signal

For the engine sensors used in the field test, their response assessments were conducted in preliminary tests before the commencement of the field test. In particular, since the NOx sensor was located downstream of the turbocharger, its response had a time delay compared to engine signals due to the delay in exhaust gas transport [27]. Therefore, the time alignment of the NOx sensor signal needs to be considered. As the response delay of the NOx sensor during engine transient operations is not constant, identifying the delay time is necessary. The fuel mass signal from the ECU was chosen as a reference for this purpose. As depicted in Fig. 5, the temporal correlation between the injected fuel rate and the NOx signal was measured during engine transient operations at various fuel mass rates. Subsequently, the time delay in NOx signals was adjusted using phase shifting, guided by a table that lists delay times for different exhaust mass flow rates, ascertained through further engine testing. In subsequent sections, it is presumed that the bias caused by the time delay has been corrected after the time alignment of the NOx sensor signal.

Fig. 5
figure 5

Exhaust gas transport time delay

2.2.2 Separation of Operational Cycles

The engine real-world operational cycles in the raw data were separated based on the time series of engine speed data using dynamic time warping (DTW). The DTW distance is a type of distance metric that allows for unequal time series lengths and accommodates temporal warping of sequences [25]. Unlike the Euclidean distance, DTW does not calculate distances strictly point to point; instead, it permits skipping several points within certain ranges, enabling the two sequences to match with more flexibility.

The DTW data sequence for separating operational cycles in this study is defined as a two-dimensional vector consisting of normalized engine speed and torque. DTW between two data sequences with different lengths, denoted as \(\textbf{a}=\left[ a_0, \ldots , a_n\right] \) and \(\textbf{b}=\left[ b_0, \ldots , b_m\right] \), can be formulated as an optimization problem:

$$\begin{aligned} {\text {DTW}}(\textbf{a}, \textbf{b})=\min _\pi \sqrt{\sum _{(i, j) \in \pi } d\left( {a}_i, {b}_j\right) ^2} \end{aligned}$$
(1)

where \(\pi =\left[ \pi _0, \ldots , \pi _K\right] \) of length K represents a path of index pairs of \(\textbf{a}\) and \(\textbf{b}\). \(\pi _k=\left( i_k, j_k\right) \) with \( 0 \le i_k<n \) and \( 0 \le j_k<m\). The distance metric \(d({a}_i, {b}_j) = || {a}_i - {b}_j||\) is chosen as Euclidean norm. The optimal solution in DTW problem can be obtained by using dynamic programming through a backtracking approach [28].

2.3 NOx Emission Prediction Model

2.3.1 Model Framework

Figure 6 presents the logic diagram of the NOx emission prediction model. This data-driven model utilizes engine emission maps with on-board engine speed and torque as the model inputs reflecting operating conditions in real time. In practice, engine emission maps using lookup tables are the most straightforward and commonly used approach in the automotive industry because of their simple structure, robust performance, and high interpretability [19].

Fig. 6
figure 6

Model framework for NOx emission prediction

These input data inform two parallel prediction pathways: one for steady-state conditions, where engine operations are constant and unvarying, and another for transient conditions, which account for fluctuations such as accelerations or decelerations. Based on the operating condition classification, the transient-to-steady ratio is used as a weight to merge the NOx predictions from the steady-state and transient maps. The transient-to-steady ratio is calculated to synthesize the outputs from these two maps in a NOx prediction merging process, resulting in an accurate real-time prediction of NOx emissions. In particular, the dashed blue arrow in Fig. 6 refers to an optional function within this model, which uses real-time NOx data to update the transient map. The real-time NOx can be obtained either from direct measurements via a NOx sensor or from estimated values provided by the feedback of the SCR system. This integrated approach ensures that the model captures the full spectrum of engine behaviors, thereby enhancing the accuracy of the emission predictions under both stable and changing operational conditions.

Fig. 7
figure 7

Map interpolation based on the nearest points

2.3.2 Recursive Iteration of Transient Map

The Kalman filter (KF), a linear quadratic estimation principle, is designed with the objective of estimating the state of a dynamic system from a series of measurements that include noise. This estimation is achieved through recursive iteration. The KF algorithm is a dynamic estimation method that operates by iteratively updating a prediction model based on the comparison between predicted values and observed values, thereby enhancing the accuracy of the model [29, 30].

To establish an iterative map method using KF, the map is considered the system’s state vector, denoted as x. The two-dimensional (2D) map is transformed into one-dimensional column vectors, represented by \(\hat{x}\). Assume the map consists of \(n_r\) rows and \(n_c\) columns, the resulting vector \(\hat{x}\) becomes a column vector with the size of \(n_r \cdot n_c \times 1\). Meanwhile, each element in this vector corresponds to a value within the map with a direct mapping relationship. As shown in Fig. 7, based on the state-space model of the map, the lookup table procedure (i.e., the interpolation referring to the value of four nearest points on the map) at time step k can be represented as an observation matrix in KF [5, 30]:

$$\begin{aligned} H_k=&[0, \, \ldots , \, 0, \, (1-\eta _{r,k} )(1-\eta _{c,k}), \, \eta _{r,k} (1-\eta _{c,k} ), \, 0, \\&\ldots ,\, (1-\eta _{r,k}) \eta _{c,k}, \, \eta _{r,k} \eta _{c,k}, \, 0, \, \ldots , \, 0] \nonumber \end{aligned}$$
(2)

where \(H_k\) is a sparse vector with the size of \(1 \times n_r \cdot n_c\), where the subscript k represents the k-th interpolation reading. Within this vector, the four non-zero elements correspond to the surrounding four points for 2D interpolation. \(\eta _c\) and \(\eta _r\) represent the ratio of the distance from the selected location to the surrounding four points in the row and column directions, respectively. Multiplied with the vector representation of the map, \(H_k \cdot \tilde{x}\) yields the lookup-table value.

KF implementation can be divided into two distinct steps: prediction and update. In the prediction step, the algorithm estimates the next state based on the current state. Conversely, in the update step, the system’s state in the observation phase is corrected based on the observed values of the next state. By substituting (2) into the KF algorithm, the iterative method for the map can be formulated as follows:

In the prediction step, the algorithm assumes that the state of the map at time step k is consistent with its state at time step \(k-1\), with no external disturbances. The update of the map is only due to differences between the predicted value and the measured value. Furthermore, the initial value of the state covariance matrix \(P_0\) is set to the identity matrix. The system noise matrix \(Q_k\) can be calibrated based on experimental results.

$$\begin{aligned} \hat{x}_{k \mid k-1}=\hat{x}_{k-1 \mid k-1} \end{aligned}$$
(3)
$$\begin{aligned} P_{k \mid k-1}=P_{k-1 \mid k-1}+Q_k \end{aligned}$$
(4)

In this update step, if the observed value \(\tilde{z}_k\) is considered more reliable, the Kalman gain, denoted as \(K_k\), assigns the observed value a higher weight. Conversely, if the predicted value is more reliable determined by \(P_{k|k-1}\), the predicted value receives a higher weight with a smaller Kalman gain. Moreover, similar to \(Q_k\), the measurement noise matrix \(R_k\) can be estimated by either the preliminary test or the uncertainty range given by the sensor manufacturer.

$$\begin{aligned} \tilde{z}_k=H_k \cdot \hat{x}_{k \mid k-1} \end{aligned}$$
(5)
$$\begin{aligned} K_k=\frac{P_{k \mid k-1} \cdot H_k{ }^T}{H_k \cdot P_{k \mid k-1} \cdot H_k{ }^T+R_k} \end{aligned}$$
(6)
$$\begin{aligned} \hat{x}_{k \mid k}=\hat{x}_{k \mid k-1}+K_k \cdot \left( \tilde{z}_k-H_k \cdot \hat{x}_{k \mid k-1}\right) \end{aligned}$$
(7)
$$\begin{aligned} P_{k \mid k}=\left( I-K_k \cdot H_k\right) \cdot P_{k \mid k-1} \end{aligned}$$
(8)

The recursive iteration of the transient map in this section adopts a KF model, which is a linear filter that operates under the assumption that both the system dynamics (state transitions) and the observation (measurement) models are linear and that the system and observation noises follow a Gaussian distribution. Although the physical model of NOx production through the combustion process may not fit the linear system assumption, the proposed model framework, on the other hand, can be used as a linear system. Both the prediction and update steps are based on the interpolation of maps, which is a linear procedure that can be directly adopted in the KF framework.

2.4 Evaluation Metrics

To evaluate the model performance, the coefficient of determination (\(R^2\)), root mean square error (RMSE), and mean absolute percentage error (MAPE), are applied to quantify the accuracy of the develop model. In these statistical measures, the NOx measurement at i-th time step is denoted as \(E_i\), while the model output is \(\hat{E}_i\).

$$\begin{aligned} R^2 = 1 - \sum _{{i}=1}^{{n}} \left( {E}_{{i}}-\widehat{{E}}_{{i}}\right) ^2 / \sum _{{i}=1}^{{n}} \left( {E}_{{i}}-\bar{{E}}_{{i}}\right) ^2 \end{aligned}$$
(9)
$$\begin{aligned} \text {RMSE}=\sqrt{\sum _{{i}=1}^{{n}} \frac{1}{n} \left( {E}_{{i}}-\widehat{{E}}_{{i}}\right) ^2} \end{aligned}$$
(10)
$$\begin{aligned} \text {MAPE}=\sum _{{i}=1}^{{n}}\left| {E}_{{i}}-\widehat{{E}}_i\right| / \bar{{E}}_{{i}} \end{aligned}$$
(11)

where N is the total time length of the test dataset, and \(\bar{{E}}_{{i}} = \sum _{{i}=1}^{{n}} {E}_{{i}}\) is the mean value of measurement data.

3 Results

3.1 Operational Cycles and Engine Dynamics

This section presents the engine conditions of the selected wheel loader during construction operations. First, the procedure for separating operational cycles from the measurement data is introduced. Then, the operational cycles are presented to discuss the engine dynamics under transient conditions. The final part of this subsection illustrates the differences in NOx levels between steady-state and transient operations.

3.1.1 Operational Cycles

While the operation cycles of the loader exhibit clear periodicity and determinism, the influence of various external factors, such as the varying amount of material loaded by the driver in each cycle and the variability in the duration of each cycle’s operation time, results in each extracted operation cycle having a different duration and some differences in waveform.

Fig. 8
figure 8

Four consecutive operational cycles separated by DTW

Fig. 9
figure 9

Engine dynamics during the construction operations. The red markers refer to one operational cycle selected as an example, and the time interval between the red markers is 0.2 s

These variations are reflected in the engine data through differences in the duration of cycles, as well as in torque and speed ratios. Given these characteristics of variation, Fig. 8 illustrates four consecutive operational cycles separated by using DTW for the separation and identification of operational cycles in the tested wheel loader. It can be seen that not only is the duration of each cycle different, but also their characteristics (e.g., peaks, speed raising profiles) appearing in each cycle do not correspond one-to-one.

After the DTW separation of operational cycles, the measurement dataset in the field test contains 272 operational cycles. Then, the dataset is divided into a training set with 120 cycles and a test set with the remaining 152 cycles. The training set is utilized to train the model, while the test set is employed to evaluate its performance.

3.1.2 Engine Dynamics and NOx Emission Characteristics

Figure 9 illustrates the engine dynamics during construction operations. It can be observed that the engine operations involve repetitive work with rapid load increases and decreases, leading to varying torque and speed trajectories that cycle repeatedly between idle and maximum load points. As mentioned earlier, the operational cycles are separated using DTW. One cycle (marked by red dots) is randomly selected as an example to further discuss the engine’s transient performance.

Fig. 10
figure 10

Engine torque and speed during one operational cycle

Fig. 11
figure 11

Comparison of NOx concentration between steady-state map outputs and NOx sensor measurement

Fig. 12
figure 12

Correlation matrix between model inputs and NOx discrepancy from steady-state map outputs to NOx sensor readings. NOx sensor reading is denoted as “NOxEr.” “Sp” corresponds to speed, “Tor” to torque, and the prefix “d” indicates the derivatives of these variables with respect to time

Figure 10 displays the engine torque and speed profiles of the selected operational cycle. It consists of four segments of torque and speed fluctuations, corresponding to the four stages of the loader’s operation (refer to Fig. 4) within an engine cycle. Both torque and speed profiles exhibit rapid variations, primarily due to the movement of the loader’s boom as well as the filling and dumping of its bucket. Furthermore, another characteristic of engine dynamics is that the torque change precedes the speed change. This is primarily because torque is a direct result of the combustion process within the engine, which can be adjusted more rapidly than the engine rotational speed, the latter being dependent on the inertia of the engine components and the load applied [21]. These transient behaviors also have a sequential impact on the engine’s emission levels.

As the wheel loader frequently undergoes load changes during its operation, the engine typically operates under transient conditions. During engine transient operation, combustion processes are highly influenced by changes in fuel injection, turbo lag, and residual gas amount. These factors result in differences in emissions compared to steady-state conditions.

Figure 11 compares the predictions from the steady-state map with the NOx sensor readings. It can be observed that while the values from the steady-state map may align with the instantaneous NOx emissions during the load and speed decrease, there are significant discrepancies during the increase phase compared to the NOx sensor readings. Although the NOx sensor has an estimated accuracy of ±5%, the observed difference as shown in Fig. 11 (ranging approximately from 200 to 600 ppm with ±10–30 ppm uncertainty) between steady-state and transient operations is more likely due to a change in emission characteristics rather than measurement errors.

These differences in NOx levels can be attributed to two factors. One factor is the advanced start of injection (SOI) timing during engine acceleration events, which is set by the engine manufacturer to maintain engine efficiency and control PM emissions during transient events [31]. Another factor is the delay in turbocharger response. The delay in providing intake air due to turbo lag results in higher local temperatures near the stoichiometric zone of diesel-air mixtures, contributing to the increased NOx formation. Therefore, the interpolated steady-state emission map may be inadequate for accurately reflecting the actual emission levels during loader operations, particularly during acceleration events. This observation serves as motivation for the development of a prediction model for NOx emissions capable of encompassing engine emission performance in both steady-state and transient operations.

3.2 Operating Condition Classification

Within the framework of this NOx prediction model shown in Fig. 6, real-time inputs such as engine torque and speed are essential parameters that dictate the classification of the engine’s operating state as either steady-state or transient. This distinction is critical because the engine’s behavior and subsequent NOx emissions can vary significantly between these states. Figure 12 presents the correlation matrix between model inputs and NOx discrepancy from steady-state map outputs to NOx sensor readings.

Fig. 13
figure 13

Transient-to-steady ratio identified for merging the output of maps

The operating condition classification compares the expected NOx output from the steady-state map against the actual measurements obtained from the NOx sensor. The NOx discrepancy between these two values serves as an indicator of engine condition stability. To refine the model’s accuracy, a correlation analysis is conducted between the inputs (i.e., torque and speed and their change rates) and the observed NOx discrepancy. This analysis aids in selecting the most indicative engine parameters to appropriately identify the engine’s operational states. In this matrix, each diagonal cell contains a histogram showing the distribution of a single variable, while the off-diagonal cells contain scatter plots that illustrate the relationships between pairs of variables. The numbers within the cells are correlation coefficients that quantify the linear relationship between two variables: a value of 1 indicates a perfect positive correlation, \(-\)1 indicates a perfect negative correlation, and 0 indicates no linear correlation. Notably, the derivatives of speed and torque, with correlation coefficients of \(-\)0.29 and \(-\)0.75, respectively, demonstrate a significant relationship with NOx discrepancy. Consequently, these two parameters have been selected for identifying the engine’s operational states.

Figure 13a presents the ratios of operational data points classified into transient and steady-state conditions, in relation to engine speed and torque changes. Each cell within the grid corresponds to a specific rate of speed and torque change, with the color representing the ratio of transient-to-steady-state conditions at that point. The transition from steady-state to transient conditions is based on a threshold set at 25% difference of NOx sensor readings, suggesting that points NOx variation exceeds this criterion statistically represent transient conditions. The setting for this criteria value is based on the NOx variations distributions in the training dataset, as shown in Fig. 13b.

3.3 Self-learning of Transient Map

Based on the KF map iteration method outlined in the previous section, the transient engine emission map for wheel loader operations is generated by updating the steady-state map. As shown in Fig. 14, the procedure of generating the NOx map involves integrating on-board data from real-world construction operations to establish the transient emission map. As the KF is an estimation technique for a dynamic system, the model accuracy increases with the number of iterations. With each iteration, the map’s values for interpolation are updated in line with the measured data. The iteration time interval is set at 1 s to reduce computational burden. The convergence of the system’s covariance matrix serves as a measure for the convergence of map iteration.

Fig. 14
figure 14

Flowchart for the update of transient NOx map

Fig. 15
figure 15

Iterations of covariance matrix. Covariance values in all subplots are standardized for comparison

Figure 15 displays the updated values of the state covariance matrix along the main diagonal through iterations. Each cell on the map represents the confidence in the predicted value at that position. As discussed previously, lower \(P_{k|k}\) values indicate higher confidence in the map predicted values, while higher \(P_{k|k}\) values imply lower confidence. Therefore, regions without measurement coverage retain high P values, indicating infrequent updates and, therefore, lower confidence levels in the map predictions. As the iteration number increases, more areas in the map are updated with the increase in confidence in the map prediction. Notably, after 3641 iterations (i.e., 20 operational cycles), the \(P_{k|k}\) values across the map have already stabilized, indicating the convergence of the covariance matrix.

Figure 16 compares the steady-state and transient maps. In the steady-state map, the highest NOx emissions appear in the region of the lowest engine speeds, particularly at middle to high engine loads. Furthermore, NOx emissions at lower torque are relatively low across all engine speeds. As torque increases, emissions rise notably until reaching the torque associated with rated power, beyond which the NOx emissions tend to level off or decrease slightly. On the other hand, the transient map exhibits a trend similar to that of the steady-state map, which serves as the baseline for generating the transient map. The NOx levels on the transient map are generally comparable to or lower than those on the steady-state map. The most significant difference is observed in the middle engine speed region, which is updated most frequently due to the crossing over of engine acceleration and deceleration trajectories. Furthermore, it should be noted that the smoothness of the surface in the transient map is influenced by the on-board measurement data used for map updates. To avoid excessive steepness in the slopes of the updated map, sufficient training data and convergence of the map iteration are required.

Fig. 16
figure 16

Comparison between steady-state and transient NOx maps

3.4 Evaluation of NOx Predictions

Figure 17 illustrates the NOx model validation results through two consecutive operational cycles in the test dataset, comparing NOx sensor readings with the outputs from steady-state and transient maps. The intensity of the gradient background color indicates whether the engine is in transient operational conditions, corresponding to the magnitude of transient-to-steady ratios. It should be noted that the cycle-to-cycle variations in the test data, as well as the disparities between peak and minimum data, were also influenced by driving behavior and the task content of different loading cycles. It can be seen that the model is capable of detecting most engine transient conditions, as indicated by high transient-to-steady ratios. In these regions, the NOx model relies more on the calibrated transient map’s outputs, enhancing the accuracy of transient condition predictions. Conversely, for conditions with low transient-to-steady ratios, the steady-state map continues to provide reliable NOx predictions, which the NOx model predominantly utilizes. Additionally, despite the improved prediction capabilities of the proposed NOx model compared to using either the steady-state or transient maps alone, some deviations in the model performance are still evident. For example, the data region around 8600 s in Fig. 17 demonstrates that the NOx model is not capable of accurately predicting NOx levels when they fall outside the range defined by the steady-state and transient map outputs.

Figure 18 presents the model validation results for both the training and test datasets. It includes the outputs from the steady-state and transient maps along with the results of engine operating condition classification, which assists the final model output combine the strengths of the map outputs. Referring to Fig. 11, the steady-state map obviously provides an overshooting response when the working conditions change intensively. Meanwhile, the good performance of the transient map can only be maintained for the most transient conditions where it has been updated through the KF algorithm. Consequently, the final NOx model output, which merges both map outputs, provides relatively accurate predictions for both the training and test datasets.

Fig. 17
figure 17

Comparison of measurements, NOx emission models, and outputs from steady-state and transient maps. The background color transitions from white, representing steady-state operation, to green, indicating the transient-to-steady ratio

Fig. 18
figure 18

Model validation: NOx prediction compared to measurements. Dots representing transient engine operations are selected for points where the transient-to-steady ratio exceeds 0.5

Table 2 Model evaluation matrices

Table 2 presents the model validation results using evaluation metrics for the outputs of the steady-state map, transient map, and NOx model prediction. For the steady-state map, due to the absence of a linear correlation, there is no valid \(R^2\) value to demonstrate the model accuracy. Moreover, the RMSE is 308.5 ppm for the training dataset and 321.5 ppm for the testing phase, coupled with high MAPE values, indicating significant deviation of the steady-state NOx map output from real-world emission levels. The transient map exhibits a moderate fit with \(R^2\) values of 0.76 and 0.73 for training and testing, respectively, alongside minor changes in RMSE and MAPE values across datasets. In contrast, the model prediction showcases the best fitting capabilities with \(R^2\) values of 0.98 and 0.95 for training and testing datasets. It maintains low RMSE and MAPE values, highlighting its precision and minimal percentage of model errors. These measures confirm the observations in Fig. 18 that the introduction of the transient map with transient-to-steady classification can significantly reduce prediction errors. The NOx prediction model, developed with the capability to adjust weights between steady-state and transient maps, is capable of predicting real-world NOx emission levels accurately.

4 Discussions and Recommendation

The NOx model proposed can be a useful tool for enhancing the predictive capabilities of non-road engine systems and their aftertreatment devices. Due to the varying operational conditions of engines in construction activities, the limitations of conventional steady-state engine maps have been highlighted in this work, based on on-board measurement data. This NOx prediction model, with its sensitivity to engine transient operations and online self-learning capability, can improve prediction accuracy and enable robustness in engine-out emission modeling and control.

To reduce computational burden, conventional steady-state engine emission maps typically use engine speed and torque (or fuel injection parameters) as model inputs. The proposed model also uses this simple structure with these two engine parameters as inputs but includes additional sub-models to improve performance during transient operations. In particular, as mentioned in the model description, all parameters for transient predictions can be iteratively updated either offline, using datasets from preliminary tests, or online, based on sensor feedback. This straightforward approach is relatively simple to implement and can aid in the optimization of future system upgrades.

Another consideration is the adaptability of the proposed model framework to other operational conditions and engine configurations. Given that the tested non-road engine primarily employs an SCR system and retarded fuel injection timing for NOx reduction, it is essential to consider the adaptability of the proposed model to other HD engines that utilize different emission control techniques (e.g., exhaust gas recirculation) or are powered by renewable fuels. These engines may demonstrate emission characteristics significantly different from those observed in this study [32, 33]. The proposed model framework is data-driven, relying on engine-out NOx maps and real-world engine dynamics. Provided the training data are accurate, the model is designed to be adaptable to a wide range of operational conditions and various engine configurations. Additionally, the self-learning framework enables the incorporation of new data resulting from engine upgrades, degradation, or performance changes due to different operational tasks.

Furthermore, the accuracy of the proposed data-driven model depends on the precision of NOx measurements. The Continental UniNOx Sensor, used in this study for real-time NOx monitoring, has an accuracy rate of ±5% for engine-out emission levels above 100 ppm, which inherently limits the model’s accuracy. Although the portable emission measurement system (PEMS) could provide a potentially higher accuracy (±2% of readings), the current PEMS configuration may impede operational efficiency and mobility on the non-road vehicles like the tested wheel loader, particularly on the uneven terrain of the construction site. Therefore, NOx sensor measurements, with a faster response time due to direct exposure to exhaust flow, were selected as the reference data (i.e., the ground truth for model training and validation) in this study. It should be noted that improving measurement accuracy remains crucial for reducing model uncertainty in future work.

Additionally, the primary tasks of wheel loaders at construction sites typically involve duty cycles that are generally consistent. The model is mainly developed for these operational conditions, characterized by rapid changes in torque and speed. Based on the on-site monitoring in this study and observations from previous studies [25, 34], these duty cycles can be considered the major operational activities for wheel loaders as construction machines. Meanwhile, other operational cycles, such as long-distance moving and idling, account for a relatively small amount of time. Their NOx emissions can be effectively predicted using the steady-state emission map. Furthermore, the proposed model, which is trained using the observed duty cycles, aims to capture the variations in emissions under rapid changes in operational conditions. It is designed to reliably predict emission levels in various engine operations (even those with different duty cycles) that exhibit similar rapid changes.

There are some limitations in this work that require further attention. The proposed method is a data-driven model that still needs engine tests to provide a steady-state map. Consequently, if the combustion processes have been adjusted on the engine control side (e.g., fuel injection strategy), the model cannot reflect emission changes under steady-state conditions without additional calibrations. The establishment of transient-to-steady ratios is based on a statistical analysis of the training dataset. Although the model validation demonstrates good agreement with test data, there is potential for optimizing transient-to-steady ratios using more advanced approaches in future work. Such improvements could further reduce the size of the required training dataset and enhance the model performance. Furthermore, the validation of the model in this study may be constrained by the test dataset, which shares similar characteristics with the training data. To address this limitation, future work should include a larger dataset encompassing a wider range of operational cycles. Additionally, both the test and training datasets may be enhanced by randomly sampling a variety of cycles.

A limitation of the proposed NOx model is its exclusion of environmental conditions such as temperature, humidity, and altitude, which are significant influences of engine-out NOx levels. Future work could enhance the model by transitioning from a two-dimensional map, which currently uses torque and speed as inputs, to a more comprehensive multi-dimensional table that accounts for all relevant influencing factors. As the engine dynamics is characterized by the torque and speed signals [21], this work primarily studies the potential of using the torque and speed signals (and their time derivatives) to establish a data-driven model for NOx prediction. However, combustion-related parameters such as fuel injection timing, combustion duration, turbo lag, and residual gas level, among others, should also be considered. Future work should involve incorporating such parameters relevant to the physical model to explore the potential of integrating physical processes with data-driven models.

5 Summary and Conclusions

This work presents a self-learning data-driven model to predict the instantaneous engine-out NOx emissions of a non-road HD engine during the operation of a wheel loader. Engine tests and in-field vehicle tests for construction activities are firstly conducted to measure operating conditions and corresponding emission levels. The differences between the steady-state engine test and real-world operations are analyzed, and engine operational cycles of the wheel loader are further identified.

  • There are significant engine-out NOx emission differences between the engine steady-state operations and the real-world operating conditions under construction activities. Therefore, the engine steady-state map is insufficient to reflect the real-world NOx emission levels which is highly affected by the frequent changes of working conditions.

Based on the above conclusion, integrating engine dynamics during transient operations into the NOx model is crucial for enhancing the accuracy of on-board predictions. The proposed data-driven NOx emission model includes both a steady-state map and a transient engine map, with the latter being generated through iterative mapping based on the KF principle. Model validation is then conducted to quantify model errors using both training and test datasets.

  • The transient-to-steady ratios, derived from the time derivatives of engine torque and speed, are introduced to differentiate engine operating conditions. Model validation confirms that the established transient-to-steady ratios are capable of detecting transient conditions.

  • Model validation shows that while the steady-state map lacks a linear correlation and significantly deviates from real-world NOx emission levels, the transient map demonstrates better model accuracy across the operational region that has been updated by the KF algorithm. The proposed NOx model, achieving \(R^2 \ge 0.96\) and low error metrics through test data, confirms its capability to accurately predict real-world NOx emissions.

6 Abbreviations

HD:

Heavy duty

NOx:

Nitrogen oxides

SCR:

Selective catalytic reduction

OBD:

On-board diagnostics

CFD:

Computational fluid dynamics

CR:

Common rail

NRTC:

Non-road transient cycle

ECU:

Engine control unit

CAN:

Controller area network

GPS:

Global positioning system

DNN:

Deep neural network

DTW:

Dynamic time warping

SOI:

Start of injection

PM:

Particulate matter

KF:

Kalman filter

RMSE:

Root mean square error

MAPE:

Mean absolute percentage error

PEMS:

Portable emission measurement system