A proton exchange membrane fuel cell air path fault injection simulation method for a semi-physical simulation system

By combining hardware and virtual model fault injection methods in a hardware-in-the-loop simulation system, the problem of test result deviation in digital platform simulation was solved, achieving efficient and accurate fuel cell air circuit fault testing and shortening the R&D cycle.

CN119416461BActive Publication Date: 2026-04-17NORTH CHINA UNIVERSITY OF TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NORTH CHINA UNIVERSITY OF TECHNOLOGY
Filing Date
2024-10-16
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing technologies rely on digital platform simulations for fuel cell fault injection, which cannot accurately assess the performance of real systems, resulting in large discrepancies between test results and actual performance. Furthermore, processing complex simulation models exceeds the platform's limits, affecting real-time performance and latency.

Method used

LabVIEW is used to build the OPCUA communication client. Combining actual hardware and virtual models, air circuit fault injection simulation is performed by modifying error status codes and severity variables, including air compressor failure, oxygen starvation, and communication packet loss. The server-side code is encapsulated using Matlab and Simulink automatic code generation technology to realize fault injection in the hardware-in-the-loop simulation system.

Benefits of technology

It provides a more realistic testing system, improving testing efficiency and accuracy, shortening the R&D cycle, and offering good scalability. It can perform complex fault tests in a short time, enhancing testing convenience and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119416461B_ABST
    Figure CN119416461B_ABST
Patent Text Reader

Abstract

This invention discloses a method for simulating air path fault injection in proton exchange membrane fuel cells (PEMFCs) for hardware-in-the-loop simulation systems. Applied to the field of fuel cell hardware-in-the-loop simulation fault diagnosis technology, the method includes: establishing a client-side interface for OPCUA communication using LabVIEW and setting error status codes and severity variables; encapsulating server-side code based on automatic code generation technology to establish a server-side interface, which is then embedded in a fuel cell model running in a real-time simulator; changing the air path fault injection type and severity by modifying the error status codes and severity variables on the client-side interface; and activating the corresponding fuel cell sub-model based on the error status code on the server-side interface and changing the severity of the air path fault injection through the severity variables to simulate the air path fault injection. This invention improves the accuracy, efficiency, and scalability of fuel cell air path fault injection simulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of fault diagnosis technology for fuel cell hardware-in-the-loop simulation, and in particular to a method for simulating air path faults in proton exchange membrane fuel cells for hardware-in-the-loop simulation systems. Background Technology

[0002] With increasing global energy demand and growing emphasis on environmental protection, traditional chemical fuel energy is gradually revealing problems such as resource depletion and environmental pollution. Fuel cells, as a technology that directly converts chemical energy into electrical energy, offer advantages such as high energy efficiency and low emissions, making them an important alternative to traditional energy sources. From transportation to backup power, fuel cells have broad application prospects, and their technological advancements and commercialization are of great significance for achieving sustainable energy development.

[0003] Fuel cells are multivariable, strongly coupled systems with complex dynamic processes. Various abnormal operating conditions may occur during actual operation. To improve system stability and enhance safety, fault injection technology has emerged. Currently, this technology mainly uses digital platforms to simulate fault scenarios to verify the stability of the designed system and the rationality of the control algorithm. However, simulating fuel cell systems and their fault conditions through digital platforms cannot accurately assess the system's performance under real operating conditions or uncover potential problems between hardware and software. Hardware-in-the-loop (HIL) simulation, compared to traditional simulation, offers the advantage of combining actual hardware with virtual models to provide a more realistic test system. Furthermore, HIL simulation can perform complex fault tests and operating condition simulations in a shorter time, improving testing efficiency and shortening the development cycle.

