Multi-cylinder engine instantaneous rotating speed real-time observation method based on EKF
Through EKF and Kalman filtering algorithms, a nonlinear mathematical model and state space model are established, which solves the instantaneous speed signal-to-noise problem of multi-cylinder engines, and realizes accurate observation of instantaneous speed and signal-to-noise ratio improvement.
Patent Information
- Application Number
- CN202411036873.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-26
AI Technical Summary
The instantaneous speed signal of a multi-cylinder engine is easily distorted due to the influence of measurement noise, which makes it difficult to monitor effective operation information.
The EKF-based real-time observation method of instantaneous speed of multi-cylinder engine is adopted. By establishing a nonlinear mathematical model, a state space model is constructed, and the Kalman filtering algorithm is used to perform time and measurement updates, the optimal estimation of instantaneous speed is achieved.
It effectively eliminates noise in the instantaneous speed signal, improves the signal-to-noise ratio, and realizes accurate observation of the instantaneous speed of multi-cylinder engines, and is suitable for stable and variable speed conditions.
Smart Images

Figure CN119026330A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of multi-cylinder engine state monitoring, and in particular relates to an online real-time filtering method suitable for instantaneous speed signals of crankshafts of multi-cylinder engines. Background Art
[0002] The instantaneous speed of a multi-cylinder engine contains a wealth of working status information, which can be used for engine fault diagnosis, combustion status evaluation, power performance monitoring, etc. However, due to the influence of measurement noise, the instantaneous speed signal is often distorted, which makes it very difficult to monitor effective operating information in actual operation. Summary of the invention
[0003] In order to solve the above problems, the present invention proposes a real-time observation method of instantaneous speed of a multi-cylinder engine based on EKF (extended Kalman filter). The technical solution adopted by the present invention is as follows:
[0004] A real-time observation method for instantaneous speed of a multi-cylinder engine based on EKF, comprising:
[0005] Step 1: According to the instantaneous speed characteristics of the crankshaft of a multi-cylinder engine, a nonlinear mathematical model of the instantaneous speed is established.
[0006] In the actual operation of a multi-cylinder engine, the crankshaft speed is not fixed. Since each cylinder takes turns to work and burn and drive the crankshaft, the instantaneous speed will fluctuate around the average speed. According to the characteristics of instantaneous speed fluctuation, under ideal conditions, the speed fluctuation can be approximated as a sinusoidal periodic signal.
[0007] This application approximates the instantaneous engine speed signal as the sum of the average speed and the speed fluctuation:
[0008]
[0009] In the formula, is the average speed; a is the amplitude of the speed fluctuation; ω is the angular frequency of the speed. According to the structural information of the engine, the calculation formula of the angular frequency is expressed as:
[0010] ω=2π·f (2)
[0011] Among them, f is the engine speed, which can be obtained according to the average speed:
[0012]
[0013] Where I is the number of cylinders of the engine.
[0014] According to equations (2) and (3), the relationship between angular frequency and average speed can be obtained:
[0015]
[0016] According to equations (1) and (4), the nonlinear mathematical model of instantaneous speed is obtained:
[0017]
[0018] Step 2: Construct a state space model, verify the observability of the model, and perform discretization.
[0019] 1) Select the instantaneous speed fluctuation of the engine as the first state variable, that is, x 1 =asin(ωt); select the second state variable as x 2 =acos(ωt); the average speed is selected as the third state variable, that is,
[0020] The relationship between the three state variables is:
[0021]
[0022] The nonlinear continuous-time state space equation of instantaneous speed is obtained by sorting out:
[0023]
[0024] Where y is the instantaneous speed of the system.
[0025] Since formula (7) is a nonlinear model, it is linearized by deriving the Jacobian matrix, and then its observability is judged according to the rank of the observability matrix. According to formula (7), the Jacobian matrix A can be obtained as:
[0026]
[0027] Then, the observability matrix is R o for:
[0028]
[0029] Observability matrix R o The determinant of is:
[0030]
[0031] Since b and x 3 The values of are not 0, then as long as x 1 Not equal to x 3 , equation (9) is full rank. And because the engine speed fluctuation is much smaller than the average speed, we have x 1Much smaller than x 3 Then, the observability matrix R o The rank of is 3, which means that the state space model of the nonlinear continuous system is observable.
[0032] 2) Assuming the sampling step length is Δt, the continuous state space equation of equation (7) is discretized, then the state variable x at t k-1 The derivative at time can be approximated as:
[0033]
[0034] t k ,t k-1 Substituting k and k-1, equation (11) is transformed into:
[0035] x(k)=x(k-1)+Δt·f(x(k-1)) (12)
[0036] at this time,
[0037]
[0038] Then the discrete state space model can be expressed as:
[0039]
[0040] Among them, C=[1 0 1].
[0041] Step 3: Optimal estimation method of instantaneous speed based on Kalman filter
[0042] 1) After considering the process noise w(k) and measurement noise v(k), equation (14) can be written as:
[0043]
[0044] w(k) and v(k) are independent zero-mean Gaussian white noises, and their covariance matrices are Q and R respectively; where Q is a 3×3 dimensional diagonal matrix, Q=diag[q 1 q 2 q 3 ], R is a one-dimensional scalar; q 1 ,q 2 ,q 3 and R are determined according to the actual situation;
[0045] 2) Linearize the nonlinear model (15). According to the Kalman filter algorithm, let the estimated value of x(k) be A priori estimate and the posterior estimate
[0046] At sampling time k, the posterior estimate of the state variable x(k) at time k-1 is exist w(k-1) 0 = 0, perform Taylor series expansion on x(k) = g(x(k-1), w(k-1)), omit the second-order and higher terms, and obtain the approximate linear expression of the state equation:
[0047]
[0048] Among them, A(k-1) and M(k-1) are x(k) in The Jacobian matrix at , we get:
[0049]
[0050] M(k-1) is a constant:
[0051]
[0052] 3) The optimal estimation method based on Kalman filtering includes two update processes: time update and measurement update. In the time update stage, the nonlinear model is used to calculate the state prior estimate. In the measurement update stage, the error between the instantaneous speed measurement value and the prior estimate is used for feedback correction to calculate the posterior estimate so that the posterior estimate gradually approaches the true value. The specific steps are as follows.
[0053] A. Time update phase:
[0054] ① The posterior estimate of the state variable x(k) at time k-1 Substitute into the nonlinear model (15) and calculate the prior estimate Right now:
[0055]
[0056] When k = 1, is the default value;
[0057] ② Calculate the Jacobian matrix A(k-1) of the state variable x(k) according to formula (17);
[0058] ③Use the Jacobian matrix A(k-1) obtained in step ② and P(k-1) at the previous moment + , calculate the prior estimate covariance matrix P(k) - ,Right now:
[0059] P(k) - =A(k-1)P(k-1) + A(k-1) T +M(k-1)·Q·M(k-1) T(20)
[0060] When k = 1, P(0) + , Q is the preset value;
[0061] B. Measurement update phase:
[0062] ④Use the prior estimate covariance matrix P(k) obtained in step ③ - Calculate the Kalman filter gain K(k):
[0063] K(k)=P(k) - C T [C·P(k) - ·C T +R] -1 (twenty one)
[0064] ⑤According to the feedback instantaneous speed y(k), the estimation system is modified and the obtained posterior estimation value is Time update for the next moment:
[0065]
[0066] ⑥ Calculate the posterior estimation error covariance matrix P(k) + , used to update the time at the next moment:
[0067] P(k) + =(IK(k)·C)P(k) - (IK(k)·C) T +K(k)·R·K(k) T (twenty three)
[0068] ⑦ Calculate the estimated instantaneous speed:
[0069]
[0070] C. Set the sampling time and initial value of state variables Initial value of error covariance P(0) + , and the initial values of Q and R; according to equation (19) to equation (24), the system state, Kalman filter gain and covariance matrix are continuously updated to estimate the instantaneous speed.
[0071] The advantages of the present invention are:
[0072] 1. According to the instantaneous speed characteristics of a multi-cylinder engine, a new nonlinear state space model of instantaneous speed is proposed with the instantaneous speed fluctuation, the correlation function of the fluctuation and the average speed as three state variables, and the observability of the model is verified.
[0073] 2. In order to solve the problems of measurement noise and model uncertainty in engineering applications, the measurement noise and process noise are taken into account in the model, which improves the model accuracy. The model is not only suitable for instantaneous speed observation under stable speed, but also for instantaneous speed observation under variable speed.
[0074] 3. Based on the established nonlinear model, an online real-time observation method of instantaneous speed based on the extended Kalman filter method is proposed. Based on the linear Kalman filter, according to the characteristics of the nonlinear model, this method linearizes the model by obtaining the Jacobian matrix at each sampling point, and updates the feedback gain matrix in real time, and performs cyclic iteration and rolling optimization on the estimated value of the state variable to achieve accurate estimation of the instantaneous speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, all other embodiments obtained without creative work are within the scope of protection of the present invention.
[0076] Figure 1 Flowchart of algorithm for estimating instantaneous speed based on extended Kalman filter
[0077] Figure 2 Instantaneous speed test signal with a speed of 900rpm and a load of 10kw
[0078] Figure 3 Instantaneous speed test signal with a speed of 1000rpm and a load of 10kw
[0079] Figure 4 Comparison of the results before and after the instantaneous speed estimation based on EKF under 900rpm and 10kw conditions
[0080] Figure 5 Comparison of the results before and after the instantaneous speed estimation based on EKF under 1000rpm and 10kw conditions
[0081] Figure 6 Comparison of signal-to-noise ratio before and after estimation of 10 groups of speed samples under 900rpm and 10kw conditions
[0082] Figure 7 Comparison of signal-to-noise ratio before and after estimation of 10 groups of speed samples at 900rpm and 20kw
[0083] Figure 8 Comparison of signal-to-noise ratio before and after estimation of 10 groups of speed samples at 1000rpm and 10kw
[0084] Fig. 9Comparison of signal-to-noise ratio before and after estimation of 10 groups of speed samples at 1000rpm and 20kw DETAILED DESCRIPTION
[0085] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other implementations obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0086] An embodiment of the present invention provides an online real-time filtering solution for the instantaneous speed signal of a multi-cylinder engine, comprising: acquiring the instantaneous speed signal in real time and determining the pending parameters, inputting the speed signal into an extended Kalman filter optimal estimation model to obtain the optimal estimate of the instantaneous speed, and calculating the signal-to-noise ratio of the original speed signal and the estimated speed signal.
[0087] The following are detailed descriptions of each.
[0088] Step 1: Establish a nonlinear mathematical model of instantaneous speed and perform parameter identification.
[0089] According to the instantaneous speed fluctuation law of the engine, the nonlinear mathematical model of the instantaneous speed is given:
[0090]
[0091] In the formula, is the average speed; a is the amplitude of the speed fluctuation; ω is the angular frequency of the speed. According to the structural information of the engine, the calculation formula of the angular frequency is expressed as:
[0092] ω=2π·f (2)
[0093] Among them, f is the engine speed, which can be obtained according to the average speed:
[0094]
[0095] Where I is the number of cylinders of the engine.
[0096] According to equation (2) and equation (1), the relationship between angular frequency and average speed can be obtained:
[0097]
[0098] According to equations (1) and (4), the nonlinear mathematical model of instantaneous speed is obtained:
[0099]
[0100] The undetermined parameter b in model (5) is calculated based on the number of cylinders of the engine.
[0101] Taking the engine model used in the test as an example, the engine model used in the test is an inline 4-cylinder engine. Then the number of cylinders I is 4, and the parameter b can be obtained by the following formula:
[0102]
[0103] Step 2: Construct the injection observation state space model and discretize it.
[0104] The instantaneous speed fluctuation of the engine, the correlation function of the fluctuation and the average speed are selected as three state variables, namely x 1 =asin(ωt),x 2 =acos(ωt), Considering the steady speed is approximately a constant, so The nonlinear equation of the system can be obtained:
[0105]
[0106] Where y is the measured output of the system, i.e., the instantaneous speed. The nonlinear continuous-time state space model of the instantaneous speed is:
[0107]
[0108] Discretize the continuous state space model. Assume that the sampling step is △t, and the state variable x(t) is k-1 The derivative at time can be approximately expressed as:
[0109]
[0110] t k ,t k-1 Substituting k and k-1, equation (9) can be written as:
[0111] x(k)=x(k-1)+Δt·f(x(k-1)) (10)
[0112] at this time,
[0113]
[0114] Then the discrete state space model can be expressed as:
[0115]
[0116] Among them, C=[1 0 1].
[0117] Step 3: Optimal estimation of instantaneous speed based on Kalman filtering
[0118] 1) After considering the process noise w(k) and measurement noise v(k), equation (14) can be written as:
[0119]
[0120] w(k) and v(k) are independent zero-mean Gaussian white noises, and their covariance matrices are Q and R respectively; where Q is a 3×3 dimensional diagonal matrix, Q=diag[q 1 q 2 q 3 ], R is a one-dimensional scalar; q 1 ,q 2 ,q 3 and R are determined according to the actual situation;
[0121] 2) Linearize the nonlinear model (13). According to the Kalman filter algorithm, let the estimated value of x(k) be A priori estimate and the posterior estimate
[0122] At sampling time k, the posterior estimate of the state variable x(k) at time k-1 is exist w(k-1) 0 = 0, perform Taylor series expansion on x(k) = g(x(k-1), w(k-1)), omit the second-order and higher terms, and obtain the approximate linear expression of the state equation:
[0123]
[0124] Among them, A(k-1) and M(k-1) are x(k) in The Jacobian matrix at , we get:
[0125]
[0126] M(k-1) is a constant:
[0127]
[0128] 3) The optimal estimation method based on Kalman filtering includes two update processes: time update and measurement update. In the time update stage, the nonlinear model is used to calculate the state prior estimate. In the measurement update stage, the error between the instantaneous speed measurement value and the prior estimate is used for feedback correction to calculate the posterior estimate so that the posterior estimate gradually approaches the true value. The specific steps are as follows.
[0129] A. Time update phase:
[0130] ① The posterior estimate of the state variable x(k) at time k-1 Substitute into the nonlinear model (12) and calculate the prior estimate Right now:
[0131]
[0132] When k = 1, is the default value;
[0133] ② Calculate the Jacobian matrix A(k-1) of the state variable x(k) according to formula (15);
[0134] ③Use the Jacobian matrix A(k-1) obtained in step ② and P(k-1) at the previous moment + , calculate the prior estimate covariance matrix P(k) - ,Right now:
[0135] P(k) - =A(k-1)P(k-1) + A(k-1) T +M(k-1)·Q·M(k-1) T (18)
[0136] When k = 1, P(0) + , Q is the preset value;
[0137] B. Measurement update phase:
[0138] ④Use the prior estimate covariance matrix P(k) obtained in step ③ - Calculate the Kalman filter gain K(k):
[0139] K(k)=P(k) - C T [C·P(k) - ·C T +R] -1 (19)
[0140] ⑤According to the feedback instantaneous speed y(k), the estimation system is modified and the obtained posterior estimation value is Time update for the next moment:
[0141]
[0142] ⑥ Calculate the posterior estimation error covariance matrix P(k) + , used to update the time at the next moment:
[0143] P(k) + =(IK(k)·C)P(k) - (IK(k)·C)T +K(k)·R·K(k) T (twenty one)
[0144] ⑦ Calculate the estimated instantaneous speed:
[0145]
[0146] C. Set the sampling time and initial value of state variables Initial value of error covariance P(0) + , and the initial values of Q and R; the selection of Q and R mainly considers the influence of process noise and measurement noise on the filtering effect, and can be selected according to the actual situation. In this application, Q = diag ([1 0.01 1]) and R = 40 are selected. According to equations (17) to (22), the system state, Kalman filter gain and covariance matrix are continuously updated to estimate the instantaneous speed.
[0147] This embodiment uses a photoelectric encoder to obtain the instantaneous speed signal of the multi-cylinder engine in real time. According to equations (17) to (22), calculations are performed repeatedly to continuously update the system state, Kalman filter gain and covariance matrix to achieve instantaneous speed estimation.
[0148] In order to verify the filtering effect of the observation method under different working conditions, the speed signals of 900rpm, 10kw and 1000rpm, 10kw are taken as examples. The measured speed signals are shown in the attached figure. Figure 2 , Attachment Figure 3 shown.
[0149] The EKF designed based on the model proposed in the present invention performs filtering estimation on the instantaneous speed under the working condition of 900rpm and 10kw. The instantaneous speed before and after the estimation is compared as shown in the attached figure. Figure 4 The EKF designed based on the model proposed by the present invention performs filtering estimation on the instantaneous speed of 1000rpm and 10kw. The instantaneous speed before and after the estimation is compared as shown in the attached figure. Figure 5 As shown in the figure, it can be seen that the method proposed in this application can effectively eliminate interference and fluctuations in the signal.
[0150] In order to quantitatively analyze the degree of filtering, the signal-to-noise ratio (SNR) is introduced as an evaluation index:
[0151]
[0152] Where N is the signal length, P s is the power of the signal, P n is the power of the noise, and y(k) is the instantaneous speed at the kth moment.
[0153] The speed and load are under 4 working conditions: 900rpm, 10kw; 900rpm, 20kw; 1000rpm, 10kw; 1000rpm, 20kw. There are 10 groups of samples under each working condition. Based on the present invention, the instantaneous speed is filtered and estimated, and the comparison diagram of the instantaneous speed signal-to-noise ratio before and after the estimation is obtained. Figures 6 to 9 shown.
[0154] It can be seen that the signal-to-noise ratio of the instantaneous speed can be improved under all four working conditions, that is, the noise in the instantaneous speed can be reduced. The average signal-to-noise ratio before and after the estimation of each group of 10 samples is calculated, and the signal-to-noise ratio before and after the instantaneous speed estimation is obtained as shown in Table 1 below. As can be seen from Table 1, the method proposed in this patent can effectively improve the signal-to-noise ratio of the instantaneous speed.
[0155] Table 1
[0156]
[0157]
Claims
1. A real-time observation method for instantaneous speed of a multi-cylinder engine based on EKF, characterized in that: The method comprises the following steps: Step 1: Establish a nonlinear mathematical model of instantaneous speed according to the instantaneous speed characteristics of the crankshaft of the multi-cylinder engine; the instantaneous speed nonlinear mathematical model is: is the average speed; a is the amplitude of speed fluctuation; I is the number of cylinders of the engine, and t represents time; Step 2: Construct a state space model and discretize it; 1) Select the instantaneous speed fluctuation of the engine as the first state variable, that is, x1 = asin(ωt); select the second state variable as x2 = acos(ωt); select the average speed as the third state variable, that is The relationship between the three state variables is shown in formula (2): The nonlinear continuous-time state space model of instantaneous speed is obtained as follows: In formula (3), y is the instantaneous speed of the system; 2) Assuming the sampling step length is Δt, the continuous state space equation of formula (3) is discretized, then the state variable x at t k-1 The derivative at time can be approximated as: t k ,t k-1 Substituting k and k-1, equation (4) is transformed into: x(k)=x(k-1)+Δt·f(x(k-1)) (5) at this time, Then the discrete state space model can be expressed as: Among them, C=[1 0 1]. Step 3: Optimal estimation of instantaneous speed based on Kalman filtering; 1) After considering the process noise w(k) and measurement noise v(k), equation (7) can be written as: w(k) and v(k) are independent zero-mean Gaussian white noises, and their covariance matrices are Q and R, respectively. Q is a 3×3 diagonal matrix, Q=diag[q1 q2 q3], and R is a one-dimensional scalar; q1, q2, q3 and R are selected according to actual conditions; According to the Kalman filter algorithm, let the estimated value of x(k) be A priori estimate and the posterior estimate 2) Linearize the nonlinear model (8): At sampling time k, the posterior estimate of the state variable x(k) at time k-1 is exist At w(k-1)0=0, perform Taylor series expansion at x(k)=g(x(k-1),w(k-1)), omit terms above the second order, and obtain an approximate linear expression of the state equation: Among them, A(k-1) and M(k-1) are x(k) in The Jacobian matrix at , where M(k-1) is a constant: 3) The optimal estimation method based on Kalman filtering includes two updating processes: time update and measurement update. In the time update stage, the nonlinear model is used to calculate the state prior estimation value. In the measurement update stage, the error between the instantaneous speed measurement value and the prior estimation value is used for feedback correction to calculate the posterior estimation value, so that the posterior estimation value gradually approaches the true value. The specific steps are as follows: A. Time update phase: ① The posterior estimate of the state variable x(k) at time k-1 Substitute into the nonlinear model (7) and calculate the prior estimate Right now: When k = 1, is the default value; ② Calculate the Jacobian matrix A(k-1) of the state variable x(k) according to formula (10); ③Use the Jacobian matrix A(k-1) obtained in step ② and P(k-1) at the previous moment + , calculate the prior estimate covariance matrix P(k) - ,Right now: P(k) - =A(k-1)P(k-1) + A(k-1) T +M(k-1)·Q·M(k-1) T (13) When k = 1, P(0) + , Q is the preset value; B. Measurement update phase: ④Use the prior estimate covariance matrix P(k) obtained in step ③ - Calculate the Kalman filter gain K(k): K(k)=P(k) - C T [C·P(k) - ·C T +R] -1 (14) ⑤According to the feedback instantaneous speed y(k), the estimation system is modified and the obtained posterior estimation value is Time update for the next moment: ⑥ Calculate the posterior estimation error covariance matrix P(k) + , used to update the time at the next moment: P(k) + =(I-K(k)·C)P(k) - (I-K(k)·C) T +K(k)·R·K(k) T (16) ⑦ Calculate the estimated instantaneous speed: C. Set the sampling time and initial value of state variables Initial value of error covariance P(0) + , and the initial values of Q and R; According to equations (12) to (17), the system state, Kalman filter gain and covariance matrix are continuously updated to estimate the instantaneous speed.
Citation Information
Cited By
DREKF-based real-time online diagnosis method for abnormal fault of valve clearance of engine
CN119848737A
Real-time online diagnosis method for engine valve clearance abnormal fault based on DREKF
CN119848737B
EKF-based gear fault real-time health monitoring method
CN120141842A
