Tdnn-Based Engine In-Cylinder Pressure Estimation from Shaft Velocity Spectral Representation

Pressure is one of the essential variables to give information about engine condition and monitoring. Direct recording of this signal is complex and invasive, while angular velocity can be measured. Nonetheless, the challenge is to predict the cylinder pressure using the shaft kinematics accurately. In this paper, a time-delay neural network (TDNN), interpreted as a finite pulse response (FIR) filter, is proposed to estimate the in-cylinder pressure of a single-cylinder internal combustion engine (ICE) from fluctuations in shaft angular velocity. The experiments are conducted over data obtained from an ICE operating in 12 different states by changing the angular velocity and load. The TDNN’s delay is adjusted to get the highest possible correlation-based score. Our methodology can predict pressure with an R2 >0.9, avoiding complicated pre-processing steps.


Introduction
The accelerated development of internal combustion engines in recent years has enhanced the complexity of their composing elements. As a result, the machinery monitoring task gains relevance for the progressively difficult and correct engine calibration and operation [1]. Among the many variables to watch, the in-cylinder pressure of an internal combustion engine (ICE) provides the most information about the combustion process needed to optimize fuel consumption, improve machinery efficiency, and reduce pollution rates [2]. For instance, homogeneous charge compression ignition (HCCI) combustion significantly reduces emissions while maintaining a high fuel efficiency [3]. However, HCCI demands a complex control of the combustion process that the pressure measuring can alleviate [4,5]. As another application, cylinder pressure measuring revealed the influence of fuel borne additives on ternary fuel blend operated in single-cylinder diesel engines [6]. Another study analyzed the effect of fuel injection pressure on a diesel engine run with butanol-diesel blend by measuring the in-cylinder pressure signal [7]. Such a signal also allowed correlating the advancing pilot injection timing on the engine performance, combustion, and emissions under high loads with variation pilot injection timing [8]. Therefore, researchers put effort into implementing reliable pressure monitoring for accurately modeling the engine behavior [9].
Conventionally, directly measuring the pressure requires installing transducers in the combustion chamber, which is highly invasive and usually carried out under laboratory conditions. In the commercial scenario, engines lack the sensors needed due to the high cost and short useful life [10]. Therefore, several techniques estimate the in-cylinder pressure signal from non-intrusive measurements such as vibration [11][12][13][14], crankshaft position [15], and other easily measured variables [16]. Despite the vibration signals reach reasonable prediction rates, locating the accelerometers over the engine is an open research field, even being necessary to add more sensors to cope with the spatial variability [17][18][19]. The heat transfer and release rates have also been considered to be wrapper features to estimate pressure from a mathematical model [20,21]. Nonetheless, the task of inferring the heat transfer demands assumptions as treat engine gases as ideals, which cannot be true [22,23], reducing the prediction performance at varying recording conditions [24].
The crankshaft kinematics bypasses the inherent spatial uncertainty of vibration recordings relying on detailed mathematical models as the developed in [25], where the authors estimate in-cylinder pressure from shaft speed fluctuations in an ICE. Their experiments show that the faster the engine, the more complicated the crankshaft motion, and the least accurate the model. In [10] the crankshaft acceleration is used to estimate cylinder pressure accurately. However, the hand-crafted feature kinematic extraction from the crank position demands powerful machine learning tools, as the recurrent neural networks, to unravel the patterns related to the pressure signal non-linearly. In [26], the authors develop a single hidden layer feedforward neural network to predict the pressure of a spark-ignition single-cylinder engine (achieving an R2 score of 0.993) from crankshaft angle, duct pressure, and temperature signals. Similarly, the work presented in [27] developed a model to estimate the pressure in a single-cylinder HCCI engine using a multilayer neural network, operating as predictors the crank angle and the engine speed. In [28], the authors introduced a unified approach to reconstruct engine cylinder pressure using time-delay neural networks with crank kinematics or block vibration measurements. The authors in [29] estimate a four-cylinder engine pressure using a Kalman Filter-based approach from structural vibration signals. Indeed, they evaluate the coherence between cylinder pressure and vibrations records. Of note, the combustion process periodicity allows extracting relevant information from spectral analysis to develop straightforward methodologies with enhanced interpretation. For example, the spectrum of in-cylinder vibration and acoustic pressure signals provided relevant harmonics for diagnosing the combustion [30] and evaluating the working regimen [14].
In this paper, a time-delay neural networks (TDNN)-based approach is proposed for in-cylinder pressure prediction in an ICE from crankshaft angular position fluctuations. To this end, the TDNN is introduced as a Finite Impulse Response (FIR) filter perspective by taking advantage of the propagation equations of feed-forward networks. A spectral analysis through the Fourier series is used to obtain the most relevant signal harmonics according to the prediction task. Pressure estimation is carried out from the angular velocity signal directly measured from the shaft with a cheap and easily constructed encoder. The recording system acquired signals on twelve different operating states of the engine by varying loads and velocities. The TDNN performance is validated mainly using the R2 score and the Magnitude-Squared Coherence (MSC) spectral metric. For the latter, an MSC over 0.9 in the harmonics explaining 90% of the signal pressure power proves that TDNNs outperform more elaborated methodologies from state-of-the-art [10][11][12][13][14][15][16]25]. Also, the peakbased measures are computed for comparison purposes. Besides, the pressure derivative is calculated from the TDNN predictions to get insights about possible heat transfer and release rates estimation enhancement [20,21]. It is worth noting that the proposed pipeline lacks complex preprocessing stages as the TDNN performs as a data-tuned filter.
The manuscript is organized as follows: Section 2 describes the TDNN as FIR filter and the performance metrics. Section 3 shows the experimental set-up. Section 4 depicts the results and discussion. Lastly, Section 5 presents the work conclusions and future research directions.