[0004] Current fuel cell fault injection primarily utilizes software fault injection on purely digital platforms. While this can simulate software-level faults, it cannot reproduce the complex interactions and physical responses of a real system, potentially leading to significant discrepancies between test results and actual filling. Furthermore, its strong dependence on digital platforms means that the complex simulation models and real-time data processing requirements for handling fault injection and system response may exceed the platform's capabilities, resulting in delays and untimely responses. This not only impacts real-time test performance but can also cause discrepancies between simulation results and actual system behavior.

[0005] Therefore, how to provide a proton exchange membrane fuel cell air path fault injection simulation method for a hardware-in-the-loop simulation system that can combine actual hardware and virtual models to provide a more realistic testing system, perform complex fault tests and operating condition simulations in a shorter time, improve testing efficiency, and shorten the R&D cycle is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] In view of this, the present invention proposes a method for simulating air path fault injection in a proton exchange membrane fuel cell for a hardware-in-the-loop simulation system.

[0007] To achieve the above objectives, the present invention adopts the following technical solution:

[0008] A method for simulating air path fault injection in a proton exchange membrane fuel cell for a hardware-in-the-loop simulation system includes:

[0009] Step 1: Use a host computer to establish an OPCUA communication client through LabVIEW, and set error status codes and severity variables; different error status codes represent different air path fault injection types; different severity variables represent different air path fault injection degrees.

[0010] Based on automatic code generation technology, server-side code is encapsulated to establish an OPCUA communication server, which is embedded in a fuel cell model running in a real-time simulator. The fuel cell model includes fuel cell sub-models with different air path fault injection types corresponding to error status codes, and the degree of air path fault injection in the fuel cell sub-model is determined based on a degree variable.

[0011] Step 2: Change the air path fault injection type and air path fault injection degree by modifying the error status code and degree variable on the client side: The server side activates the fuel cell sub-model of the corresponding air path fault injection type according to the error status code, and changes the air path fault injection degree of the fuel cell sub-model through the degree variable to simulate air path fault injection.

[0012] Optionally, in step 1, the host computer establishes an OPCUA communication client using LabVIEW based on the TCP / IP protocol.

[0013] Optionally, in step 1, the air circuit fault injection type includes, but is not limited to: air compressor fault injection, oxygen starvation injection, and communication packet loss fault injection.

[0014] Optionally, the degree variables for air compressor fault injection, oxygen starvation injection, and communication packet loss fault injection are: air compressor blockage coefficient, oxygen concentration coefficient, packet loss rate, and packet loss time coefficient, respectively.

[0015] Optionally, in step 1, based on Matlab and Simulink automatic code generation technology, the server-side code is encapsulated using Sfunction to establish the OPCUA communication server.

[0016] Optionally, before performing the air path fault injection simulation in step 2, the method also includes checking whether the client and server are successfully connected by checking the status bits.

[0017] Optionally, in step 2, the server activates the corresponding fuel cell sub-model of the air path fault injection type based on the error status code, which is implemented using an if-else fault injection structure.

[0018] Optionally, in step 2, the simulation of the air compressor fault injection is as follows:

[0019] By modifying the client-side error status code and corresponding air compressor blockage coefficient to correspond to the simulated air compressor fault;

[0020] The server activates the fuel cell sub-model for air compressor fault injection based on the error status code, and changes the degree of air path fault injection in the fuel cell sub-model by changing the air compressor blockage coefficient in order to simulate air compressor fault injection.

[0021] Optionally, in step 2, the simulation of oxygen starvation injection is as follows:

[0022] By modifying the client-side error status codes and corresponding oxygen concentration coefficients for the oxygen starvation injection simulation;

[0023] The server activates the oxygen-starved fuel cell sub-model based on the error status code, and changes the oxygen-starved injection level of the fuel cell sub-model by changing the oxygen concentration coefficient to simulate oxygen-starved injection.

[0024] Optionally, in step 2, the simulation of communication packet loss fault injection is specifically as follows:

[0025] By modifying the client-side to simulate the error status code and corresponding packet loss rate and packet loss time coefficient for communication packet loss faults;

