In-Cylinder Pressure Estimation from Rotational Speed Measurements via Extended Kalman Filter

Real-time estimation of the in-cylinder pressure of combustion engines is crucial to detect failures and improve the performance of the engine control system. A new estimation scheme is proposed based on the Extended Kalman Filter, which exploits measurements of the engine rotational speed provided by a standard phonic wheel sensor. The main novelty lies in a parameterization of the combustion pressure, which is generated by averaging experimental data collected in different operating points. The proposed approach is validated on real data from a turbocharged compression ignition engine, including both nominal and off-nominal working conditions. The experimental results show that the proposed technique accurately reconstructs the pressure profile, featuring a fit performance index exceeding 90% most of the time. Moreover, it can track changes in the engine operating conditions as well as detect the presence of cylinder-to-cylinder variations.


Introduction
The estimation of the in-cylinder pressure of internal combustion engines plays a key role within monitoring and control systems to ensure operation efficiency, regulate emissions and detect possible engine malfunctioning [1][2][3][4][5]. Direct measurements provided by dynamic pressure sensors are clearly a possible solution; see, for example, [6][7][8][9]. However, this is usually avoided in production engines for both technological reasons (difficult calibration, long-term reliability issues) and cost limitations. Hence, several indirect methods for reconstructing the pressure profile have been considered in the literature. They differ for the estimation techniques adopted as well as for the measured quantity, including vibration signals [10], acoustic emissions [11], and mechanical stress [12].
Most of the proposed methods have in common the use of measurements of the engine speed and the reconstruction of the in-cylinder pressure from an estimate of the indicated torque. The first seminal works in this respect are based on frequency domain signal processing [13,14]. In [13], a model for the dynamics of an internal combustion engine is proposed, in which the input is given by the cylinder pressure and the outputs correspond to crankshaft angular acceleration and crankshaft torque. In [14], a deconvolution method for the estimation of the mean torque produced by each cylinder during each stroke, from a measurement of crankshaft angular velocity, is proposed. In [15], the authors estimate a linear correlation between the in-cylinder pressure and the engine speed by using frequency response functions.
An alternative line of research is that of model-based estimation methods. In [16,17], the authors combine the speed signal with the measurement of the pressure in one key cylinder to reconstruct the indicated torque and hence the pressure in every cylinder. A drawback of this approach is to require the presence of a pressure sensor in at least one cylinder, thus, involving more expensive and invasive solutions, as well as a higher deterioration risk. Estimation methods based on sliding observers have been proposed in [18,19]. Nonlinear models, such as NARX, recurrent neural networks, and Chebishev polynomial expansions, have been also considered [20][21][22][23]. An approach based on the combined use of crankshaft speed measurements and a zero-dimensional (0D) thermodynamic model has been recently presented in [24].
Another family of approaches for pressure estimation is based on Kalman filtering. Such techniques require a state-space model representation of the overall system, in which the state vector may include both variables of interest and model parameters to be estimated. The works [25][26][27] share a common framework in which the indicated torque is estimated from measurements of the engine speed, and the squared engine speed is chosen as a state variable. In [25], the authors choose directly the net torque as an additional state variable, modeling its dynamics as a discrete low pass filter excited by a white process. The incylinder pressure is then reconstructed from the net torque estimate provided by a Kalman filter. A similar approach is taken in [26], in which the periodicity of the system is exploited to set up a time-varying Kalman filter. In [27], the indicated torque is decomposed in two terms, due, respectively, to the compression and combustion pressure, both provided by a 0D cylinder pressure model. The compression term is assumed to be equal for all cylinders, while the shape of the combustion torque of each cylinder is scaled and shifted in the crank angle domain to increase the flexibility in modeling the combustion pressure. This approach is further enhanced in [28], where the shape of the combustion pressure is provided by a sensor mounted on the first cylinder. A mass-spring-damper model is also added to consider torsional and friction effects. In [20], an extended Kalman filter is employed to train a nonlinear model of the crank kinematics, described by a NARX neural network. Other approaches based on Kalman filtering exploit different sensor measurements. In [29], a Kalman filter is used to smooth the pressure measurements provided by an in-cylinder sensor using a thermodynamic pressure model. Measurements of the engine structural vibrations, provided by an accelerometer on the engine block, are exploited in [30]. In-cylinder pressure estimation based on the mechanical stress measured by a strain washer installed on an engine head screw has been proposed in [31]. Finally, it is worth recalling that there is a vast literature on the estimation of the indicated torque from speed or acceleration measurements; see, for example, [32][33][34], which is closely related to the pressure estimation problem.
In this paper, a method for estimating the in-cylinder pressure from measurements of the crankshaft rotational speed based on an Extended Kalman Filter (EKF) is presented. As in [27], the pressure contributions due to the compression and combustion phases are considered separately. The main novelty of the proposed approach is that the 0D combustion pressure model is replaced by an experimental parameterization, obtained by averaging pressure profiles from a set of different operating points. This approach permits better capture of the specific behavior of the engine during the combustion phase in the desired range of operating conditions. Once the parameterization has been established, no in-cylinder pressure sensor is required for online operations. The EKF is employed to estimate the amplitude and phase shift of each cylinder pressure profile. Plugging the estimated parameters into the combustion pressure model, one can finally reconstruct the overall pressure signal. The procedure is validated on real data collected from a Yanmar 4-cylinder 2100cc turbocharged CI Diesel engine. The results of the experimental campaign demonstrate that the proposed technique effectively tracks changes in the engine working conditions. Moreover, it allows one to detect anomalies leading, for example, to cylinderto-cylinder variations.
The rest of the paper is organized as follows. Section 2 introduces the dynamic model of the engine. In Section 3, the pressure estimation approach based on the EKF is presented. The results of the experimental tests are reported in Section 4, while some concluding remarks are given in Section 5.