Time Delay Neural Network Fundamentals
Artificial neural networks (ANNs) simulate biological systems that learn, store, and retrieve information, allowing them to solve classification, regression, and filtering tasks [31].
The Time delay neural network (TDNN) architecture solves time-series regression tasks by unraveling temporal patterns with an endowed input memory. TDNNs learn relationships not only among patterns but also among their sequences [32]. Figure 1 exemplifies a single-layered TDNN-based regressor from the input-output signal set {y[n], x[n] ∈ R} N n=1 , where N ∈ N is the signal length. Please note that predicting the whole output signal y[n] implies the sequential application of the TDNN N − K times.
Input layer Hidden layer Ouput layer In this sense, the TDNN pipeline is mathematically described as follows: where n ∈ {1, 2, . . . , N}, k ∈ {1, 2, . . . , K}, K ≤ N is the maximum time delay, a[n] ∈ R holds the weighted sum of delayed inputs at the n-th instant, g(·) ∈ R is a non-linear activation function, and w k , ν 1 , ν 0 ∈ R are the network weights computed through the back propagation algorithm. Namely, the output of a hidden neuron at the n-th sample can be written in terms of the convolution operation: where * stands for the convolution operator. Besides, the convolution commutativity allows computing a[n] as a linear combination of delayed weights: Then, the argument of the activation function corresponds to the output of a linear time-invariant (LTI) system with the following characterizing impulse response h[n] ∈ R: where δ[n] ∈ {0, 1} corresponds to the delta Dirac function. Therefore, the single-layered TDNN non-linear maps the amplitude output of a finite impulse response (FIR) filter with coefficients learned in a supervised scheme. Since h[n] performs as an N-sampled impulse response FIR filter, the corresponding Fourier transform H( f ) ∈ C, where f ∈ R indexes the frequency in Hz, approximates the filter transfer function [33].
In the case of periodic discrete input time series, a finite linear combination of harmonically related complex exponentials represents x[n] as: where f 0 = 2π/N ∈ R + is the fundamental frequency and c r ∈ C holds the coefficient for the r-th harmonic. Based on the convolution linearity property, the filter output results from gathering the convolution of its impulse response and each complex exponential: In the frequency domain, the spectral decomposition of a[n], termed A( f ) ∈ C, becomes: Due to Equation (7b) proving that the filter output only holds spectral components at the input harmonics, the network output in Equation (1c) is rewritten as: Consequently, a TDNN fed by a periodic signal designs an FIR filter with frequency gain weighting the input harmonics to fit the target output.