[0026] The server activates the fuel cell sub-model for communication packet loss fault injection based on the error status code, and changes the degree of communication packet loss fault injection in the fuel cell sub-model by adjusting the packet loss rate and packet loss time coefficient to simulate communication packet loss fault injection.

[0027] As can be seen from the above technical solution, compared with the prior art, this invention proposes a method for air path fault injection in proton exchange membrane fuel cells for a semi-physical simulation system. This invention, by conducting fuel cell fault injection research on a semi-physical simulation, combines actual hardware and a virtual model, providing a more realistic testing system. It can perform complex fault tests and operating condition simulations in a shorter time, improving testing efficiency and shortening the R&D cycle. This invention can directly modify the error status code and severity variable to change the corresponding air path fault injection simulation model and air path fault severity, thereby performing corresponding air path fault injection simulations. This not only improves testing accuracy, efficiency, and convenience but also offers better scalability. When simulating fault injections beyond existing fault injections, only the corresponding if-else fault injection branch needs to be added, and the corresponding fault injection sub-model needs to be stored in the fuel cell model to realize the simulation of fault injections beyond existing fault injections and different fault injection severity levels. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0029] Figure 1 This is a schematic diagram of the method flow of the present invention. Detailed Implementation

[0030] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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.

[0031] Example 1:

[0032] Embodiment 1 of this invention discloses a method for simulating air path fault injection in a proton exchange membrane fuel cell for a hardware-in-the-loop simulation system, comprising:

[0033] Step 1: Establish the OPC communication structure. Use the host computer to create the OPCUA communication client through LabVIEW, and set the error status code FaultCode and severity variable. Different error status codes FaultCode represent different air path fault injection types; different severity variables represent different air path fault injection degrees.

[0034] The host computer uses the TCP / IP protocol to establish an OPCUA communication client through LabVIEW.

[0035] The types of air circuit fault injection include, but are not limited to: air compressor fault injection, oxygen starvation injection, and communication packet loss fault injection. In this embodiment, their error status codes FaultCode are set to 1, 2, and 3 respectively. In the default state, the error status code FaultCode is 0, which means that there is no fault at this time and the fuel cell is operating normally.

[0036] The degree variables for air compressor fault injection, oxygen starvation injection, and communication packet loss fault injection are: air compressor blockage coefficient, oxygen concentration coefficient, packet loss rate, and packet loss time coefficient, respectively.

[0037] Based on automatic code generation technology, server-side code is encapsulated to establish an OPCUA communication server, which is embedded in a fuel cell model running on a PXI-based real-time simulator. The OPC interface model and the fuel cell model are integrated to achieve data exchange and control. The fuel cell model includes sub-models of different air path fault injection types corresponding to the FaultCode error status code. The degree of air path fault injection in each sub-model is determined based on a degree variable. Modifying the FaultCode and its corresponding degree variable via a host computer controls the corresponding air path fault injection type and degree. In addition to the fuel cell sub-models used to simulate different air path fault injections, the fuel cell model also includes: a BOP model (external component model, used to describe and analyze all auxiliary components and systems in the fuel cell system other than the core stack, such as air compressors, solenoid valves, intercoolers, etc.) and a stack model (used to describe and analyze the performance and behavior of the fuel cell or battery system).

[0038] Based on Matlab and Simulink automatic code generation technology, the server-side code is encapsulated using Sfunction to establish the OPCUA communication server and set its IP address and port number.

[0039] Step 2: Change the air path fault injection type and air path fault injection degree by modifying the error status code and degree variable on the client side: The server side activates the fuel cell sub-model of the corresponding air path fault injection type according to the error status code FaultCode, and changes the air path fault injection degree of the fuel cell sub-model through the degree variable to simulate air path fault injection.

[0040] Before performing the air path fault injection simulation in step 3, the process also includes checking the status bits to determine whether the client and server are successfully connected. If the StateCode is set to 1, it means that the connection has been successfully established; otherwise, the connection has failed.