In-Cylinder Pressure Model
In this section, the dynamic model of the engine speed and the parameterization of the pressure signal are detailed.

Engine Speed Dynamics
The net torque at the crankshaft T(ϕ) is decomposed into three terms as where T ind is the indicated (or gas) torque, T load is the load torque, T dist is the disturbance torque, whose major component is due to friction, and ϕ is the crank angle. The net torque is responsible for variations of the kinetic energy, according to the dynamic model [27] T(ϕ) = θ(ϕ) dφ dϕφ where θ(ϕ) is the moment of inertia of the crank slider, which depends on the crank angle ϕ. Notice that θ(ϕ) and its derivative are known from the geometry and the masses of the pistons. Equation (2) can be exploited to derive the relationship between the angular speed and the net torque. In fact, inverting (2) and considering the square of the engine speed, one gets Let us write the torque as whereT is the mean torque over one cycle and [T] ∼ denotes the alternating component of the torque. At steady state the meanT is zero, i.e., The alternating part of the load torque is negligible over an engine cycle, i.e., From (1), (4), (5) and (6), one obtains Exploiting (7), the square engine speed dynamics (3) reads The indicated torque is further decomposed by considering separately the effect of the pressure caused by the compression and the combustion strokes, which will be denoted by p comp (ϕ) and p cmb (ϕ), respectively. This leads to The combustion torque of each cylinder is related to the combustion pressure as where l = 1, . . . , 4 is the cylinder index (in firing order), ϕ l = ϕ − (l − 1)π is the shifted crank angle of cylinder l, S is the section of the piston and h(ϕ) is the crank lever. At this point, the total combustion torque component is given by Similarly, the compression torque is equal to where

