A method and system for diagnosing EGR valve faults in diesel engines based on OBD data
By using an OBD data acquisition system and a CNN-GRU model that incorporates an attention mechanism, diesel engine EGR valve faults can be diagnosed in real time. This solves the problems of time-consuming, labor-intensive, false alarms, and missed alarms associated with traditional diagnostic methods, achieving efficient and accurate fault identification and regulatory compliance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NANJING UNIV OF SCI & TECH
- Filing Date
- 2026-01-29
- Publication Date
- 2026-06-02
AI Technical Summary
Existing diesel engine EGR valve fault diagnosis technology relies on disassembly and offline data analysis, which cannot monitor in real time, resulting in a high rate of false alarms and missed alarms, making it difficult to meet the China VI emission regulatory requirements.
By using an OBD data acquisition system, combined with a CNN-GRU model optimized by the dung beetle algorithm for variational mode decomposition and fusion attention mechanism, EGR valve-related parameters are collected and analyzed in real time, and time-domain, frequency-domain, and fusion features are extracted to achieve intelligent identification and verification of fault types.
It achieves non-invasive real-time diagnosis, with a fault diagnosis accuracy of ≥98%, a response time of ≤0.3 seconds, a false alarm rate lower than existing technologies, and meets the China VI emission regulatory requirements.
Smart Images

