Hardware-in-the-loop simulation system-oriented air path fault injection simulation method for proton exchange membrane fuel cell
By combining actual hardware and virtual models in a semi-physical simulation system, the fuel cell air circuit failure injection simulation is solved, and the problem of the fuel cell system being unable to accurately evaluate the fuel cell system under real operating conditions in the prior art is improved, and the testing efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202411442329.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-10-16
AI Technical Summary
The existing fuel cell failure injection technology is mainly carried out on digital platforms, and it is impossible to accurately evaluate the performance of the system under real operating conditions, resulting in a large deviation from the actual loading. The requirements for complex simulation models and real-time data processing may exceed the requirements. The processing limit of the platform affects the real-time performance of the test.
The proton exchange membrane fuel cell air circuit fault injection simulation method is adopted for semi-physical simulation system. The client end of OPCUA communication is established through Labview, and the Server end of OPCUA communication is embedded in the real-time simulation machine. Combining the actual hardware and virtual model, air is realized. Road fault injection simulation.
It provides a more realistic test system, which can perform complex fault tests and working conditions simulations in a shorter time, improves testing efficiency, shortens R&D cycle, and improves testing accuracy, efficiency and convenience.
Smart Images

Figure CN119416461A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of fuel cell semi-physical simulation fault diagnosis, and in particular to a proton exchange membrane fuel cell air path fault injection simulation method oriented to a semi-physical simulation system. Background Art
[0002] With the increase of global energy demand and the emphasis on environmental protection, traditional chemical fuel energy has gradually exposed problems such as resource depletion and environmental pollution. Fuel cells, as a technology that directly converts chemical energy into electrical energy, have the advantages of high energy efficiency and low emissions, and have become an important choice to replace traditional energy. From transportation to backup power, fuel cells have broad application prospects, and their technological advancement and commercialization are of great significance to the realization of sustainable energy development.
[0003] A fuel cell is a multivariable, strongly coupled system with complex dynamic processes. Various abnormal operating conditions may occur during actual operation. In order to improve the stability and safety of the system, fault injection technology has emerged. At present, this technology mainly uses digital platforms to simulate fault scenarios to verify the stability of the design system and the rationality of the control algorithm. However, by simulating the fuel cell system and its fault conditions through a digital platform, it is impossible to accurately evaluate the performance of the system under real operating conditions and discover potential problems between hardware and software. The advantage of semi-physical simulation over traditional simulation is that it can combine actual hardware and virtual models to provide a test system that is closer to reality. In addition, semi-physical simulation can perform complex fault tests and operating condition simulations in a shorter time, improving test efficiency and shortening the R&D cycle.
[0004] At present, fuel cell fault injection mainly involves software fault injection on a purely digital platform. Although it can simulate faults at the software level, it cannot reproduce the complex interactions and physical reactions in the real system, which may lead to a large deviation between the test results and the actual filling. In addition, it is highly dependent on the digital platform. When dealing with fault injection and system response, its complex simulation model and real-time data processing requirements may exceed the processing limit of the platform, causing delays and untimely responses. This not only affects the real-time performance of the test, but may also lead to deviations between the simulation results and the actual system behavior.
[0005] To this end, how to provide a proton exchange membrane fuel cell air path fault injection simulation method for a semi-physical simulation system that can combine actual hardware and virtual models to provide a test system that is closer to reality, and perform complex fault tests and operating condition simulations in a shorter time, improve test efficiency, and shorten the R&D cycle is an urgent problem that technical personnel in this field need to solve. Summary of the invention
[0006] In view of this, the present invention proposes a proton exchange membrane fuel cell air path fault injection simulation method for a semi-physical simulation system.
[0007] In order to achieve the above object, the present invention adopts the following technical solution:
[0008] A proton exchange membrane fuel cell air path fault injection simulation method for a semi-physical simulation system, comprising:
[0009] Step 1: Use the host computer to establish the OPCUA communication client through Labview, and set the error status code and degree variable; different error status codes represent different air path fault injection types; different degree variables represent different air path fault injection degrees;
[0010] Based on the automatic code generation technology, the server-side code is encapsulated, the server-side of OPCUA communication is established, and the fuel cell model running in the real-time simulator is embedded; wherein the fuel cell model includes: fuel cell sub-models of 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;
[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 perform air path fault injection simulation.
[0012] Optionally, in step 1, the host computer establishes the client end of OPC UA communication through Labview based on the TCP / IP protocol.
[0013] Optionally, in step 1, the air path 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 of air compressor fault injection, oxygen starvation injection, and communication packet loss fault injection are: air compressor blocking 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, Sfunction is used to encapsulate the server-side code to establish the server-side of OPCUA communication.
[0016] Optionally, before performing the air path fault injection simulation in step 2, the method further includes: detecting whether the connection between the Client and the Server is successful by checking the status bit.
[0017] Optionally, in step 2, the server activates the corresponding fuel cell sub-model of the air path fault injection type according to the error status code, which is implemented based on the if-else fault injection structure.
[0018] Optionally, in step 2, the simulation of air compressor fault injection is specifically as follows:
[0019] By modifying the Client end to the error status code corresponding to the simulation of air compressor fault injection and the corresponding air compressor blockage coefficient;
[0020] The server activates the fuel cell sub-model for air compressor fault injection according to the error status code, and changes the air path fault injection degree of the fuel cell sub-model through the air compressor blockage coefficient to perform air compressor fault injection simulation.
[0021] Optionally, in step 2, the simulation of oxygen starvation injection is specifically as follows:
[0022] By modifying the client to the error status code and the corresponding oxygen concentration coefficient corresponding to the simulation of oxygen starvation injection;
[0023] The server activates the fuel cell sub-model of oxygen starvation injection according to the error status code, and changes the oxygen starvation injection degree of the fuel cell sub-model through the oxygen concentration coefficient to perform oxygen starvation injection simulation.
[0024] Optionally, in step 2, the simulation of communication packet loss fault injection is specifically as follows:
[0025] By modifying the client to the error status code corresponding to the simulation of communication packet loss fault injection and the corresponding packet loss rate and packet loss time coefficient;
[0026] The server activates the fuel cell sub-model for communication packet loss fault injection according to the error status code, and changes the communication packet loss fault injection degree of the fuel cell sub-model through the packet loss rate and packet loss time coefficient to perform communication packet loss fault injection simulation.
[0027] It can be known from the above technical scheme that, compared with the prior art, the present invention proposes a proton exchange membrane fuel cell air path fault injection method for a semi-physical simulation system. The present invention combines actual hardware and virtual models by conducting fuel cell fault injection research on semi-physical simulation, provides a test system that is closer to reality, and can perform complex fault tests and working condition simulations in a shorter time, thereby improving test efficiency and shortening the research and development cycle. The present invention can change the corresponding air path fault injection simulation model and air path fault degree by directly modifying the error status code and degree variable to perform the corresponding air path fault injection simulation, which not only improves the test accuracy, efficiency and convenience, but also has better scalability. When simulating fault injection other than the existing fault injection, it is only necessary to add the corresponding if-else fault injection branch and store the corresponding fault injection sub-model in the fuel cell model, so as to realize the fault injection other than the existing fault injection and the simulation of different fault injection degrees. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0029] Figure 1 It is a schematic diagram of the method flow of the present invention. DETAILED DESCRIPTION
[0030] 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 embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0031] Embodiment 1:
[0032] Embodiment 1 of the present invention discloses a proton exchange membrane fuel cell air path fault injection simulation method for a semi-physical simulation system, comprising:
[0033] Step 1: Establish the OPC communication structure, use the host computer to establish the OPC UA communication client through Labview, and set the error status code FaultCode and degree variable; among them, different error status codes FaultCode represent different air path fault injection types; different degree variables represent different air path fault injection degrees.
[0034] The host computer establishes the OPC UA communication client through Labview based on TCP / IP protocol.
[0035] The air path fault injection types include, but are not limited to: air compressor fault injection, oxygen starvation injection, and communication packet loss fault injection. In this embodiment, the error status codes FaultCode are set to 1, 2, and 3 respectively. In the default state, the error status code FaultCode is 0, that is, there is no fault at this time, and the fuel cell is operating normally.
[0036] The degree variables of air compressor fault injection, oxygen starvation injection, and communication packet loss fault injection are: air compressor blocking coefficient, oxygen concentration coefficient, packet loss rate, and packet loss time coefficient.
[0037] Based on the automatic code generation technology, the server-side code is encapsulated, the server-side of OPCUA communication is established, and the fuel cell model running in the real-time simulator based on the PXI platform is embedded, and the OPC interface model and the fuel cell model are integrated to realize data exchange and control; wherein, the fuel cell model includes: a fuel cell sub-model with different air path fault injection types corresponding to the error status code FaultCode, and the air path fault injection degree of the fuel cell sub-model is determined based on the degree variable, and the corresponding air path fault injection type and air path fault injection degree can be modified by modifying the error status code FaultCode and the corresponding degree variable through the host computer control. In addition to the fuel cell sub-model used to simulate different air path fault injections, the fuel cell model also includes: a BOP model (an external device model used to describe and analyze all auxiliary components and systems in the fuel cell system except the core battery stack, such as: air compressor, solenoid valve, intercooler, 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, Sfunction is used to encapsulate the server-side code, establish the server-side of OPCUA communication, and set its IP 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 perform air path fault injection simulation.
[0040] Before performing the air path fault injection simulation in step 3, the method further includes: checking the status bit to detect whether the client and the server are successfully connected. If the StateCode is set to 1, it means that the connection has been successfully established, otherwise the connection fails.
[0041] The server side activates the corresponding air path fault injection type fuel cell sub-model based on the error status code FaultCode, which is implemented based on the if-else fault injection structure. Different error status codes FaultCode correspond to different if-else fault branches in the server side.
[0042] The simulation of air compressor fault injection is as follows:
[0043] Air compressor failure is usually caused by dust or contaminants that cause the air filter to become blocked, resulting in poor air intake and reduced air flow.
[0044] By modifying the client end to the error status code FaultCode corresponding to the simulation of air compressor fault injection to 1 and the corresponding air compressor blockage coefficient;
[0045] Based on the error status code FaultCode, the server activates the fuel cell sub-model for air compressor fault injection through the if-else air compressor fault injection structure, and changes the air flow rate through the air compressor blockage coefficient, thereby changing the air path fault injection degree of the fuel cell sub-model to perform air compressor fault injection simulation.
[0046] Simulation of oxygen starvation injection, specifically:
[0047] The oxygen starvation model establishes a model of oxygen concentration variation over time based on the characteristics of oxygen changes in the fuel cell to simulate the reduction of oxygen supply.
[0048] By modifying the client to the error status code FaultCode 2 and the corresponding oxygen concentration coefficient corresponding to the simulation of oxygen starvation injection;
[0049] The server activates the fuel cell sub-model of oxygen starvation injection according to the error status code FaultCode through the if-else oxygen starvation injection structure, and changes the oxygen concentration through the oxygen concentration coefficient, thereby changing the oxygen starvation injection degree of the fuel cell sub-model to perform oxygen starvation injection simulation.
[0050] The simulation of communication packet loss fault injection is as follows:
[0051] Communication packet loss is usually caused by abnormal data transmission due to electromagnetic interference, communication equipment failure or communication line failure during the operation of the fuel cell.
[0052] By modifying the client end to correspond to the simulation of communication packet loss fault injection, the error status code FaultCode is 3 and the corresponding packet loss rate and packet loss time coefficient;
[0053] Based on the error status code FaultCode, the server activates the fuel cell sub-model of communication packet loss fault injection through the if-else communication packet loss fault injection structure, and changes the packet loss rate and packet loss time through the packet loss rate and packet loss time coefficients, thereby changing the communication packet loss fault injection degree of the fuel cell sub-model to perform communication packet loss fault injection simulation.
[0054] The embodiment of the present invention discloses a proton exchange membrane fuel cell air path fault injection simulation method for a semi-physical simulation system. The present invention combines actual hardware and virtual models by conducting fuel cell fault injection research on semi-physical simulation, provides a test system that is closer to reality, and can perform complex fault tests and operating condition simulations in a shorter time, thereby improving test efficiency and shortening the research and development cycle. The present invention can change the corresponding air path fault injection simulation model and the air path fault degree by directly modifying the error status code and degree variable to perform the corresponding air path fault injection simulation, which not only improves the test accuracy, efficiency and convenience, but also has better scalability. When simulating fault injection other than the existing fault injection, it is only necessary to add the corresponding if-else fault injection branch and store the corresponding fault injection sub-model in the fuel cell model, so as to realize the fault injection other than the existing fault injection and the simulation of different fault injection degrees.
[0055] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0056] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one 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 present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A proton exchange membrane fuel cell air path fault injection simulation method for a semi-physical simulation system, characterized in that: include: Step 1: Use Labview to establish the client end of OPCUA communication and set the error status code and degree variable; different error status codes represent different air path fault injection types; different degree variables represent different air path fault injection degrees; Based on the automatic code generation technology, the server-side code is encapsulated, the server-side of the OPCUA communication is established, and the fuel cell model running in the real-time simulator is embedded; wherein the fuel cell model includes: fuel cell sub-models of 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: Change the air path fault injection type and the air path fault injection degree by modifying the error status code and degree variable of the Client: The Server 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 perform air path fault injection simulation.
2. The method for injecting faults in the air path of a proton exchange membrane fuel cell for a semi-physical simulation system according to claim 1, characterized in that: In step 1, the host computer establishes the client end of OPC UA communication through Labview based on TCP / IP protocol.
3. The method for injecting faults in the air path of a proton exchange membrane fuel cell for a semi-physical simulation system according to claim 1, characterized in that: In step 1, the air path fault injection types include, but are not limited to: air compressor fault injection, oxygen starvation injection, and communication packet loss fault injection.
4. The method for injecting faults in the air path of a proton exchange membrane fuel cell for a semi-physical simulation system according to claim 3, characterized in that: The degree variables of the 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.
5. The method for injecting faults in the air path of a proton exchange membrane fuel cell for a semi-physical simulation system according to claim 1, characterized in that: In step 1, based on Matlab and Simulink automatic code generation technology, Sfunction is used to encapsulate the server-side code and establish the server-side of OPCUA communication.
6. The method for injecting faults in the air path of a proton exchange membrane fuel cell for a semi-physical simulation system according to claim 1, characterized in that: Before performing the air path fault injection simulation in step 2, the method further includes: detecting whether the client end and the server end are successfully connected by checking the status bit.
7. The method for injecting faults in the air path of a proton exchange membrane fuel cell for a semi-physical 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 according to the error status code, which is implemented based on the if-else fault injection structure.
8. The method for injecting faults in the air path of a proton exchange membrane fuel cell for a semi-physical simulation system according to claim 1, characterized in that: In step 2, the simulation of the air compressor fault injection is specifically as follows: By modifying the client end to an error status code corresponding to the simulation of the air compressor fault injection and a corresponding air compressor blocking coefficient; The server activates the fuel cell sub-model for air compressor fault injection according to the error status code, and changes the air path fault injection degree of the fuel cell sub-model through the air compressor blockage coefficient to perform air compressor fault injection simulation.
9. The method for injecting faults in the air path of a proton exchange membrane fuel cell for a semi-physical simulation system according to claim 1, characterized in that: In step 2, the simulation of oxygen starvation injection is specifically as follows: By modifying the client end to an error status code and a corresponding oxygen concentration coefficient corresponding to the simulation of the oxygen starvation injection; The server activates the fuel cell sub-model of oxygen starvation injection according to the error status code, and changes the oxygen starvation injection degree of the fuel cell sub-model through the oxygen concentration coefficient to perform oxygen starvation injection simulation.
10. The method for injecting faults in the air path of a proton exchange membrane fuel cell for a semi-physical simulation system according to claim 1, characterized in that: In step 2, the simulation of the communication packet loss fault injection is specifically as follows: By modifying the client end to have an error status code corresponding to the simulation of the communication packet loss fault injection and a corresponding packet loss rate and packet loss time coefficient; The server activates the fuel cell sub-model for communication packet loss fault injection according to the error status code, and changes the communication packet loss fault injection degree of the fuel cell sub-model through the packet loss rate and packet loss time coefficient to perform communication packet loss fault injection simulation.
Citation Information
Patent Citations
System C circuit model oriented soft error sensitivity analysis method
CN104598699A
Locomotive semi-physical simulation test system and method
CN106444420A
Multi-scale semi-physical simulation method applied to SOFC-MGT coupling system
CN106527179A
Development method of semi-physical simulation test system for fuel cell controller
CN115933437A
Unmanned aerial vehicle cluster network fault injection method and system
CN116193483A