Pressure Parameterization
Let us now introduce the parameterization of the in-cylinder pressure to be estimated. As mentioned, the pressure components due to the compression and combustion strokes are treated separately. As in [27], the former is provided by a 0D pressure model without imposed combustion, hereafter denoted byp comp . Since this term depends essentially on the intake manifold pressure, it can be safely assumed to be equal for all cylinders during one engine cycle. Hence, by including (13) into (12), the estimation of the compression torque isT Conversely, this assumption does not apply to the combustion torque of each cylinder l, which may depend on different timing and amount of fuel injected. Consequently, an estimateT cmb,l of the combustion torque of each cylinder is obtained by replacing p cmb in (10) with a shifted and scaled version of a combustion pressure basis functionp cmb (ϕ). This leads toT where α l = [α 1,l , α 2,l ] T , and α 1,l α 2,l denote the scaling and shifting parameters of the l-th cylinder, respectively. In this work, the combustion pressure basis functionp cmb is constructed from real-data of the in-cylinder pressure, directly acquired through an experimental campaign by four Kistler 6125C11 piezoelectric sensors triggered by the angular position registered by an AVL 365C optical encoder keyed on the crankshaft. The pressure trace has been measured in different working conditions of the engine, featuring different loads and rotating speeds, and then averaged by means of a moving window of 70 consecutive acquisition cycles to remove the main noise components. The number of analyzed working points is denoted by N wp . It is worth stressing that such data acquisition is performed only once for a given engine, and no pressure sensors are required during normal engine operations. Let us denote by p i re f ,l the reference indicated pressure obtained from direct measurements of the pressure in cylinder l, with the engine operating in working condition i. The combustion pressure basis function is obtained by computing the difference between the reference indicated pressure p i re f ,l and the corresponding 0D compression pressurep i comp,l . Then, these signals are averaged over all cylinders and working points, thus, obtaining the combustion pressure basis function Figure 1 displays the average combustion pressure profile, along with the profiles of each working point, resulting from the experimental tests described in Section 4. Note that each combustion pressure profile depicted in Figure 1 (blue curves) is obtained by subtracting the compression profile provided by the 0D model from the measured total in-cylinder pressure. Hence, odd behaviors showing up in some profiles are due to poor estimates of the compression profile by the 0D model.

Extended Kalman Filter for In-Cylinder Pressure Estimation
In this section, the EKF-based estimation scheme is presented. The square of the engine speed is set as the first state-space variable of the dynamic model of the EKF, namely x 1 =φ 2 . By using Euler's method, Equation (8) is discretized with angular step ∆ϕ 0 , corresponding to the resolution of the toothed flywheel of the angular speed sensor. For ease of notation, let us denote by k the discretized angle k∆ϕ 0 , with k = 0, 1, 2, . . .. Then, one gets the equation where By plugging the parametric model of the indicated torque (9)-(15) into (17) and including the parameter vector α = α T 1 , . . . , α T 4 T in the state variables, one gets the extended state space dynamics where x(k) = x 1 (k), α T (k) T is the augmented state vector, the state vector field is given by and T comp (k) ∼ is treated as a known external input. The disturbance process w(k) ∈ R 9 is modeled as a zero-mean white process with covariance matrix Q, whose choice is a tuning parameter of the filter. The first element w 1 (k) accounts for all unmodeled effects in the speed dynamics, including the alternate component of the disturbance load [T dist (k)] ∼ . The remaining components w i (k), i = 2, . . . , 9 are used to tune the bias-variance trade-off in the estimate of the parameters α. The alternating part ofT comp (k) is computed by simply subtracting the mean value, averaged on an entire engine cycle. This is possible because the knowledge of the compression pressure coming from the 0D model is always available online during the engine cycle. For the combustion torque, at each filtering step k, the mean component is computed through the model (11)-(15) with the current estimate of the parameter vectorα(k), thus where N s = 720 ∆ϕ 0 is the number of samples in a single engine cycle. At this point, the oscillating combustion torque reads T cmb (k,α(k)) ∼ =T cmb (k,α(k)) −T cmb (α(k)).
It can be observed that the state dynamics (20) is not linear due to the presence of the phase shift α 2,l in the combustion pressure profilep cmb in (15). This is the reason why the EKF is adopted to estimate the state x(k) by using measurements of the squared engine speed. Once the parameter estimatesα l , l = 1, . . . , 4, are available, an estimate of the in-cylinder pressure for cylinder l can be obtained aŝ p l (ϕ,α l ) =p comp (ϕ l ) +α 1,lpcmb (ϕ l −α 2,l ).
Instantaneous engine speed measurements are fed to the EKF. The measurement error, denoted by v(k) in (25), is modeled as a zeromean white process with variance R. Letx(k|k) denote the estimate of the state x at time k based on the observations y(h) of the output, for h = 0, . . . , k and P(k|k) be its covariance matrix. Then, the standard equations of the EKF prediction step are [35] x(k + 1|k) = f (x(k|k),T comp (k)) (26) while those of the correction step arê where is the Kalman gain. The Jacobian matrix of the vector field in (20) is given by where with and p cmb (ϕ) = ∂p cmb (ϕ) ∂ϕ . The Jacobian of the measurement equation is given by The scheme of the overall proposed estimation procedure is outlined in Figure 2. The data about intake and exhaust pressure and temperature, which are usually acquired by the Engine Control Unit (ECU), are employed as boundary conditions in the 0D model integration for obtaining the compression pressure. The raw engine speed measurements, coming directly from the pickup sensor, are suitably pre-processed to compensate for the main torsional effects.