[0041] The server activates the corresponding air path fault injection type fuel cell sub-model based on the error status code FaultCode. This is implemented using an if-else fault injection structure, with different error status codes FaultCode corresponding to different if-else fault branches in the server.

[0042] The simulation of air compressor fault injection is as follows:

[0043] Air compressor malfunctions are usually caused by dust or contaminants clogging the air filter, which leads to poor air intake and reduced airflow.

[0044] By modifying the client-side error status code FaultCode corresponding to the simulated air compressor fault to 1 and the corresponding air compressor blockage coefficient;

[0045] The server, based on the error status code FaultCode, activates the fuel cell sub-model for air compressor fault injection using an if-else air compressor fault injection structure. It then changes the airflow rate by altering the air compressor blockage coefficient, thereby changing the degree of air path fault injection in the fuel cell sub-model to simulate air compressor fault injection.

[0046] The simulation of oxygen starvation injection is as follows:

[0047] The oxygen starvation model establishes a model of oxygen concentration changes over time based on the characteristics of oxygen changes in fuel cells, simulating a reduction in oxygen supply.

[0048] By modifying the client-side error status code FaultCode corresponding to the oxygen starvation injection simulation to 2 and the corresponding oxygen concentration coefficient;

[0049] The server activates the oxygen-starved fuel cell sub-model based on the FaultCode error status code using an if-else oxygen-starved injection structure. It then changes the oxygen concentration by altering the oxygen concentration coefficient, thereby changing the degree of oxygen-starved injection in the fuel cell sub-model to simulate oxygen-starved injection.

[0050] The simulation of packet loss fault injection is as follows:

[0051] Packet loss is usually caused by abnormal data transmission due to electromagnetic interference, communication equipment failure, or communication line failure during fuel cell operation.

[0052] By modifying the error status code FaultCode corresponding to the simulated communication packet loss fault injected on the client side to 3 and the corresponding packet loss rate and packet loss time coefficient;

[0053] The server activates the fuel cell sub-model for communication packet loss injection based on the error status code FaultCode and through the if-else communication packet loss fault injection structure. It then changes the packet loss rate and packet loss time by adjusting the packet loss rate and packet loss time coefficients, thereby altering the degree of communication packet loss fault injection in the fuel cell sub-model to simulate communication packet loss fault injection.

[0054] This invention discloses a method for simulating air path fault injection in a proton exchange membrane fuel cell (PEMFC) using a hardware-in-the-loop (HIL) simulation system. By conducting fuel cell fault injection research on a HIL, this invention combines actual hardware with a virtual model, providing a more realistic testing system. It enables the execution of complex fault tests and operating condition simulations in a shorter time, improving testing efficiency and shortening the development cycle. This invention allows for the direct modification of error status codes and severity variables to alter the corresponding air path fault injection simulation model and fault severity, thereby simulating the corresponding air path fault injection. This not only improves testing accuracy, efficiency, and convenience but also offers better scalability. When simulating fault injections beyond existing fault injections, only the corresponding if-else fault injection branch needs to be added, and the corresponding fault injection sub-model needs to be stored in the fuel cell model to simulate fault injections beyond existing ones and different fault injection severity levels.

[0055] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.

[0056] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for simulating air path fault injection in a proton exchange membrane fuel cell for a hardware-in-the-loop simulation system, characterized in that, include: Step 1: Create an OPCUA communication client using LabVIEW and set error status codes and severity variables; different error status codes represent different types of air path fault injection; different severity variables represent different degrees of air path fault injection. Based on automatic code generation technology, server-side code is encapsulated to establish an OPCUA communication server, which is embedded in a fuel cell model running in a real-time simulator; wherein, the fuel cell model includes: fuel cell sub-models with different air path fault injection types corresponding to the error status code, and the air path fault injection degree of the fuel cell sub-model is determined based on the degree variable; Step 2: By modifying the error status code and severity variable on the Client side, the air path fault injection type and severity are changed: The Server side activates the corresponding fuel cell sub-model of the air path fault injection type according to the error status code, and changes the air path fault injection severity of the fuel cell sub-model through the severity variable to simulate air path fault injection.