Harmonic Prediction Performance Based on Magnitude-Squared Coherence
Given two one-dimensional periodic signals y[n] andỹ[n] of period N, i.e., the target and TDNN-based output records, respectively; their cross-correlation function, defined in Equation (9), is also an N-periodic signal, where y * [n] denotes the complex conjugate of y[n]: Therefore, the discrete Fourier transform of R yỹ [n], termed the cross-power spectrum P yỹ [r], only holds spectral components at the fundamental frequency harmonics, i.e., ω r = 2πr/N. Being provided with the cross power spectrum and the two auto power spectra P yy [r] and Pỹỹ[r], the Magnitude-Squared Coherence (MSC) is defined as the ratio between the cross power spectral density and the auto power spectrum magnitudes at the r-th harmonic: where | · | stands for the absolute function. The MSC corresponds to a zero-one bounded function, being zero when y[n] andỹ[n] are uncorrelated at harmonic r and one if they perfectly match. Hence, MSC can be interpreted as a spectral similarity measure that quantifies the TDNN's quality when predicting the target sequence y[n].

Engine Measurements, Data Acquisition, and Preprocessing
This work considers data recorded from a diesel-fueled CHANGFA 186 F singlecylinder engine, commonly used in civil engineering, energy generation, and agricultural assistance. Table 1 summarizes the CHANGFA 186 F main properties. A CFK-200 dynamometer is also used to simulate the engine load, with technical specifications shown in Table 2. Mechanical engineers installed three National Instruments data acquisition systems (DAQ) to register temperature (NI 9211), vibrations (NI 9234), pressure, speed, and angular position (NI 9222). An adaptation in the cylinder head was made for two purposes: starting the engine with provoked-ignition fuels and installing a pressure sensor in the combustion chamber. In this sense, a thread was made in the cylinder head to establish an element that would carry the spark plug (burner), because, without it, the spark plug can hit the piston. Afterward, a cylinder head identical to that of the engine was sectioned. The angle and position were determined to perform the drilling without damaging the Gas distribution system and the Diesel power system. The latter aims to guarantee a correct position and seat of the spark plug and the pressure sensor. Figure 2a shows how the cylinder head, while Figure 2b shows how the perforation was performed. Similarly, Figure 2c,d presents the installed sensor and the threading section, respectively. Then, by mounting the three DAQs over a cDAQ-9172 chassis, Matlab software synchronized engine signals. Figure 3 illustrates the component setup for the developed test bench. Furthermore, the angular position is considered for predicting the pressure due to their known kinematic relationship [14]. For the latter, a spark plug Optrand D822J6-SP sensor, installed in the engine head, measures the in-cylinder pressure y[n] at 51,200 Hz, with n ∈ N indexing the time instants. Table 3 introduces the pressure sensor technical specifications.
Regarding the angular position, a Hall effect sensor, attached to a 60-2 phonic sprocket wheeling with the engine shaft, generates a train of square pulses at 51,200 Hz providing information about the crankshaft angular position with a precision of 60 points per cycle (6 • ). Thanks to removing two out of the 60 original teeth from the sprocket, the most extended pulse marks a revolution. The raw angular velocity ofω ∈ R + [RPM] from the pulse train signal is computed as follows: where t i ∈ R + stands for the i-th rising edge time instant, so that t i − t i−1 corresponds to the elapsed time for a six-degree turn. Then, a cubic interpolation-based approach [34], as presented in Equation (12), smoothly up-samplesω i for evening the sampling frequency of the angular velocity and the pressure signal as follows: where coefficients b id are piece-wise computed fromω i . Though the initial angular velocity sample rate stands for 60 Hz, the employed cubic interpolation allows coupling both the velocity and pressure dynamics to favor the prediction results. Of note, angular velocity sensors with higher sample rates can be coupled with our approach without losing the framework purpose. Here, the introduced methodology aims to probe how a straightforward and cheap scheme achieves appropriate pressure estimation results.    In turn, a database holding 10 second records at a sampling rate of 51.2 kHz is obtained by varying engine angular velocity and load. Three speeds (1800, 2400, and 3000 RPM) and four current induced loads in the dynamometer (0, 0.5, 1, and 1.5A) are tested (see Table 4 presented the studied loads). Figure 4 exemplifies the recorded pressure and angular velocity signals. Please note that velocity fluctuations change around the peak pressure. This fact indicates that fluctuations in angular velocity signals give information about mechanical events, for instance, intake and exhaust valve opening and closure and piston slap. Hence, the correlation between signals can be exploited to predict variables that are difficult to record in real-world environments.