Experimental Results
In this section, the proposed pressure estimation technique is validated on real engine speed data and indicated pressure collected within the experimental test-bed described in [36]. Experimental data have been acquired in a number of working points of a Yanmar 4-cylinder 2100cc turbocharged compression ignition Diesel engine. In particular, such working points feature different loads and speeds. Some tests have been also run under non-standard engine conditions, such as fuel injection anomalies. The different working points are identified by a simple nomenclature. Three different load levels, denoted by L1, L2, and L3, correspond to 10% (low), 50% (medium), and 100% (high) of the maximum engine load, respectively. The engine speed in expressed rpm. The presence of a fuel injection anomaly is indicated by either the letter "n" or "p" plus a number indicating the percentage of under-or over-injection of fuel in the cylinder, respectively. For instance, L1 1300 n5p5p0p0 means that the data are acquired with the engine loaded at minimum, running at a steady state engine speed of 1300 rpm, 5% less fuel is injected in cylinder 1, and 5% more fuel is injected in cylinder 2. All the working points analyzed in both standard and non-standard conditions are displayed in Figure 3. It is worth stressing that they also include working points that were not among those used to construct the basis function p cmb , as described in Section 2.
The results reported hereafter have been obtained by running the proposed method in the Matlab environment on a standard laptop. Moreover, the estimation architecture shown in Figure 2 has been implemented in the ECU of the engine under evaluation, demonstrating that the proposed technique is feasible for real-time operation.

Validation of the Pressure Parameterization
The first set of results concerns the validation of the proposed parameterization of the combustion pressurep cmb . To this aim, a nonlinear least squares error (NLSE) estimate of the optimal parameter pairs α * l = α * 1,l , α * 2,l for each cylinder l, has been computed. This amounts to minimize the error between the estimated pressure (24) and the reference pressure p re f ,l , hence where the norm operator indicates the signal L 2 -norm. This method has been applied for both the parameterizationp cmb proposed in this paper and for the combustion pressure profile obtained by the 0D model with imposed combustion, namelyp cmb,0D , which is used in [27]. Let us define the FIT as a pressure estimation performance index as follows: with FIT l = 100 1 − ||p re f ,l −p l || ||p re f ,l −p re f ,l || , wherep re f ,l is the sample mean of the reference pressure in cylinder l. The average FIT among the cylinders of each selected working point is used as a benchmark for comparison. As shown in Figure 4, the mean FIT of the in-cylinders pressure obtained by the proposed experimental parameterization is always higher than the one relying on the combustion pressure returned by the 0D model. Although these results have been obtained offline, they suggest that the proposed parameterization is promising for combustion pressure fitting and, thus, for indicated pressure estimation.