Figure CN122129365A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of diesel engine fault diagnosis technology, and in particular relates to a diesel engine EGR valve fault diagnosis method and system based on OBD data. Background Technology
[0002] The EGR valve is a core component of the engine emission control system, including China VI diesel engines. By precisely controlling the mixing ratio of exhaust gas recirculation flow and fresh air, it effectively reduces combustion temperature and nitrogen oxide generation. As a key actuator connecting the exhaust and intake systems, the opening accuracy, response speed, and sealing performance of the EGR valve directly determine the degree of engine emission compliance and power output stability. It is an indispensable control unit for meeting the stringent environmental standards of modern diesel engines.
[0003] Currently, the main methods for diagnosing EGR valve faults in diesel engines are shutdown inspection and offline data analysis. Repair personnel usually need to completely shut down the engine, disassemble the EGR valve and related pipelines for visual inspection, or read historical fault codes through a diagnostic tool for judgment. Although some advanced equipment can collect operating data, it still needs to be transmitted offline to dedicated software for post-processing, and it is impossible to dynamically monitor and evaluate the working status of the EGR valve in real time during normal vehicle operation.
[0004] Existing diagnostic technologies suffer from multiple shortcomings. The disassembly and inspection process is not only time-consuming and labor-intensive, but repeated disassembly and reassembly can easily damage seals and cause installation errors, leading to new potential faults. Offline detection methods rely too heavily on data from a single sensor, neglecting the multi-parameter coupling characteristics of the EGR system, making it difficult to identify complex fault modes such as slight jamming and intermittent poor sealing. The diagnostic results lack comprehensive analysis of exhaust temperature, pressure fluctuations, and emission concentrations, resulting in low accuracy in fault diagnosis. This fails to meet the regulatory requirements of the China VI emission standard for continuous emission compliance and cannot provide accurate fault location guidance for maintenance personnel, seriously affecting normal vehicle operation and environmental compliance. Therefore, a fault diagnosis method for diesel engine EGR valves based on OBD data is proposed. Summary of the Invention
[0005] The purpose of this invention is to address the problems mentioned in the background art, such as the reliance on disassembly and inspection for traditional EGR valve fault diagnosis, the inability to monitor in real time, the high false alarm and false alarm rates caused by single parameter judgment, and the difficulty in meeting emission regulatory requirements. The invention proposes a diesel engine EGR valve fault diagnosis method and system based on OBD data.
[0006] To achieve the objective of this invention, this invention provides a method for diagnosing EGR valve faults in a diesel engine based on OBD data, the method comprising:
[0007] Step 1: Collect OBD data of the diesel engine through the OBD data acquisition system. The OBD data includes EGR valve related parameters and engine operating parameters.
[0008] Among them, the EGR valve related parameters include position sensor voltage signal, H-bridge drive current signal, coolant temperature signal, and opening feedback signal; the engine operating parameters include speed, intake pressure, exhaust temperature, NOx emission concentration, and fuel injection quantity; the sampling frequency is set to 12.8kHz, the number of sampling points is 16384 per group, and each group contains 3 continuous working cycle signals.
[0009] Step 2: Use the dung beetle algorithm to optimize the variational mode decomposition parameters for OBD data preprocessing;
[0010] The penalty factor α of variational mode decomposition is 2000-5000, the number of mode components K is 4 to 8, mode components with a correlation kurtosis value greater than 1.2 are screened for reconstruction, and outliers are removed by the 3σ criterion.
[0011] Step 3: Extract feature values from the preprocessed OBD data;
[0012] Extract time-domain features, frequency-domain features, and fused features. Time-domain features include the mean, peak-to-peak value, kurtosis, and margin index of the voltage signal, and the variance, peak factor, and impulse factor of the current signal. Frequency-domain features are obtained through AR spectrum analysis. Fused features include energy entropy and singular value decomposition features.
[0013] Step 4: Construct a CNN-GRU model with an attention mechanism and train the model. Use the trained model to classify features and output the fault type corresponding to the EGR valve.
[0014] Fault types include complete jamming, partial jamming, poor sealing, position sensor failure, and control circuit failure;
[0015] Step 5: Perform fault correlation verification;
[0016] The diagnostic results are verified by combining the NOx emission concentration and the limit of 0.4 g / kWh and the exhaust temperature range of 150-400℃. If the diagnostic results do not match the emission parameters, steps 2 to 4 are repeated.
[0017] When the NOx emission concentration exceeds 0.4 g / kWh and the diagnosis result is poor sealing or partial jamming, the corresponding fault alarm is triggered; when the EGR valve is diagnosed as completely jammed and the exhaust temperature exceeds 400℃, an emergency fault alarm is triggered and the final judgment result is output.
[0018] Preferably, the OBD data acquisition system described in step 1 includes an OBD interface module, a signal conditioning module, a data storage module, and a main control module. The OBD interface module communicates with the engine ECU using the ISO 15765-4 protocol. The signal conditioning module includes a second-order low-pass filter and an amplifier circuit. The filter has a cutoff frequency of 5kHz and an amplification factor of 10. The data storage module is an SD card with a capacity of not less than 32GB. The main control module uses an STM32H743 microcontroller. The acquisition system is deployed on the vehicle ECU with a storage capacity of not less than 256MB.
[0019] Preferably, the dung beetle algorithm parameters in step 2 are set as follows: population size 20, maximum number of iterations 50, deflection coefficient 0.1, natural coefficient 0.9, constant 0.5, dung beetle stealing ratio 0.2, and fitness function is the weighted sum of reconstruction error and correlation coefficient, with a weight ratio of 0.7:0.3.
[0020] The variational problem of variational mode decomposition is constructed as follows:
[0021] ;
[0022] in For modal components, For center frequency, unit impact function * represents gradient operation, * represents convolution operation. For the original signal, The modal component number is t; the time variable is t; and the imaginary unit is j. for The square of the norm;
[0023] Preferably, the temporal feature extraction method in step 3 is as follows:
[0024] Calculate the mean of the voltage signal: n is the number of data points; peak-to-peak value ; kurtosis Margin indicators;
[0025] Calculate the variance of the current signal:
[0026] ;
[0027] Peak factor:
[0028] ;
[0029] Pulse factor:
[0030] ;
[0031] Capture signal amplitude variation patterns and impact characteristics;
[0032] Frequency domain feature extraction: The order of the AR spectrum model is determined by the AIC criterion, and AR spectrum analysis is performed on the reconstructed signal. The characteristic frequency range is limited to 0-3000Hz, and the frequency distribution features of the signal are extracted.
[0033] Fusion Feature Extraction: Calculating Energy Entropy ,in , For the first The energy of each modal component Singular value decomposition is performed on the matrix constructed from the modal components, and the first 6 singular values are used to form an eigenvector, which comprehensively characterizes the complexity and structural changes of the signal.
[0034] Preferably, the CNN-GRU model described in step 4 includes an input layer, a convolutional feature extraction module, a GRU temporal modeling module, a CBAM attention module, a fully connected layer, and an output layer;
[0035] The convolutional feature extraction module includes 3 convolutional layers and 3 max pooling layers. The first convolutional layer has 3×1 kernels, 16 kernels, and a stride of 1. The second convolutional layer has 3×1 kernels, 32 kernels, and a stride of 1. The third convolutional layer has 2×1 kernels, 64 kernels, and a stride of 1. Each convolutional layer is followed by a BN layer and a ReLU activation function. The pooling window has 2×1 kernels and a stride of 2.
[0036] The GRU timing modeling module includes two layers of GRU units, with 128 hidden units and a dropout rate of 0.5.
[0037] The training process for the CNN-GRU model is as follows:
[0038] Collect 300 sets of data each for normal operating conditions and five types of fault conditions;
[0039] The training set, validation set, and test set are divided in a 7:2:1 ratio.
[0040] The Adam optimizer, learning rate 1e-5, batch size 16, number of iterations 100, and cross-entropy loss function are used. An early stopping strategy is adopted, and training is stopped if the accuracy of the validation set does not improve for 5 consecutive iterations.
[0041] Preferably, the fault association verification rule in step 5 is:
[0042] If the NOx emission concentration exceeds 0.4 g / kWh or the exhaust temperature exceeds 400℃, and the diagnosis result is an EGR valve malfunction, it is determined to be a confirmed malfunction.
[0043] If the NOx emission concentration is ≤0.4g / kWh and the exhaust temperature is within the range of 150-400℃, it is judged as a suspected fault and a warning message is issued.
[0044] Preferably, the following performance indicators are achieved through the synergy of steps 1 to 5:
[0045] Fault diagnosis accuracy ≥98%, response time ≤0.3 seconds, false alarm rate ≤2.1%, and false negative rate ≤1.8%;
[0046] The diagnostic delay is no more than 0.25 seconds under 80% engine load conditions, and the diagnostic accuracy is maintained at no less than 96% within an ambient temperature range of -30℃ to 85℃.
[0047] This application also provides a diesel engine EGR valve fault diagnosis system based on OBD data. The system is used to implement the method provided in this application. The system includes a data acquisition layer, a data preprocessing layer, a feature extraction layer, a model diagnosis layer, a result verification layer, and an output layer.
[0048] The data acquisition layer includes an OBD interface module, a signal conditioning module, a data storage module, and a main control module. The OBD interface module communicates with the engine ECU using the ISO 15765-4 protocol. The signal conditioning module includes a second-order low-pass filter and an amplifier circuit. The filter has a cutoff frequency of 5kHz and an amplification factor of 10. The data storage module is an SD card with a capacity of not less than 32GB. The main control module uses an STM32H743 microcontroller. The acquisition system is deployed on the vehicle ECU with a storage capacity of not less than 256MB.
[0049] The data preprocessing layer performs OBD data preprocessing operations, including a dung beetle algorithm-variable mode decomposition optimization module, a modal component screening module, and an outlier removal module. The variational mode decomposition parameters are optimized using the dung beetle algorithm. The penalty factor α of the variational mode decomposition is 2000-5000, and the number of modal components K is 4 to 8. Modal components with a kurtosis value greater than 1.2 are screened for reconstruction, and outliers are removed using the 3σ criterion.
[0050] The feature extraction layer performs feature extraction operations, including a time-domain feature extraction module, a frequency-domain feature extraction module, and a fusion feature extraction module. The extracted time-domain features include the mean, peak-to-peak value, kurtosis, and margin index of the voltage signal, and the variance, peak factor, and impulse factor of the current signal. The frequency-domain features are obtained through AR spectrum analysis, and the fusion features include energy entropy and singular value decomposition features.
[0051] The diagnostic layer of the model deploys a CNN-GRU model, which includes an input layer, a convolutional feature extraction module, a GRU temporal modeling module, a CBAM attention module, a fully connected layer, and an output layer. The convolutional feature extraction module contains 3 convolutional layers and 3 max pooling layers. The GRU temporal modeling module contains 2 GRU units, with 128 hidden units and a dropout rate of 0.5.
[0052] The result verification layer performs fault correlation verification operations, and verifies the diagnostic results by combining NOx emission concentration and the National VI limit of 0.4 g / kWh and exhaust temperature range of 150-400℃.
[0053] The output layer is an LCD touchscreen or a remote monitoring platform.
[0054] Preferably, the system is deployed on the vehicle ECU, the sampling frequency is adapted to the range of 1-2kHz, and the hardware configuration meets the requirements for adaptability to the operating temperature range of -30℃ to 85℃.
[0055] The parameters of the dung beetle algorithm in the signal preprocessing module are set as follows: population size 20, maximum number of iterations 50, deflection coefficient 0.1, natural coefficient 0.9, constant 0.5, dung beetle ratio 0.2, and fitness function is the weighted sum of reconstruction error and correlation coefficient with a weight ratio of 0.7:0.3, ensuring that the modal component screening accuracy is ≥97% under harsh conditions.
[0056] Preferably, the remote monitoring platform adopts a B / S architecture, with the front-end display module developed based on Vue.js, the back-end data processing module using the Python Flask framework, and the database module using MySQL;
[0057] Store OBD raw data, preprocessed data, feature data, and diagnostic results for at least one year. The model deployment uses TensorFlow-GPU version 2.0.0, supports real-time invocation of preprocessing and diagnostic algorithms, has an overall system diagnostic latency of ≤0.5 seconds, a fault diagnosis accuracy of ≥98%, a false alarm rate of ≤2.1%, and a false negative rate of ≤1.8%.
[0058] The significant advancement of this invention compared to existing technologies lies in:
[0059] 1. The fault diagnosis method for EGR valve of China VI diesel engine based on OBD data provided in this application uses an OBD data acquisition system at the data acquisition layer to communicate with the engine ECU through an OBD interface module. Combined with a signal conditioning module, a data storage module, and a main control module, it realizes non-invasive real-time acquisition of multi-source OBD data without stopping the engine for disassembly and inspection, avoiding damage to seals and installation errors, and completely solving the problems of traditional disassembly and inspection being time-consuming, labor-intensive, and prone to causing new fault hazards.
[0060] 2. A fault diagnosis method for EGR valves of China VI diesel engines based on OBD data. The data preprocessing layer uses the dung beetle algorithm variational mode decomposition optimization module to optimize signal decomposition parameters. The feature extraction layer uses time-domain feature extraction, frequency-domain feature extraction, and fusion feature extraction modules to comprehensively capture multi-parameter coupling information. The model diagnosis layer uses a CNNGRU model with a fusion attention mechanism to deeply mine fault features, effectively identifying complex fault modes such as slight jamming and intermittent poor sealing, breaking through the limitations of single sensor data.
[0061] To more clearly illustrate the functional characteristics and structural parameters of the present invention, further explanation is provided below in conjunction with the accompanying drawings and specific embodiments. Attached Figure Description
[0062] Figure 1 This is a flowchart of a diesel engine EGR valve fault diagnosis method;
[0063] Figure 2 This is a diagram of the fault diagnosis system architecture for a diesel engine EGR valve.
[0064] Figure 3 This is a schematic diagram of the CNN-GRU model structure;
[0065] Figure 4 This is a fault correlation verification logic diagram. Detailed Implementation
[0066] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0067] This application provides a fault diagnosis method for diesel engine EGR valve based on OBD data, which has the advantages of achieving non-invasive online diagnosis through real-time acquisition of multi-source OBD data, achieving accurate extraction of signal features through variational mode decomposition optimized by the dung beetle algorithm, achieving intelligent identification of complex fault modes through a CNN-GRU model with fused attention mechanism, and improving the reliability of diagnostic results through emission parameter correlation verification mechanism.
[0068] Example 1:
[0069] To fully implement the diesel engine EGR valve fault diagnosis solution and verify the feasibility of the entire process from data acquisition to result output, this embodiment details the complete operation steps of fault diagnosis based on OBD data, covering core aspects such as hardware deployment, software setup, data processing, model training, and result verification.
[0070] I. Implementation Preparation
[0071] Hardware Deployment: The OBD data acquisition system is integrated into the vehicle ECU. The main control module uses an STM32H743 microcontroller with at least 256MB of storage capacity to meet data caching requirements. The OBD interface module communicates with the engine ECU according to the ISO 15765-4 protocol to ensure compatibility and stability of multi-source parameter transmission. The signal conditioning module has a built-in second-order low-pass filter and amplification circuit. The filter cutoff frequency is set to 5kHz to filter high-frequency interference, and the amplification circuit has a 10x amplification factor to enhance the strength of weak signals. The data storage module uses a 32GB SD card for long-term storage of acquired data and diagnostic results.
[0072] Software environment setup: The backend data processing module is developed based on the Python Flask framework, and the database is MySQL to store OBD raw data, preprocessed data, feature data and diagnostic results, with a storage period of 1 year; the model deployment uses TensorFlow-GPU 2.0.0 to improve computing efficiency with the help of GPU acceleration; the remote monitoring platform adopts a B / S architecture, and the front end is developed based on Vue.js to realize real-time visualization of diagnostic results, fault alarms and other information.
[0073] Dataset preparation: Collect 300 sets of data each for normal operating conditions and five types of EGR valve failure conditions (complete jamming, partial jamming, poor sealing, position sensor failure, and control circuit failure) of China VI diesel engines. Each set of data contains three continuous working cycle signals. The sampling frequency is set to 12.8kHz, and the number of sampling points is 16384 points / set. The collected parameters cover EGR valve related parameters such as EGR valve position sensor voltage signal, H-bridge drive current signal, coolant temperature signal, and opening feedback signal, as well as engine operating parameters such as speed, intake pressure, exhaust temperature, NOx emission concentration, and fuel injection quantity.
[0074] II. Data Preprocessing:
[0075] Step 1. OBD Data Acquisition: Start the OBD data acquisition system and read the multi-source parameters output by the engine ECU in real time through the OBD interface module; the parameters are processed by the signal conditioning module, firstly by a low-pass filter to remove high-frequency noise above 5kHz, then by an amplification circuit to amplify the weak signal by 10 times, and finally by the main control module to control the data storage module to store the data in a preset format; the entire acquisition process does not require disassembling engine parts, realizing non-invasive online monitoring.
[0076] 2. Data preprocessing:
[0077] Initialization of dung beetle algorithm parameters: Population size is set to 20, maximum number of iterations is 50, deflection coefficient is 0.1, natural coefficient is 0.9, constant is 0.5, and dung beetle stealing ratio is 0.2; the fitness function is defined as the weighted sum of reconstruction error and correlation coefficient, with a weight ratio of 0.7:0.3, used to quantitatively evaluate the VMD decomposition effect;
[0078] VMD parameter optimization: Input the acquired raw signal into the dung beetle algorithm to optimize the penalty factor of variational mode decomposition. (Values range 2000-5000) and the number of modal components K (values range 4-8); after obtaining the optimal parameter combination through iterative optimization, the variational problem expression is constructed as follows:
[0079] ;
[0080] in For modal components, The center frequencies of each modal component are... For unit impact function, The gradient operation is represented by *, the convolution operation by *, x(t) is the original signal, t is the time variable, and j is the imaginary unit. for The square of the norm;
[0081] Modal component screening and reconstruction: Calculate the correlation kurtosis value of each modal component. The correlation kurtosis is the product of the correlation coefficient between the modal component and the original signal and the kurtosis of the component itself. Screen modal components with correlation kurtosis values greater than 1.2 for signal reconstruction and retain effective components containing fault characteristics.
[0082] Outlier removal: The 3σ criterion is used to process the reconstructed signal. First, the mean of the reconstructed signal is calculated. and standard deviation Then remove those exceeding Identify outlier data points within a specified range to ensure data quality meets subsequent processing requirements.
[0083] 3. Feature extraction:
[0084] Time-domain feature extraction: Calculating the mean of the voltage signal: (n is the number of data points), peak-to-peak value , cliff Margin indicators;
[0085] Calculate the variance of the current signal:
[0086] ;
[0087] Peak factor:
[0088] ;
[0089] Pulse factor:
[0090] ;
[0091] Capture signal amplitude variation patterns and impact characteristics;
[0092] Frequency domain feature extraction: The order of the AR spectrum model is determined by the AIC criterion, and AR spectrum analysis is performed on the reconstructed signal. The characteristic frequency range is limited to 0-3000Hz, and the frequency distribution features of the signal are extracted.
[0093] Fusion Feature Extraction: Calculating Energy Entropy ,in , For the first The energy of each modal component Singular value decomposition is performed on the matrix constructed from the modal components, and the first 6 singular values are used to form an eigenvector, which comprehensively characterizes the complexity and structural changes of the signal.
[0094] 4. CNN-GRU Model Training and Fault Classification:
[0095] Model Construction: A CNN-GRU model was constructed, comprising an input layer, a convolutional feature extraction module, a GRU temporal modeling module, a CBAM attention module, a fully connected layer, and an output layer. The convolutional feature extraction module consists of 3 convolutional layers and 3 max pooling layers. The first convolutional layer has a kernel size of 3×1, 16 units, and a stride of 1; the second convolutional layer has a kernel size of 3×1, 32 units, and a stride of 1; and the third convolutional layer has a kernel size of 2×1, 64 units, and a stride of 1. Each convolutional layer is followed by a BN layer and a ReLU activation function. The pooling window size is 2×1 with a stride of 2. The GRU temporal modeling module consists of 2 GRU layers with 128 hidden units and a dropout rate of 0.5. The CBAM attention module enhances key features from both channel and spatial dimensions. The fully connected layer contains 64 neurons, which are activated by ReLU and then connected to the output layer. The output layer contains 5 neurons, which are activated by Softmax to output the probability distribution of five types of faults.
[0096] Data partitioning and training: The feature data was partitioned into training, validation, and test sets in a 7:2:1 ratio; the Adam optimizer was used, and the learning rate was set to... The batch size is 16, and the loss function used is the cross-entropy loss function. ( For real labels, To predict probabilities, (Number of categories), the number of iterations is set to 100, and an early stopping strategy is enabled. If the accuracy of the validation set does not improve for 5 consecutive iterations, training is stopped.
[0097] Fault Classification: Input the test set features into the trained model and output the judgment results of five types of faults of EGR valve.
[0098] 5. Fault correlation verification and result output:
[0099] Verification rule execution: If the NOx emission concentration exceeds the China VI limit of 0.4 g / kWh or the exhaust temperature exceeds 400℃, and the model diagnosis result is an EGR valve malfunction, it is determined as a confirmed malfunction; if the NOx emission concentration is ≤0.4 g / kWh and the exhaust temperature is within the range of 150-400℃, it is determined as a suspected malfunction and a warning message is output; if the diagnostic result of the EGR valve opening signal is inconsistent with the diagnostic result of the NOx concentration change rate, a secondary verification is performed through the exhaust temperature change characteristics.
[0100] Alarm Triggering and Result Output: When the NOx emission concentration exceeds 0.4 g / kWh and the diagnosis result is poor sealing or partial jamming, a regular fault alarm is triggered; when the diagnosis result is complete jamming and the exhaust temperature exceeds 400℃, an emergency fault alarm is triggered; the final judgment result is output through the LCD touch screen or remote monitoring platform.
[0101] This embodiment achieves non-invasive online diagnosis through multi-source OBD data acquisition, avoiding component damage and installation errors caused by traditional disassembly and inspection. Simultaneously, multi-source parameters provide comprehensive data support for fault diagnosis. The VMD parameters are optimized using the dung beetle algorithm, improving the accuracy of signal preprocessing, effectively reducing noise interference, and making fault characteristics clearer. A multi-feature fusion extraction strategy comprehensively captures the amplitude, frequency, complexity, and structural features of the signal, avoiding the limitations of single features. The CNN-GRU model, combined with the CBAM attention module, strengthens key fault features and enhances the ability to identify complex fault modes. The fault correlation verification mechanism, combined with emission and temperature parameters, reduces the risk of misjudgment, ensures the reliability of diagnostic results, and meets the China VI emission regulatory requirements.
[0102] Example 2:
[0103] To verify the preprocessing effect of the dung beetle algorithm in optimizing variational mode decomposition, this embodiment takes the OBD data of EGR valve partial jamming fault as the object, and elaborates in detail the specific operations of parameter optimization, mode decomposition, component screening and outlier removal to ensure the effective preservation of fault characteristics.
[0104] I. Implementation Preparation
[0105] The OBD data collected from the EGR valve partial jamming fault was selected. The data type was position sensor voltage signal, the sampling length was 16384 points, and the sampling frequency was 12.8kHz. The preprocessing objective was to remove signal noise and retain fault characteristic components. The verification indicators were signal-to-noise ratio (SNR), mean square error (MSE), and mean absolute error (MAE).
[0106] II. Specific Implementation Steps
[0107] 1. Dung beetle algorithm initialization: The population size is set to 20, the maximum number of iterations is 50, the deflection coefficient is 0.1, the natural coefficient is 0.9, the constant is 0.5, and the proportion of dung beetles is 0.2; the fitness function is defined as the weighted sum of the reconstruction error and the correlation coefficient, where the reconstruction error is the sum of squares of the differences between the reconstructed signal and the original signal, the correlation coefficient is the Pearson correlation coefficient between the reconstructed signal and the original signal, and the weight ratio is set to 0.7:0.3;
[0108] 2. VMD parameter optimization: Set the range of the number of modal components K to 4-8, and the penalty factor... The value range is 2000-5000; the voltage signal is input into the dung beetle algorithm, and each dung beetle represents a group during the iteration process. The parameter combination is used to update the position by simulating the natural behaviors of dung beetles, such as rolling, dancing, laying eggs, and foraging. The VMD decomposition effect, i.e., the fitness value, corresponding to each set of parameters is calculated. After 50 iterations, the optimal parameter combination is obtained. ;
[0109] 3. VMD Decomposition Execution: A variational problem is constructed based on optimal parameters, and the variational problem is solved using the alternating multiplier method to obtain 6 modal components. During the decomposition process, each modal component focuses on signal components within a specific frequency range, effectively avoiding the mode aliasing problem of traditional decomposition methods.
[0110] 4. Correlation kurtosis calculation and screening: Calculate the correlation coefficient between each modal component and the original voltage signal. And its own kurtosis K, the relevant kurtosis calculation formula is as follows ;get The correlation kurtosis values were 1.02, 1.56, 1.43, 1.31, 0.98, and 0.85, respectively. Values with a correlation kurtosis greater than 1.2 were selected. Components are reconstructed into signals;
[0111] 5.3σ Outlier Removal: Calculate the mean of the reconstructed signal. Standard deviation The 3σ range is [2.3-3×0.15, 2.3+3×0.15]=[1.85V, 2.75V]; the reconstructed signal is traversed, and two outliers exceeding this range are removed, namely 2.82V and 1.78V;
[0112] 6. Verification of preprocessing effect: Calculate the SNR, MSE, and MAE of the preprocessed signal and compare them with the unprocessed signal to verify the preprocessing effect.
[0113] This embodiment uses the dung beetle algorithm to globally optimize VMD parameters, which is more objective and accurate than manually setting parameters, effectively avoiding modal aliasing and over- or under-decomposition problems. The relevant kurtosis screening criterion combines the correlation between modal components and the original signal and their own impact characteristics, which can accurately retain components containing fault features and remove invalid components dominated by noise. The 3σ outlier removal method is based on the statistical distribution characteristics of data, which effectively removes outliers caused by electromagnetic interference during the acquisition process, improves data quality, and lays a good foundation for subsequent feature extraction and model diagnosis.
[0114] Example 3:
[0115] To comprehensively capture the differentiated characteristics of EGR valve failures, this embodiment takes the preprocessed signal of EGR valve position sensor failure as the object and elaborates on the extraction process of three types of features: time domain, frequency domain, and fusion, providing comprehensive feature support for model diagnosis.
[0116] I. Implementation Preparation
[0117] The preprocessed signal of the EGR valve position sensor failure was selected, including voltage and current signals, with a signal length of 16382 points and a sampling frequency of 12.8kHz. The target features were extracted as time domain features, frequency domain features, and fused features, and the ability of each feature to distinguish the fault was verified.
[0118] II. Specific Implementation Steps
[0119] 1. Temporal feature extraction:
[0120] Voltage signal: Calculate the mean (n=16382), peak-to-peak value Under normal operating conditions, this value is 0.8V; kurtosis Under normal operating conditions, this value is 3.8; the margin index is 0.08, and under normal operating conditions, this value is 0.35.
[0121] Current signal: Calculate variance Under normal operating conditions, this value is 0.012; Peak factor: Under normal operating conditions, this value is 2.5; Pulse factor: Under normal operating conditions, this value is 2.7; the difference in time-domain characteristics stems from sensor failure, which leads to reduced signal amplitude fluctuations and weakened impact characteristics.
[0122] 2. Frequency domain feature extraction:
[0123] AR Spectrum Modeling: The order of the AR model was determined to be 8 using the AIC criterion, and the AR model was constructed. ,in These are the model coefficients. It is white noise;
[0124] Feature frequency extraction: Frequency domain analysis was performed on the AR model, and the feature frequency range was limited to 0-3000Hz. The main frequency components were extracted and concentrated in 200-500Hz. Under normal operating conditions, the main frequency components were concentrated in 800-1500Hz. The frequency shift was caused by changes in signal characteristics due to sensor failure.
[0125] 3. Feature extraction fusion:
[0126] Energy entropy calculation: After preprocessing, the signal is decomposed into 6 modal components by VMD, and the energy of each component is calculated. Total energy ; Calculate the energy percentage of each component The formula for calculating energy entropy is:
[0127] ;
[0128] Substituting the numerical values, we get Under normal operating conditions, the energy entropy is 1.25. Under fault conditions, the increased signal complexity leads to an increase in the entropy value.
[0129] Singular Value Decomposition: Construct a 6×16382 matrix A for the 6 modal components, and obtain the following results through singular value decomposition: U and V are orthogonal matrices, and D is a diagonal matrix with singular values as its diagonal elements. The first 6 singular values are taken to form the feature vector [58.3, 42.1, 35.7, 28.9, 19.6, 12.3]. The singular value vector corresponding to the normal operating condition is [72.5, 51.3, 40.2, 33.6, 25.8, 16.4]. The overall reduction of singular values under fault conditions is due to the change in signal structure.
[0130] This embodiment extracts multi-dimensional time-domain features to accurately capture intuitive changes such as signal amplitude fluctuations and impact characteristics, reflecting the changes in the fundamental characteristics of the signal caused by the fault. AR spectrum frequency domain feature extraction combined with the AIC criterion determines the model order, improving the accuracy of frequency analysis of non-stationary signals and capturing the frequency shift characteristics caused by the fault. The energy entropy in the fusion features quantifies the complexity of the signal, and singular value decomposition characterizes the changes in the inherent structure of the signal. The two types of features are complementary, comprehensively covering the signal differences caused by the fault, and providing rich and effective feature support for subsequent model diagnosis.
[0131] Example 3:
[0132] To verify the fault identification capability of the CNN-GRU model, this embodiment elaborates on the complete process of model construction, training, testing and correlation verification to ensure that the model meets the performance requirements such as diagnostic accuracy and response time.
[0133] I. Implementation Preparation
[0134] We selected 300 sets of feature data each for normal operating conditions and five types of fault operating conditions, for a total of 1800 feature vectors. Each feature vector contains 6 dimensions in the time domain, 4 dimensions in the frequency domain, and 6 dimensions in the fusion domain, for a total of 16 dimensions of features. The hardware configuration used was an Intel Core i7-10870H CPU and an NVIDIA GeForce RTX 2060 GPU to support accelerated model training.
[0135] II. Specific Implementation Steps
[0136] 1. Model Building:
[0137] Input layer: Receives a 16-dimensional feature vector and outputs a dimension of (None, 16), where None indicates that the batch size is not fixed;
[0138] Convolutional Feature Extraction Module: The first convolutional layer uses 16 3×1 convolutional kernels with a stride of 1 and an output dimension of (None, 14, 16), processed by BN normalization and ReLU activation; the max pooling layer uses a 2×1 window with a stride of 2 and an output dimension of (None, 7, 16); the second convolutional layer uses 32 3×1 convolutional kernels with a stride of 1 and an output dimension of (None, 5, 32), processed by BN and ReLU activation; the max pooling layer has an output dimension of (None, 2, 32); the third convolutional layer uses 64 2×1 convolutional kernels with a stride of 1 and an output dimension of (None, 1, 64), processed by BN and ReLU activation; the max pooling layer has an output dimension of (None, 1, 64).
[0139] GRU temporal modeling module: contains 2 layers of GRU units, 128 hidden units, dropout rate 0.5; the first layer of GRU receives the output of the convolution module, output dimension (None, 128); the second layer of GRU receives the output of the first layer, output dimension (None, 128);
[0140] CBAM Attention Module: First, channel attention weighting is applied to the GRU output, calculating and assigning importance weights to each channel; then spatial attention weighting is applied to enhance key spatial location features, with an output dimension of (None, 128).
[0141] Fully connected layer: contains 64 neurons, and outputs a dimension of (None, 64) after ReLU activation;
[0142] Output layer: Contains 5 neurons, which output the probability distribution of five types of faults through the Softmax activation function, with an output dimension of (None, 5).
[0143] 2. Model Training:
[0144] Data partitioning: The 1800 sets of data were divided into a training set of 1260 sets, a validation set of 360 sets, and a test set of 180 sets in a ratio of 7:2:1.
[0145] Training parameter settings: Select the Adam optimizer, and set the learning rate to [value missing]. The batch size is 16, and the loss function used is the cross-entropy loss function. ,in For real labels (one-hot encoded). To predict probabilities, the number of iterations is set to 100, and an early stopping strategy is enabled. Training stops when the accuracy on the validation set does not improve for five consecutive iterations.
[0146] Training process: After 32 iterations, the accuracy of the validation set reached 98.1%. The accuracy did not improve in the subsequent 5 iterations, triggering the early stop mechanism to stop training. The final training set loss value was 0.032, and the validation set loss value was 0.085.
[0147] 3. Model Deployment: The trained model is saved as a .h file and integrated into the fault diagnosis system of the vehicle ECU. It supports real-time invocation of preprocessing algorithms and diagnostic algorithms, and the overall system diagnostic latency is controlled within 0.5 seconds.
[0148] 4. Fault diagnosis and correlation verification:
[0149] Test set diagnosis: 180 test set features are input into the deployed model, and classification results are output; among them, 36 groups are completely stuck, 35 groups are partially stuck, 34 groups are not properly sealed, 35 groups are position sensor failures, 30 groups are control circuit faults, and 10 groups are normal operating conditions. The diagnostic accuracy calculation formula is as follows:
[0150] ;
[0151] Substituting the numerical values, the diagnostic accuracy rate was 98.3%, and the response time was 0.28 seconds.
[0152] Correlation verification: Among the 35 partially stuck faults, 28 groups had NOx emission concentrations exceeding 0.4 g / kWh, which were determined to be confirmed faults and triggered regular alarms; 7 groups had NOx concentrations ≤0.4 g / kWh, which were determined to be suspected faults and output warning information; all diagnostic results were consistent with emission parameters and temperature parameters, and there was no need to re-execute the pretreatment and diagnostic process.
[0153] The CNN-GRU model constructed in this embodiment combines convolutional layers and GRU units, enabling it to extract local correlation information of features and capture temporal dependencies, thus adapting to the complex characteristics of fault features. The CBAM attention module enhances key features from channel and spatial dimensions, suppresses redundant information, and improves the model's classification accuracy. Reasonable training parameter settings and early stopping strategies ensure rapid model convergence and avoid overfitting, meeting the response time requirements of real-time diagnosis after deployment. The fault correlation verification mechanism further filters out misjudged cases, improves the reliability of diagnostic results, and ensures the effectiveness of the model in practical applications.
[0154] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for diagnosing EGR valve faults in a diesel engine based on OBD data, characterized in that, The method includes: Step 1: Collect OBD data of the diesel engine through the OBD data acquisition system. The OBD data includes EGR valve related parameters and engine operating parameters. Step 2: Use the dung beetle algorithm to optimize the variational mode decomposition parameters for OBD data preprocessing; The penalty factor α of variational mode decomposition is 2000-5000, the number of mode components K is 4 to 8, mode components with a correlation kurtosis value greater than 1.2 are screened for reconstruction, and outliers are removed by the 3σ criterion. Step 3: Extract feature values from the preprocessed OBD data; Extract time-domain features, frequency-domain features, and fused features. Time-domain features include the mean, peak-to-peak value, kurtosis, and margin index of the voltage signal, and the variance, peak factor, and impulse factor of the current signal. Frequency-domain features are obtained through AR spectrum analysis. Fused features include energy entropy and singular value decomposition features. Step 4: Construct a CNN-GRU model with an attention mechanism and train the model. Use the trained model to classify features and output the fault type corresponding to the EGR valve. Fault types include complete jamming, partial jamming, poor sealing, position sensor failure, and control circuit failure; Step 5: Perform fault correlation verification: The diagnostic results are verified by combining the NOx emission concentration and the limit of 0.4 g / kWh and the exhaust temperature range of 150-400℃. If the diagnostic results do not match the emission parameters, steps 2 to 4 are repeated. When the NOx emission concentration exceeds 0.4 g / kWh and the diagnosis result is poor sealing or partial jamming, the corresponding fault alarm is triggered; when the EGR valve is diagnosed as completely jammed and the exhaust temperature exceeds 400℃, an emergency fault alarm is triggered and the final judgment result is output.
2. The method according to claim 1, characterized in that, in, EGR valve related parameters include position sensor voltage signal, H-bridge drive current signal, coolant temperature signal, and opening feedback signal. Engine operating parameters include speed, intake pressure, exhaust temperature, NOx emission concentration, and fuel injection quantity. The sampling frequency is set to 12.8kHz, with 16,384 sampling points per group, and each group contains 3 continuous working cycle signals.
3. The method according to claim 1, characterized in that, The parameters of the dung beetle algorithm in step 2 are set as follows: population size 20, maximum number of iterations 50, deflection coefficient 0.1, natural coefficient 0.9, constant 0.5, dung beetle stealing ratio 0.2, and fitness function is the weighted sum of reconstruction error and correlation coefficient with a weight ratio of 0.7:0.
3. The variational problem of variational mode decomposition is constructed as follows: ; in For modal components, For center frequency, unit impact function * represents gradient operation, * represents convolution operation. For the original signal, The modal component number is t; the time variable is t; and the imaginary unit is j. for The square of the norm.
4. The method according to claim 1, characterized in that, The temporal feature extraction method in step 3 is as follows: Calculate the mean of the voltage signal: n is the number of data points; peak-to-peak value ; kurtosis Margin indicators; Calculate the variance of the current signal: ; Peak factor: ; Pulse factor: ; Capture signal amplitude variation patterns and impact characteristics; Frequency domain feature extraction: The order of the AR spectrum model is determined by the AIC criterion, and AR spectrum analysis is performed on the reconstructed signal. The characteristic frequency range is limited to 0-3000Hz, and the frequency distribution features of the signal are extracted. Fusion Feature Extraction: Calculating Energy Entropy ,in , For the first The energy of each modal component Singular value decomposition is performed on the matrix constructed from the modal components, and the first 6 singular values are used to form an eigenvector, which comprehensively characterizes the complexity and structural changes of the signal.
5. The method according to claim 1, characterized in that, The CNN-GRU model described in step 4 includes an input layer, a convolutional feature extraction module, a GRU temporal modeling module, a CBAM attention module, a fully connected layer, and an output layer. The convolutional feature extraction module includes 3 convolutional layers and 3 max pooling layers. The first convolutional layer has 3×1 kernels, 16 kernels, and a stride of 1. The second convolutional layer has 3×1 kernels, 32 kernels, and a stride of 1. The third convolutional layer has 2×1 kernels, 64 kernels, and a stride of 1. Each convolutional layer is followed by a BN layer and a ReLU activation function. The pooling window has 2×1 kernels and a stride of 2. The GRU timing modeling module includes two layers of GRU units, with 128 hidden units and a dropout rate of 0.
5. The training process for the CNN-GRU model is as follows: Collect 300 sets of data each for normal operating conditions and five types of fault conditions; The training set, validation set, and test set are divided in a 7:2:1 ratio. The Adam optimizer, learning rate 1e-5, batch size 16, number of iterations 100, and cross-entropy loss function are used. An early stopping strategy is adopted, and training is stopped if the accuracy of the validation set does not improve for 5 consecutive iterations.
6. The method according to claim 1, characterized in that, The fault association verification rule described in step 5 is as follows: If the NOx emission concentration exceeds 0.4 g / kWh or the exhaust temperature exceeds 400℃, and the diagnosis result is an EGR valve malfunction, it is determined to be a confirmed malfunction. If the NOx emission concentration is ≤0.4g / kWh and the exhaust temperature is within the range of 150-400℃, it is judged as a suspected fault and a warning message is issued.
7. A diesel engine EGR valve fault diagnosis system based on OBD data, said system being used to implement any one of the methods of claims 1 to 6, characterized in that, The system includes a data acquisition layer, a data preprocessing layer, a feature extraction layer, a model diagnosis layer, a result verification layer, and an output layer. The data acquisition layer includes an OBD interface module, a signal conditioning module, a data storage module, and a main control module. The OBD interface module communicates with the engine ECU using the ISO 15765-4 protocol. The signal conditioning module includes a second-order low-pass filter and an amplifier circuit. The filter has a cutoff frequency of 5kHz and an amplification factor of 10. The data storage module is an SD card with a capacity of not less than 32GB. The main control module uses an STM32H743 microcontroller. The acquisition system is deployed on the vehicle ECU with a storage capacity of not less than 256MB. The data preprocessing layer performs OBD data preprocessing operations, including a dung beetle algorithm-variable mode decomposition optimization module, a modal component screening module, and an outlier removal module. The variational mode decomposition parameters are optimized using the dung beetle algorithm. The penalty factor α of the variational mode decomposition is 2000-5000, and the number of modal components K is 4 to 8. Modal components with a kurtosis value greater than 1.2 are screened for reconstruction, and outliers are removed using the 3σ criterion. The feature extraction layer performs feature extraction operations, including a time-domain feature extraction module, a frequency-domain feature extraction module, and a fusion feature extraction module. The extracted time-domain features include the mean, peak-to-peak value, kurtosis, and margin index of the voltage signal, and the variance, peak factor, and impulse factor of the current signal. The frequency-domain features are obtained through AR spectrum analysis, and the fusion features include energy entropy and singular value decomposition features. The diagnostic layer of the model deploys a CNN-GRU model, which includes an input layer, a convolutional feature extraction module, a GRU temporal modeling module, a CBAM attention module, a fully connected layer, and an output layer. The convolutional feature extraction module contains 3 convolutional layers and 3 max pooling layers. The GRU temporal modeling module contains 2 GRU units, with 128 hidden units and a dropout rate of 0.
5. The result verification layer performs fault correlation verification operations, and verifies the diagnostic results by combining NOx emission concentration and limit of 0.4 g / kWh, and exhaust temperature range of 150-400℃. The output layer is an LCD touchscreen or a remote monitoring platform.
8. The system according to claim 7, characterized in that, The system is deployed on the vehicle ECU, with a sampling frequency adapted to the 1-2kHz range, and the hardware configuration meets the requirements for adaptability to the operating temperature range of -30℃ to 85℃.
9. The system according to claim 7, characterized in that, The parameters of the dung beetle algorithm in the signal preprocessing module are set as follows: population size 20, maximum number of iterations 50, deflection coefficient 0.1, natural coefficient 0.9, constant 0.5, dung beetle ratio 0.2, and fitness function is the weighted sum of reconstruction error and correlation coefficient with a weight ratio of 0.7:0.
3.
10. The system according to claim 7, characterized in that, The remote monitoring platform adopts a B / S architecture. The front-end display module is developed based on Vue.js, the back-end data processing module uses the Python Flask framework, and the database module is MySQL.