Pressure Signal Estimation
The considered pressure prediction from shaft angular velocity fluctuations holds three stages: Firstly, signals are down-sampled to a fifth of the main sampling frequency. All the relevant spectral components lay under 550 Hz (see Figure 5). Secondly, the number of time delays (number of units) from the single-layered TDNN is tuned in a cross-validated scheme that searches for the most massive R2 within a grid from 100 to 2000, every 100 delays, and from 2500 to 5000, every 500 delays, yielding 26 different network architectures. Each architecture is trained five times to select the best performing trial. The cross-validation scheme divides each 10-second recording into a training (second 1 to 6) and a testing (second 6 to 10) segment, being the former split into 90% for learning the parameters and 10% for validation purposes.   Figure 6 reports the R2-based assessment. The time delay (TDNN complexity represented by the number of units K), the engine velocity (in rpm), and the load (as the current applied to the dynamometer) are studied. The T RPM value marks the time delay matching the fundamental period as a reference value to analyze the prediction assessment. As seen, R2 values above 0.9 are obtained regardless of the fixed time delay, speed, and load. Hence, our TDNN-based strategy is robust against different engine configurations, which validates the proposed scheme's capability for cylinder pressure prediction. Namely the introduced TDNN can be appropriately adapted regarding the required time-delay (network complexity) to deal with the minimal and maximal engine operation conditions (as exposed in Table 4). Overall, our strategy can be adapted to the predictor behavior regarding the required network representation space (time delay). Notably, the performance increases over 0.95 after the fundamental period reference as time delay (T RPM ). Indeed, the R2 performance for time-delays between T RPM and 300 ms remains steady. Beyond such a limit, the performance presents a slight decrease, possibly due to the TDNN's overfitting. Nonetheless, predictions above 0.9 are always attained. Therefore, a suitable time delay is fixed at 100ms as it provides the best trade-off between performance and model complexity. 10 20  Now, as an illustrative example, Figure 7 plots the target (blue) and output prediction (orange) for a test pressure sample with the engine running at 2400 RPM with 0.5 A load in the dynamometer (time delay is fixed as 100 ms). As seen, the TDNN prediction properly follows the pressure trend. The performance slightly reduces near the pressure peaks due to the higher-order harmonics existing in this plot section. However, our approach achieves a decent estimation of the target signal. Besides, the R2 provides high-performance rates despite such errors. Notably, the number of high-pressure time instants is considerably smaller than the low-pressure ones where the low frequencies are dominant. The regression plot in Figure 8 (target vs. TDNN-based predictions of the samples studied in Figure 7) proves that most of the data is located at a low pressure where the TDNN easier predicts the output due to the slow dynamics. By contrast, high-pressures present larger prediction errors related to the drastic changes near the signal peaks but preserving a reasonable estimation in general (R2 = 0.994).   Figure 7.