EKF Pressure Estimation
The engine speed has been measured by a phonic wheel sensor with 60-2 teeth. The discretization has been enhanced using cubic spline interpolation, providing 1440 points per cycle from the original 116. This corresponds to a sampling angular step of ∆ϕ 0 = 0.5 CAD. A moving average filter then smoothes this signal to reduce the measurement noise. The main torsional effects are compensated by an additional pre-stored correction vector and then further corrected in the frequency domain exploiting a 0D engine model with imposed combustion, as detailed in [36]. Such processed measurements are then fed to the EKF presented in Section 3. The filter is run for 300 consecutive engine cycles, which have been observed to be fully sufficient to achieve convergence of the parameter estimates.
The results in terms of FIT of the steady state EKF estimate of the indicated pressure for all tested points are reported in Figures 5 and 6, together with the ones obtained by usingp cmb,0D as basis function, according to what done in [27]. First, it can be seen that the FIT reached by the proposed EKF scheme is very high, meaning that the estimated pressure profiles fit the reference indicated pressure with very good accuracy. Moreover, the proposed parameterization yields better results than the one based onp cmb,0D , except for very few working points. On average, the new parameterization provides a FIT improvement of 2% (considering both standard and non-standard working points). An example of such improvement is shown in Figure 7, which depicts the pressure estimates of the EKF with both the proposed parameterizationp cmb andp cmb,0D together with the measured indicated pressure of the first cylinder, i.e., p re f ,1 , of the standard working point L1 1100.  Similar results have also been achieved in terms of IMEP. Table 1 shows some statistics about the IMEP estimation error using the two parameterizations under discussion, with respect to the one computed on the reference pressure p re f . It can be seen that, even though the proposed methodology is not specifically designed for this specific performance index, it achieves good accuracy also as an IMEP estimator. In Figure 8, the estimates of the parameters α are reported together with their 3σconfidence intervals, for the same working point. It can be observed that all parameters converge to a steady state value in approximately 100 cycles, corresponding to a few seconds. Notice that the scaling parameters α 1 have a much faster convergence than the shifting ones α 2 . Moreover, the four cylinders show little differences among such parameters since the analyzed working point is run in standard engine conditions.  To validate the behavior of the EKF also during transient engine operations, the working point L2 1500 has been run for 150 cycles, after which a 5% excess of fuel has been injected in the first cylinder, thus, turning the operating conditions into the non-standard working point L2 1500 p5p0p0p0. The evolution of the scaling parameters estimates of this experiment are reported in Figure 9. It can be seen that the parameter α 1,1 jumps to a higher value, with respect to the other parameters, in less than 50 cycles. This result highlights the adaptability of the proposed approach to engine condition changes and, in particular, the possibility to detect cylinder-to-cylinder variations. Furthermore, by comparing Figures 8 (top) and 9, it can be observed that different loads and engine speeds correspond to different steady-state values of parameter α 1 . For example, the value of parameters α 1 for the L1 cases is in the order of 0.5, meaning that the combustion pressure profile is a shrunk version of the one used in the proposed parameterizationp cmb . Figure 9. EKF estimates of parameters α 1 of all cylinders for working point L2 1500 with confidence intervals. After 150 engine cycles, a 5% excess of fuel is injected in the first cylinder so that the new working point is L2 1500 p5p0p0p0.

Conclusions
In this paper, the problem of estimating the in-cylinder pressure of an internal combustion engine from instantaneous engine speed measurements has been addressed. The proposed approach leverages a novel combustion pressure parameterization obtained from experimental data and employs an Extended Kalman Filter to estimate online the pressure parameters. A major advantage of the proposed technique is that direct pressure measurements are used only to construct the data-based parameterization and only a standard phonic wheel speed sensor is employed during normal engine operations.
Extensive experimental validation, covering a wide range of operating points has shown that the proposed approach provides accurate pressure estimates, both in nominal and off-nominal conditions. Overall, it was observed that the novel parameterization is able to better reconstruct the pressure profile. This results in improved fitting performance, when compared to similar techniques relying exclusively on 0D pressure parameterization. A precise reconstruction of the pressure profile turned out to be beneficial also in terms of IMEP estimation. Summing up, the adoption of an Extended Kalman Filter for estimation purposes allow one to automatically adapt the parameter estimates when variations in the operating conditions occur and detects the presence of cylinder-to-cylinder variations at steady-state. The design of filters tailored to the estimation of specific performance indexes (such as IMEP, MFB, etc.) is the subject of ongoing research.

Data Availability Statement:
The data presented in this study are not publicly available due to confidentiality issues.

Conflicts of Interest:
The authors declare no conflict of interest.