2. The method for simulating air path fault injection in a proton exchange membrane fuel cell for a hardware-in-the-loop simulation system according to claim 1, characterized in that, In step 1, the host computer establishes an OPCUA communication client using LabVIEW based on the TCP / IP protocol.

3. The method for simulating air path fault injection in a proton exchange membrane fuel cell for a hardware-in-the-loop simulation system according to claim 1, characterized in that, In step 1, the types of air circuit fault injection include, but are not limited to: air compressor fault injection, oxygen starvation injection, and communication packet loss fault injection.

4. The method for simulating air path fault injection in a proton exchange membrane fuel cell for a hardware-in-the-loop simulation system according to claim 3, characterized in that, The degree variables for air compressor fault injection, oxygen starvation injection, and communication packet loss fault injection are: air compressor blockage coefficient, oxygen concentration coefficient, packet loss rate, and packet loss time coefficient, respectively.

5. The method for simulating air path fault injection in a proton exchange membrane fuel cell for a hardware-in-the-loop simulation system according to claim 1, characterized in that, In step 1, based on Matlab and Simulink automatic code generation technology, the server-side code is encapsulated using Sfunction to establish the OPCUA communication server.

6. The method for simulating air path fault injection in a proton exchange membrane fuel cell for a hardware-in-the-loop simulation system according to claim 1, characterized in that, Before performing the air path fault injection simulation in step 2, the process also includes checking whether the Client and Server are successfully connected by examining the status bits.

7. The method for simulating air path fault injection in a proton exchange membrane fuel cell for a hardware-in-the-loop simulation system according to claim 1, characterized in that, In step 2, the server activates the corresponding fuel cell sub-model of the air path fault injection type based on the error status code, which is implemented using an if-else fault injection structure.

8. The method for simulating air path fault injection in a proton exchange membrane fuel cell for a hardware-in-the-loop simulation system according to claim 3, characterized in that, In step 2, the simulation of the air compressor fault injection specifically includes: By modifying the Client to correspond to the simulated error status code and the corresponding air compressor blockage coefficient injected with the air compressor fault; The server activates the fuel cell sub-model for air compressor fault injection based on the error status code, and changes the degree of air circuit fault injection in the fuel cell sub-model by the air compressor blockage coefficient to simulate air compressor fault injection.

9. The method for simulating air path fault injection in a proton exchange membrane fuel cell for a hardware-in-the-loop simulation system according to claim 3, characterized in that, In step 2, the simulation of oxygen starvation injection specifically includes: By modifying the Client end to correspond to the error status code and the corresponding oxygen concentration coefficient for the oxygen starvation injection simulation; The server activates the oxygen-starved fuel cell sub-model based on the error status code, and changes the oxygen-starved injection level of the fuel cell sub-model through the oxygen concentration coefficient to simulate oxygen-starved injection.

10. The method for simulating air path fault injection in a proton exchange membrane fuel cell for a hardware-in-the-loop simulation system according to claim 3, characterized in that, In step 2, the simulation of the communication packet loss fault injection specifically includes: By modifying the error status code and corresponding packet loss rate and packet loss time coefficient injected into the client to simulate the communication packet loss fault; The server activates the fuel cell sub-model for communication packet loss fault injection based on the error status code, and changes the degree of communication packet loss fault injection in the fuel cell sub-model through the packet loss rate and packet loss time coefficient to simulate communication packet loss fault injection.

Citation Information

Patent Citations

  • System C circuit model oriented soft error sensitivity analysis method

    CN104598699A

  • Multi-scale semi-physical simulation method applied to SOFC-MGT coupling system

    CN106527179A