Results and Discussion
The o represents a given sample. Blue line: mean square error-based fitting (target vs. prediction along with the studied samples) holding a R2 = 0.994. Figure 9 shows the magnitude spectrum of the TDNN' weights by varying the Kvalue (maximum time delay), the engine velocities (measured in rpm), and the load (by changing the current in amperes applied to the dynamometer). The color indicates the normalized spectrum magnitude from blue to yellow within [0, 1]. As seen, the spectrum gathers most of the energy for frequency values below 200 Hz. Regarding the speed, the TDNN amplifies more the harmonics closer to 200 Hz for 1800 and 2400 RPM than for 3000 RPM. Concerning the load parameter, the higher the load value, the more flatten is the spectrum magnitude. Specifically, for the slowest engine's velocity, the trained TDNN tends to behave as constant gain filters. Since such a kind of filter slightly adapts the input, the network finds a higher correlation between the angular velocity and the pressure signal. Furthermore, if the load is decreased, then the harmonics gain magnitude. Thus, TDNN aims to model the emerging lower frequencies with a higher power. Therefore, our training procedure highlights the relevant harmonics demanded by the target signal. For the time delay (vertical axes in Figure 9), which accounts for the TDNN complexity, the spectra appear even across the frequency for delay windows smaller than 100 ms, proving that the TDNN misses harmonics. On the other hand, most of the networks present similar frequency responses for delay windows larger than 100 ms, although they can converge to different weighting values. Then, time delays shorter than the fundamental period hinder the learning of the whole machine dynamics (Figure 6), yielding low R2 scores and poorly fitted filters.  Aiming to estimate the goodness of harmonic prediction, the MSC between the target and predicted pressure signals is calculated. Figure 10 depicts the MSC and the accumulated power over the testing set for our cross-validation scheme. The mean and the confidence interval are shown for all the studied engine velocities and loads (time delay is fixed as 100 ms). Of note, the first 30 harmonics hold 90% of the signal power, where the mean MSC is over 80%. Concerning the remaining harmonics, representing 10% of the power, the average MSC decreases, and its standard deviation increases because their faster change rate makes them harder to predict. The interpretation of the above findings is two-fold. Firstly, better fitting the low harmonics, with most of the power, considerably reduces the prediction error, explaining the TDNN behavior as a low-pass filter. Secondly, underperforming at higher-ordered harmonics, usually dominated by noise, lacks relevance for the TDNN training at high signal-to-noise ratio conditions. Next, to elucidate the TDNN capability following pressure derivatives, i.e., to test the TDNN applicability for heat transfer and release rates engine analysis [20,21], the derivative of the TDNN predicted signal is computed. Figure 11 displays an illustrative example of the pressure derivative after the TDNN prediction. The target and output pressure derivative prediction are presented for one record lasting 60 ms for the engine running at 1800 RPM with 0 BMEP load (TDNN's time delay is fixed as 100 ms). As seen, the estimated derivative follows the primary target trend. As expected, slight fluctuations are obtained, and an abrupt change is present near the pressure peak. Furthermore, Figure 12 presents the mean absolute error (MAE)-based performance along with the time instants for both the predicted pressure and pressure derivative (the 12 engine states are studied). For such a purpose, for each engine state, the pressure segments' central peaks are detected. From the computed peak position, 60 ms are considered around it (30 ms to the left of the peak position and 30 ms to the right of the peak position) to build equal-sized datasets holding pressure and pressure derivatives segments. The MAE is computed for each time instant with respect to the considered segments. Here, the MAE is computed instead of the R2-score to avoid unstable computations when the variance for a given time instant along the studied peak-based centered segments tends to zero. The latter is significantly often near flatten regions of the pressure signal. After visual inspection of the obtained MAE performances in Figure 12, the higher the speed and the load, the higher the time-dependent error. For the highest load (3.22 BMEP), the MAE is shifted concerning the other loads, which can be explained by the abrupt change and fluctuations of the pressure derivative near the prominent signal peak. Nevertheless, considering that the introduced TDNN method is applied on a cheap and modest mechanical framework, the obtained results seem to be promising regarding the prediction of signals involving pressure derivatives. Then, the TDNN efficiency around the pressure peaks is also computed. In particular, the normalized peak error (Pmax) is computed as the ratio (as a percentage) of the error between the reconstructed and recorded peak divided by the maximum measured cylinder pressure [28]. Besides, the peak localization error (Ploc) is computed as the difference in degrees between the location of peak pressure in the reconstructed and the measured signal. Again, as can be observed in Table 5, the increasing of the load and speed decreases the estimation performance.
Lastly, the method comparison results are shown in Table 6. The Pmax and Ploc errors are shown as the lower bound-upper bound reported (concerning the analyzed engine states). Furthermore, the best R2 is presented. As seen, the works presented in [26,27] attain suitable R2 scores. However, three input signals are studied, and only five states are tested. Besides, the peak-based measures are not computed, lacking an appropriate insight into the method's capability to follow pressure fluctuations around the main peaks. In contrast, the work exposed by authors in [28] deals with two predictors (input signals) and studies a three-cylinder engine within nine states. Indeed, such a method obtains the best peak-based measures. Similarly, the approach presented in [29] estimates a four-cylinder engine pressure from only one predictor. Nonetheless, the achieved peak measures are the lowest. Remarkably, the introduced TDNN is the best trade-off between the required number of predictors and the obtained peak and R2-based assessments. Though only a onecylinder engine is considered, 12 states are studied from a cheap and simple framework, involving a descent and interpretable prediction (from spectral analysis).

Conclusions and Future Work
A single-layered TDNN was trained to predict the in-cylinder pressure signal in a single-cylinder internal combustion engine using angular velocity fluctuations. The proposed approach avoids complex pre-processing stages and is only fed by the angular velocity, easily measured from the engine, reducing the signal acquisition devices' expenses to record in-cylinder pressure directly. The approach was tested in unseen data, over 12 different engine states varying the speed and load, yielding stable prediction performances. Besides, a spectral analysis is carried out to detect the harmonics and their relevance for the prediction. Attained results found that noise is located in frequencies over 200 Hz, where the harmonics have low power content. Additionally, the tuned time-delay (network complexity represented by the number of required units) for the TDNN is slightly higher than the fundamental period that depends on the engine speed.
Moreover, the pressure derivative is computed from the predicted signal to show the TDNN applicability concerning heat transfer and release rates engine analysis [20,21]. Also, peak-based measures were computed, besides the well-known R2 score, to favor method comparison. Overall, the introduced TDNN is a cheap and straightforward approach to favor estimating the pressure signal, holding spectrum interpretability. It is worth mentioning that the proposed method can be adapted to "real-time" environments. In short, TDNN can be evaluated through the convolution between the network weights and the input velocity signal comprising a computational complexity in the order of O(NK) operations. However, optimized implementations as the well-known Fast Convolution algorithm can reduce the computational complexity to O(N log(N )), where N = N + K − 1 [35].
As future work, the authors plan to test the proposal on a real-time implementation from an internal combustion engine with varying angular velocity and load (including angular velocity sensors with higher sample rates). The evaluation of the methodology under changing injection timing is also a research line of interest [8]. Additionally, the performance using different fuel injection systems as common rail direct fuel injection must be assessed [36]. The development of a spectral interpretation scheme of deeper dynamic neural networks is also required to enhance the prediction horizon. Indeed, TDNN will be extended to different multi-cylinder engines [28,29,37]. Since the introduced TDNN-based method is data-driven, it can be easily coupled with other pressure estimation tasks. More elaborate machine learning frameworks could be used from the proposed approach to favor the estimation of heat transfer and release rate engine variables [20]. Funding: Under grants provided by the research project "Desarrollo de un sistema de monitoreo para el análisis energético y de condición de emisiones en motores de combustión interna diésel con base en técnicas no intrusiva" (1110-776-57801) funded by MINCIENCIAS. This work was partially supported by the Vicerrectoría de Investigaciones, Innovación y Extensión and Maestría en Ingeniería Eléctrica both from Universidad Tecnológica de Pereira.

Institutional Review Board Statement: Not applicable.
Informed Consent Statement: Not applicable.

Data Availability Statement:
Publicly available datasets were analyzed in this study. This data can be found here: https://bit.ly/3e6drME.

Conflicts of Interest:
The authors declare that this research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.