Hydrogen engine controller hardware-in-the-loop test system, method and electronic device
By designing a hardware-in-the-loop test system for a hydrogen engine controller, and employing a Markov chain model and a detonation signal synthesis sub-model, the system achieves active generation and closed-loop verification of pre-ignition and detonation signals. This addresses the shortcomings of existing hydrogen engine testing technologies, improves testing efficiency and safety, and supports rapid iterative development.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FAW QI NEW POWER (CHANGCHUN) TECHNOLOGY CO LTD
- Filing Date
- 2026-04-29
- Publication Date
- 2026-06-23
AI Technical Summary
Existing hardware-in-the-loop testing technology cannot effectively simulate pre-ignition and knocking in hydrogen engines, lacks dedicated combustion modeling for hydrogen, suffers from distorted signal simulation, cannot trigger abnormal combustion tests as needed, has insufficient test coverage, has blind spots in safety verification, poses high risks for extreme condition testing, and has a long development cycle.
A hardware-in-the-loop testing system for a hydrogen engine controller was designed, comprising a host computer layer, a real-time simulation layer, a signal reconstruction and excitation layer, a load simulation layer, and a test object layer. A Markov chain model is used to generate pre-ignition signals, which are combined with a detonation signal synthesis sub-model. Through direct electrical signal injection or physical excitation injection, the system achieves active generation and closed-loop verification of abnormal combustion signals.
It achieves accurate simulation and active control of pre-ignition and detonation signals, shortens test time, reduces the risk of extreme condition testing, improves test coverage and the verification efficiency of controller protection logic, reduces the risk of equipment damage, and supports rapid iterative development.
Smart Images

Figure CN122261118A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of engine testing technology, and in particular to a hardware-in-the-loop testing system for a hydrogen engine controller, a hardware-in-the-loop testing method for a hydrogen engine controller, electronic equipment, and storage medium. Background Technology
[0002] As the global goal of carbon neutrality continues to advance, hydrogen engines, with their zero-carbon emission advantage, have become an important development direction in the field of internal combustion engines. Hydrogen possesses physical and chemical properties such as low ignition energy, rapid flame propagation speed, and a wide combustion limit. While improving combustion efficiency, it is also highly susceptible to abnormal combustion problems such as pre-ignition and knocking, which have become core technological bottlenecks restricting the industrialization of hydrogen engines.
[0003] To mitigate the risk of abnormal combustion, hydrogen engine controllers typically integrate control logic such as knock delay ignition, pre-ignition detection and torque limiting, and multi-level active protection. The effectiveness of this logic directly determines the engine's operational safety. Hardware-in-the-loop (HIL) testing is a crucial method for controller development and verification, and it has been widely applied in traditional engines and new energy power systems. However, existing technologies have significant limitations when adapting to the specific control requirements of hydrogen engines.
[0004] The closest existing technology to this invention is Chinese Patent CN105653439A, entitled "Method for Generating Hardware-in-the-Loop Test Cases for Engine Electronic Control Unit Software Function Verification." This method extracts data from road tests or high-altitude / high-temperature / high-humidity (HAT) experiments, converts the data into a format, and imports it into automated testing tools to reproduce the operating conditions and complete the detection of controller software defects. Furthermore, existing fuel cell controller hardware-in-the-loop testing platforms (such as CN114609924A and CN211349096U) primarily focus on verifying electrochemical characteristics and do not involve the transient combustion process of internal combustion engines, thus they cannot be used for abnormal combustion testing of hydrogen engines.
[0005] In summary, existing hardware-in-the-loop testing technologies have the following shortcomings in the verification of hydrogen engine controllers:
[0006] It passively relies on actual test data and cannot actively generate abnormal test signals;
[0007] Pre-ignition is characterized by low incidence, high randomness, and strong destructiveness. It is difficult to effectively capture in bench tests and road tests. Existing technologies can only passively reproduce the current working conditions and cannot trigger pre-ignition or detonation as needed, resulting in insufficient verification of protection logic.
[0008] The lack of dedicated hydrogen combustion modeling leads to distorted signal simulation.
[0009] The existing model is based on a traditional fuel engine and does not take into account the high pressure rise rate of hydrogen and the high frequency characteristics of the knock frequency of 8kHz–15kHz. It cannot reproduce the real abnormal combustion signal and is prone to misjudgment and omission by the controller.
[0010] There is no targeted closed-loop verification process, and the test coverage is insufficient.
[0011] The test cases do not have a closed-loop verification mechanism designed around anomaly identification, protection triggering, and effect evaluation. They rely on real vehicle data and are difficult to cover critical operating conditions and boundary parameters, resulting in blind spots in safety verification.
[0012] Extreme condition testing is high-risk and has a long development cycle;
[0013] Bench tests are prone to catastrophic failures such as engine top melting and component damage, making it difficult to fully conduct extreme boundary verification; moreover, bench preparation and debugging cycles are long, which cannot meet the needs of rapid iteration of controller software.
[0014] Therefore, the industry urgently needs a hardware-in-the-loop testing system and method that can actively generate abnormal hydrogen combustion signals, perform high-fidelity simulations, conduct full-process closed-loop verification, and perform zero-risk limit testing to address the pain points of existing technologies and support the efficient and reliable development of hydrogen engine controllers. Summary of the Invention
[0015] In view of this, the purpose of the present invention is to provide a hardware-in-the-loop testing system for a hydrogen engine controller, a hardware-in-the-loop testing method for a hydrogen engine controller, an electronic device and a storage medium, in order to solve the technical problems in the prior art.
[0016] This invention provides the following solution:
[0017] According to one aspect of the present invention, a hardware-in-the-loop test system for a hydrogen engine controller is provided, comprising:
[0018] The system consists of a host computer layer, a real-time simulation layer, a signal reconstruction and excitation layer, a load simulation layer, and a test object layer.
[0019] The upper-level computer includes: a model compilation and management module, a test case automatic generation module, and a monitoring and data analysis module, which are used to complete the compilation and management of the one-dimensional model of the hydrogen engine, automatic generation of test cases, monitoring and data analysis of the test process, and output of visual reports.
[0020] The real-time simulation layer includes a one-dimensional fluid and combustion calculation engine, a pre-ignition random occurrence submodule, a knock signal synthesis submodel, and an input / output interface mapping module, which are used to run a real-time model of the hydrogen engine; and to calculate the in-cylinder state in real time and actively generate pre-ignition or knock signals.
[0021] The signal reconstruction and excitation layer includes: direct electrical signal injection mode and physical excitation injection mode, which are used to convert simulated abnormal signals into analog electrical signals or physical vibration signals that can be recognized by the controller;
[0022] The load simulation layer includes: ignition coil, hydrogen injector, and electronic throttle load simulators, used to reproduce the electrical load characteristics of real actuators;
[0023] The tested object layer, including the hydrogen engine ECU, is used to receive simulation sensor signals and output drive commands, forming a closed-loop interaction with the real-time simulation layer.
[0024] Furthermore, including:
[0025] The pre-ignition random occurrence submodule is built based on Markov chains and classifies the combustion state into normal combustion, mild pre-ignition, and severe pre-ignition.
[0026] The state transition probability is dynamically calculated by real-time operating parameters, which include: engine speed, load, excess air coefficient, cylinder wall temperature, and oil volatility characteristics.
[0027] Furthermore, including:
[0028] The detonation signal synthesis sub-model is used to generate a multi-band superimposed attenuated sine wave, the amplitude of which is positively correlated with the pressure rise rate, and the waveform characteristics match the physical properties of hydrogen detonation.
[0029] Furthermore, including:
[0030] The direct electrical signal injection mode includes: directly outputting analog cylinder pressure and knock voltage to the ECU pins via the DAC board;
[0031] Physical excitation injection mode: drives a high-frequency vibration exciter to drive a real knock sensor and outputs a charge signal with link characteristics.
[0032] Furthermore, including:
[0033] The signal reconstruction and excitation layer can automatically or manually switch between direct electrical signal injection mode and physical excitation injection mode to meet the needs of controller algorithm verification and sensor signal link integrity verification, respectively.
[0034] Furthermore, including:
[0035] The input / output interface mapping module is used to map the cylinder pressure, temperature, and knock oscillation physical quantities output by the real-time simulation layer into standard analog electrical signals, and to map the ignition, hydrogen injection, and throttle drive signals output by the tested ECU into actuator parameters that the model can recognize, thereby realizing bidirectional real-time closed-loop interaction of the system.
[0036] Furthermore, including:
[0037] The pre-ignition random occurrence submodule has a protective action memory effect; when the ECU performs ignition delay or torque limiting protection actions in the previous cycle, the submodule automatically reduces the probability of pre-ignition in the current cycle to match the physical feedback characteristics of the real engine.
[0038] According to a second aspect of the present invention, a hardware-in-the-loop testing method for a hydrogen engine controller is provided, comprising the following steps:
[0039] Load test cases, start the hydrogen engine model and stabilize it to the target operating condition, and establish a communication connection with the ECU;
[0040] Based on the operating conditions and Markov chain probability, the pre-ignition abnormal cylinder pressure curve and high-frequency knock signal are determined and generated.
[0041] At a specified crankshaft angle position, an abnormal signal is injected into the ECU using either an electrical signal or a physical excitation method;
[0042] The control parameters and protection status parameters of the ECU are collected and sampled and recorded with a resolution of not less than 1° crankshaft angle or 1ms time. The control parameters and protection status parameters include: ignition angle, torque limit and protection flag parameters.
[0043] Calculate the recognition delay, action amplitude, and recovery characteristic indicators, compare them with the threshold to determine whether the test case passes. If it passes, the parameters for the next round of testing are adaptively adjusted.
[0044] According to three aspects of the present invention, an electronic device is provided, comprising: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0045] The memory stores a computer program that, when executed by a processor, causes the processor to perform steps of a hardware-in-the-loop test method for a hydrogen engine controller.
[0046] According to four aspects of the present invention, a computer-readable storage medium is provided that stores a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of a hardware-in-the-loop test method for a hydrogen engine controller.
[0047] Compared with the prior art, the present invention has the following advantages:
[0048] This invention utilizes an active modeling approach to achieve proactive and controllable generation of pre-ignition and detonation signals, enabling the precise injection of abnormal combustion signals of varying intensities under any operating condition and cycle. It eliminates the inefficient method of accidental capture during traditional road tests, reducing the acquisition time for abnormal combustion events from hundreds of hours to seconds, thus improving testing efficiency and ensuring thorough and timely verification of the controller's protection logic.
[0049] This invention avoids the risk of damage to a real engine due to control strategy failure by conducting all extreme conditions and destructive tests within a hardware-in-the-loop simulation environment, significantly reducing the high costs associated with prototype damage and rework. Furthermore, the system's built-in virtual safety protection mechanism automatically terminates the test when parameters are abnormal, ensuring safety and controllability throughout the entire testing process.
[0050] This invention utilizes intelligent sampling algorithms to generate test cases, comprehensively covering the entire operating range of a hydrogen engine, and focusing on intensive testing of critical operating conditions prone to pre-ignition and low-speed, high-load regions. Compared to simply increasing coverage with traditional testing methods, this approach can accurately expose potential failures under extreme edge conditions, enhancing the robustness of the controller.
[0051] This invention achieves precise quantitative analysis of indicators such as signal recognition delay, ignition adjustment amplitude, torque response speed, and parameter recovery characteristics at the millisecond and crankshaft angle levels through multi-cycle closed-loop verification. It leverages high-precision test data to achieve refined parameter calibration, improve the accuracy of protection logic calibration, and optimize the adaptation effect of control strategies.
[0052] This invention automatically stores all test inputs, controller responses, and test results to form a standardized and traceable database. The test data possesses complete traceability and can be directly used for software upgrade regression verification and reuse in the development of similar models, reducing repetitive testing work and providing data support for the long-term optimization and platform development of hydrogen engine controllers. Attached Figure Description
[0053] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0054] Figure 1 This is a structural diagram of a hardware-in-the-loop test system for a hydrogen engine controller provided in one or more embodiments of the present invention.
[0055] Figure 2 This is a flowchart of a hardware-in-the-loop testing method for a hydrogen engine controller provided by one or more embodiments of the present invention.
[0056] Figure 3 This is an overall framework diagram of a hardware-in-the-loop test system for a hydrogen engine controller according to a specific embodiment of the present invention.
[0057] Figure 4 This is a flowchart illustrating the pre-ignition and knock signal generation of a hardware-in-the-loop test system for a hydrogen engine controller, according to a specific embodiment of the present invention.
[0058] Figure 5 This is a schematic diagram of a closed-loop verification method for a hardware-in-the-loop test system for a hydrogen engine controller, according to a specific embodiment of the present invention.
[0059] Figure 6 This is a schematic diagram illustrating the generation of test cases for a hardware-in-the-loop test system for a hydrogen engine controller, according to a specific embodiment of the present invention.
[0060] Figure 7 This is a schematic diagram of the signal injection mode of a hardware-in-the-loop test system for a hydrogen engine controller according to a specific embodiment of the present invention.
[0061] Figure 8 This is a schematic diagram illustrating the dynamic functional relationship between the pre-ignition probability and operating conditions of a hardware-in-the-loop test system for a hydrogen engine controller, according to a specific embodiment of the present invention.
[0062] Figure 9 This is a schematic diagram of the hydrogen engine pre-ignition cycle memory effect in a hardware-in-the-loop test system for a hydrogen engine controller, according to a specific embodiment of the present invention.
[0063] Figure 10 This is a schematic diagram of the pre-ignition and knocking cylinder pressure curves of a hydrogen engine under normal combustion compared with the injected cylinder pressure curves of a hydrogen engine controller hardware-in-the-loop test system according to a specific embodiment of the present invention.
[0064] Figure 11 This is a schematic diagram of a hydrogen engine knock sensor in a hardware-in-the-loop test system for a hydrogen engine controller, according to a specific embodiment of the present invention.
[0065] Figure 12 This is a schematic diagram comparing traditional grid sampling and Latin hypercube sampling of a hydrogen engine in a hardware-in-the-loop test system for a hydrogen engine controller according to a specific embodiment of the present invention.
[0066] Figure 13 This is a schematic diagram of the internal ignition advance angle response of a hydrogen engine controller in a hardware-in-the-loop test system for a hydrogen engine controller according to a specific embodiment of the present invention.
[0067] Figure 14This is a schematic diagram of the relative torque response curve inside the hydrogen engine controller of a hardware-in-the-loop test system for a hydrogen engine controller according to a specific embodiment of the present invention.
[0068] Figure 15 This is an electronic device structure block diagram of a hardware-in-the-loop testing method for a hydrogen engine controller provided by one or more embodiments of the present invention. Detailed Implementation
[0069] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. 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.
[0070] In existing technologies, pre-ignition testing systems for conventional gasoline engines are mainly designed for the characteristics of gasoline fuel, but they cannot meet the testing requirements of hydrogen engines. The core reason is that there are significant differences in the physical characteristics of hydrogen pre-ignition and gasoline pre-ignition:
[0071] Hydrogen has an extremely low ignition energy; its minimum ignition energy is far lower than that of gasoline, making it highly susceptible to pre-ignition from even the smallest hot spots. Therefore, the testing system must be able to simulate pre-ignition caused by extremely weak precipitates, which places higher demands on the sensitivity of signal generation and the precision of the stochastic model.
[0072] The rapid flame propagation speed of hydrogen, far exceeding that of gasoline, results in a significantly higher rate of pressure increase within the cylinder. Traditional knock signal models that rely on the low-frequency characteristics of gasoline engines cannot accurately simulate hydrogen knock.
[0073] Without a liquid phase change, hydrogen is injected in a gaseous state, lacking the cooling effect of evaporative heat absorption, which makes the cylinder temperature rise more easily and exacerbates the tendency for pre-ignition.
[0074] Due to the unique characteristics of hydrogen fuel, existing testing systems have significant shortcomings and cannot meet the requirements for pre-ignition testing of hydrogen engines. Therefore, there is an urgent need for a pre-ignition simulation testing system adapted to hydrogen engines.
[0075] Figure 1 This is a structural diagram of a hardware-in-the-loop test system for a hydrogen engine controller provided in one or more embodiments of the present invention.
[0076] like Figure 1 As shown, it includes:
[0077] The system consists of a host computer layer, a real-time simulation layer, a signal reconstruction and excitation layer, a load simulation layer, and a test object layer.
[0078] The upper-level computer includes: a model compilation and management module, a test case automatic generation module, and a monitoring and data analysis module, which are used to complete the compilation and management of the one-dimensional model of the hydrogen engine, automatic generation of test cases, monitoring and data analysis of the test process, and output of visual reports.
[0079] The real-time simulation layer includes a one-dimensional fluid and combustion calculation engine, a pre-ignition random occurrence submodule, a knock signal synthesis submodel, and an input / output interface mapping module, which are used to run a real-time model of the hydrogen engine; and to calculate the in-cylinder state in real time and actively generate pre-ignition or knock signals.
[0080] The signal reconstruction and excitation layer includes: direct electrical signal injection mode and physical excitation injection mode, which are used to convert simulated abnormal signals into analog electrical signals or physical vibration signals that can be recognized by the controller;
[0081] The load simulation layer includes: ignition coil, hydrogen injector, and electronic throttle load simulators, used to reproduce the electrical load characteristics of real actuators;
[0082] The tested object layer, including the hydrogen engine ECU, is used to receive simulation sensor signals and output drive commands, forming a closed-loop interaction with the real-time simulation layer.
[0083] Specifically, by incorporating a Markov chain-based random pre-ignition sub-model, the operating parameters are dynamically correlated with the probability of failure, enabling the system to proactively and on-demand generate rare pre-ignition events. This solves the problem that traditional methods rely on measured data, which makes it impossible to reproduce the fault, and significantly improves the verification efficiency.
[0084] Figure 2 This is a flowchart of a hardware-in-the-loop testing method for a hydrogen engine controller provided by one or more embodiments of the present invention.
[0085] like Figure 2 As shown, it includes the following steps:
[0086] Step S1: Load test cases, start the hydrogen engine model and stabilize it to the target operating condition, and establish a communication connection with the ECU;
[0087] Step S2: Based on real-time operating conditions and Markov chain probability, determine and generate pre-ignition abnormal cylinder pressure curve and high-frequency knock signal.
[0088] Step S3: At a specified crankshaft angle position, inject an abnormal signal into the ECU using an electrical signal or physical excitation method;
[0089] Step S4: Collect the control parameters and protection status parameters of the ECU, and complete the sampling and recording with a resolution of not less than the preset crankshaft angle or 1ms time; the control parameters and protection status parameters include: ignition angle, torque limit and protection flag parameters;
[0090] Step S5: Calculate the recognition delay, action amplitude, and recovery characteristic indicators, compare them with the threshold to determine whether the test case passes. If it passes, adaptively adjust the test parameters for the next round.
[0091] Specifically, by combining the Markov chain probability model, the pre-ignition cylinder pressure curve and knock signal can be generated in real time, and the excitation can be precisely injected at the specified crankshaft angle position. This breaks away from the limitation of traditional testing relying on road tests to accidentally capture abnormal operating conditions, and realizes the active and controllable reproduction of pre-ignition and knock abnormal signals. The time for acquiring abnormal operating conditions is shortened from hundreds of hours to seconds, further improving testing efficiency and ensuring that the abnormal combustion protection logic of the controller is fully and timely verified.
[0092] Meanwhile, all extreme operating conditions and destructive anomaly tests do not require the participation of a real hydrogen engine, thus avoiding problems such as prototype explosions and hardware damage due to protection strategy failures, reducing high equipment maintenance and rework costs, and achieving zero-risk testing throughout the entire process.
[0093] The system loads intelligent optimized test cases, which fully cover the entire operating range of the hydrogen engine, and focuses on intensive testing in areas prone to pre-ignition, such as low speed and high load and the critical zone of excess air coefficient. The operating condition coverage is improved compared with traditional testing methods, which can fully expose hidden failure problems under extreme edge conditions and effectively improve the robustness of controller operation.
[0094] The process automatically completes the stabilization of operating conditions, signal injection, data acquisition, and result judgment. It also adaptively adjusts subsequent test parameters based on the results of a single test, eliminating tedious manual bench debugging and reducing the single verification cycle. It supports high-frequency iteration and rapid regression testing of the controller software, shortening the overall calibration and development cycle. Furthermore, the system acquires operating parameters such as ignition angle, torque limit, and protection flags with a resolution of at least 1ms and crankshaft angle. It automatically calculates and identifies key evaluation indicators such as recognition delay, action amplitude, and parameter recovery rate, completing threshold comparison and performance quantification. Relying on high-precision measured data, it achieves refined parameter calibration, improving the accuracy of protection logic control. Simultaneously, it uniformly stores and archives the input excitation signals, controller response data, operating parameters, and judgment results throughout the entire testing process, forming a complete and traceable test database. Historical data can be directly used for subsequent software version upgrade regression verification and reuse development of models on the same platform, reducing repetitive testing work and providing data support for the serialized iterative optimization of hydrogen engine controllers.
[0095] In one embodiment, see Figure 3It consists of five parts: the host computer layer, the real-time simulation layer, the signal reconstruction and excitation layer, the load simulation layer, and the object under test layer. The layers are connected by high-speed data buses, analog signal lines, and digital signal lines to form a complete closed-loop test system.
[0096] The host computer layer is deployed on a high-performance workstation and mainly undertakes model management, test case generation and data analysis functions. It includes three core modules: model compilation and management module, test case automatic generation module and monitoring and data analysis module.
[0097] Model compilation and management module. Used to load the one-dimensional hydrodynamic model of the hydrogen engine, set combustion parameters, boundary conditions and abnormal combustion algorithm parameters, and compile the model into code that can run on a real-time processor.
[0098] Automatic Test Case Generation Module. This module incorporates a Latin hypercube sampling algorithm or an orthogonal experimental design algorithm to automatically generate a set of test cases covering all operating conditions based on a user-defined parameter space (such as excess air coefficient range, speed range, load range, etc.), and outputs it as a configuration script in a standard format.
[0099] The monitoring and data analysis module is used to monitor the test process in real time, display key parameter curves, and automatically extract data after the test, calculate indicators such as response latency and action amplitude, and generate a visual test report.
[0100] The real-time simulation layer is the core computing unit of the system, employing an industrial-grade real-time processor with microsecond-level real-time processing capabilities. This layer runs a compiled real-time model of a hydrogen engine and mainly includes the following sub-modules: a one-dimensional fluid and combustion calculation engine, a pre-ignition random occurrence sub-model, a knock signal synthesis sub-model, and an input / output interface mapping module.
[0101] Among them is a one-dimensional fluid and combustion calculation engine. Based on the equations of mass conservation, momentum conservation, and energy conservation, this engine calculates intake and exhaust flow rates, in-cylinder pressure, temperature, and combustion heat release rate in real time. For the characteristics of hydrogen, the engine modifies the laminar flame velocity model and the turbulent combustion model to accurately reflect the physical process of rapid hydrogen combustion.
[0102] The pre-ignition random occurrence sub-model incorporates a Markov chain-based state transition algorithm to read current operating parameters in real time, dynamically calculate the state transition probability matrix, and use a random number generator to determine whether pre-ignition occurs in the current cycle and its intensity level.
[0103] The knock signal synthesis sub-model is used to synthesize high-frequency oscillation signal waveforms in real time based on the calculated in-cylinder pressure rise rate and the frequency characteristics of hydrogen knock.
[0104] Input / output interface mapping module. It is responsible for mapping the physical quantities (such as pressure and temperature) calculated by the model into electrical signal values, and mapping the acquired controller drive signals into the actuator parameters required by the model (such as fuel injection pulse width and ignition timing).
[0105] The signal reconstruction and excitation layer converts the digital signals output by the real-time simulation layer into real physical signals that the controller under test can recognize. It includes two working modes: direct electrical signal injection mode and physical excitation mode.
[0106] The direct electrical signal injection mode directly outputs analog voltage signals via a high-precision digital-to-analog converter board. This includes an analog output channel for generating continuous signals such as cylinder pressure, intake pressure, and temperature; a high-frequency arbitrary waveform generation channel for generating knock oscillation voltage signals from 6 kHz to 20 kHz; and a digital output channel for generating crankshaft position pulses, camshaft position pulses, and ignition trigger signals.
[0107] Physical excitation mode. This mode controls a high-frequency vibration exciter (such as a piezoelectric ceramic stack or electromagnetic hammer) via a power drive circuit. When simulating detonation, the system outputs a drive pulse to excite the vibrator, causing it to generate mechanical vibration, which is then transmitted to a real detonation sensor mounted on the test fixture. The sensor then converts the vibration into a charge signal, which is input to the controller. This mode is used to verify the effects of sensor link and installation characteristics.
[0108] The load simulation layer simulates a real electrical environment and includes load simulation units connected to the output of the controller.
[0109] It also includes an ignition coil load simulator. This simulator uses an adjustable resistive load connected in series with an inductive load to simulate the impedance characteristics of a real ignition coil, ensuring the authenticity of the controller's ignition drive waveform.
[0110] Hydrogen injector load simulator. A high-power inductive load is used to simulate the inductance and resistance of the hydrogen injector, verifying the controller's hydrogen injection drive capability and freewheeling protection function.
[0111] Electronic throttle load simulator. It uses a DC motor load to simulate the back electromotive force and current characteristics of the throttle motor.
[0112] The object under test is the hydrogen engine controller to be verified. The controller is connected to the signal reconstruction layer and the load simulation layer through a wiring harness. It receives simulated sensor signals, performs internal logic operations, and outputs actuator drive signals to form a complete hardware-in-the-loop closed loop.
[0113] In one embodiment, the pre-ignition and detonation signal generation model is built into the real-time simulation layer, see [link to relevant documentation]. Figure 4 The following steps are performed in each computation cycle:
[0114] Step 1: Operating Parameter Reading and Feature Extraction: The model reads the engine operating parameters of the current cycle in real time, including excess air coefficient, engine speed, load rate, ignition advance angle, cylinder wall temperature, and oil volatility coefficient. These parameters are normalized to form an operating feature vector.
[0115] Step Two: Dynamic State Transition Probability Calculation: Based on Markov chain theory, the combustion state space is defined as three states: normal combustion, mild pre-ignition, and severe pre-ignition. The model calculates the probability of transitioning from the current state to other states by substituting the operating condition feature vector extracted in Step One into a preset nonlinear mapping function.
[0116] Specifically, when the excess air coefficient is in the critical lean range and the load is high, the probability of transitioning to mild pre-ignition and severe pre-ignition increases significantly. When it is detected that the controller has executed large-angle ignition delay protection in the previous cycle, the model will automatically reduce the probability of pre-ignition in the next cycle to simulate the feedback effect of protection actions to eliminate hot spots in the physical world.
[0117] Step 3: Random State Determination: The model generates a uniformly distributed random number between 0 and 1, and compares it with the cumulative probability distribution calculated in Step 2 to determine the combustion state of the current cycle. If the determination result is normal combustion, standard combustion calculation is performed; if the determination is pre-ignition, the abnormal combustion signal generation logic is triggered.
[0118] Step 4: Abnormal Cylinder Pressure Curve Generation: If pre-ignition is determined to have occurred, an abnormal pressure rise curve is superimposed on the model at a specific crankshaft angle position (e.g., between 10 and 30 degrees) before the top dead center of the compression stroke. The peak pressure and pressure rise rate of this curve are adjusted according to the pre-ignition intensity level (mild or severe). The pressure peak of severe pre-ignition can reach 1.5 to 2 times that of normal combustion, and the pressure rise edge is steeper.
[0119] Step 5: Synthesis of high-frequency detonation oscillation signal: Regardless of whether pre-ignition occurs, the model calculates the detonation intensity index in real time. This index is calculated based on the maximum pressure rise rate of the current cycle and the distance between the ignition time and the detonation boundary.
[0120] If the knock intensity index exceeds a threshold, the model activates a high-frequency oscillation signal synthesis algorithm. This algorithm generates a multi-band superimposed attenuated sine wave signal, with its dominant frequency range set between 8 kHz and 15 kHz to match the high-frequency characteristics of hydrogen knock. The signal amplitude increases with the knock intensity index, and the attenuation coefficient, simulating the short duration of hydrogen combustion, is set to a large value to achieve rapid attenuation. The synthesized oscillation signal is superimposed on the cylinder pressure signal or used directly as the output signal of an independent knock sensor.
[0121] In the pre-ignition simulation test system of this invention, the core technology uses a Markov chain model to achieve high-fidelity simulation of pre-ignition events. The application principle of this model has a clear physical meaning, as follows:
[0122] State Definition. The model defines the combustion process as discrete states such as normal combustion, mild pre-ignition, and severe pre-ignition.
[0123] Dynamic probability. The state transition probability is not a constant, but a function of the current operating parameters. The probability of transitioning from one state to another under different operating conditions is determined by fitting a mapping relationship to experimental data.
[0124] Memory effect. The model considers the impact of control actions from the previous cycle on the current cycle. For example, ignition delay reduces the probability of pre-ignition in subsequent cycles, thus more realistically simulating the feedback mechanism of the physical world.
[0125] This dynamic probability mechanism ensures that the simulated pre-ignition events are statistically consistent with those of real hydrogen engines, and is the theoretical basis for achieving high-fidelity verification.
[0126] One embodiment includes a standardized multi-loop closed-loop verification method, see [link to documentation]. Figure 5 Each test case includes the following steps:
[0127] Test initialization step S301: The host computer loads the test case configuration file and parses the target operating condition parameters and expected response indicators. The real-time simulator starts the hydrogen engine model, runs to the target operating point and stabilizes, the criterion being that the speed and load fluctuations are less than 2% within 50 consecutive cycles. The monitoring module establishes a communication connection with the controller and begins recording data.
[0128] Dynamic signal injection step S302: The system enters the test loop counting. At the preset injection loop point (which can be fixed or random), the pre-ignition random occurrence model calculates the probability and makes a state determination based on the current operating conditions.
[0129] If an abnormality is detected, the signal reconstruction and excitation layer injects an abnormal signal at a precise crankshaft angle position (accurate to ±0.5 degrees). For pre-ignition, an abnormal cylinder pressure curve is output through the analog channel; for knock, an oscillation voltage is output through the high-frequency channel or a physical exciter is driven.
[0130] Controller response acquisition step S303: In multiple consecutive cycles after signal injection (e.g., 30 cycles), the system acquires the controller's output signal and internal status parameters at high speed.
[0131] The data collected includes: the actual trajectory of the ignition advance angle, throttle opening command, torque limit flag status, knock counter value, and pre-ignition counter value. The sampling resolution reaches 1 degree crankshaft rotation or 1 millisecond.
[0132] Logical decision and indicator calculation step S304: After the test, the system automatically calculates the following performance indicators and compares them with the expected values:
[0133] First, identify the delay. Calculate the number of cycles from the moment the abnormal signal is injected until the controller first executes a protective action (such as ignition delay).
[0134] Next, calculate the action range. Calculate whether the maximum ignition angle retardation and torque limit percentage meet the calibration requirements.
[0135] Recalculate the recovery characteristics. Calculate the number of cycles required for engine parameters to return to normal levels after the fault disappears.
[0136] If all metrics are within the allowable range, the use case is considered successful; otherwise, it is considered a failure, and the specific failure mode is marked.
[0137] Adaptive Iteration and Report Generation Step S305: Based on the judgment result, the system executes an adaptive strategy. If the test passes, the system can automatically adjust parameters to increase the test difficulty (such as increasing pre-ignition intensity or changing the operating point) for the next round of testing; if the test fails, the system records detailed data and pauses or skips the relevant high-risk test cases.
[0138] After all test cases have been executed, the system automatically generates a detailed test report containing pass rate, failure distribution, and response curve comparison, and archives it to the database.
[0139] This embodiment primarily addresses the pre-ignition simulation testing requirements of hydrogen engines and provides the aforementioned technical solution. It should be noted that this technical solution possesses good versatility and scalability, and can be adapted to various engine types, as detailed below:
[0140] Natural gas engine. The system architecture can be reused simply by adjusting the flame velocity parameters and detonation frequency range in the combustion model.
[0141] High compression ratio gasoline engines. By modifying the pre-ignition trigger probability mapping for high-octane gasoline or ethanol gasoline, the super knock protection logic of high-performance gasoline engines can be verified.
[0142] Multi-fuel switching engine. The system supports online fuel switching models and simulates the transient protection logic when the vehicle switches fuel modes during driving, a complex scenario that is difficult to achieve with traditional single-fuel test benches.
[0143] One embodiment includes a test case auto-generation module, see [link to documentation]. Figure 6 This includes the following steps:
[0144] Parameter space definition step S401: The user inputs key influencing parameters of pre-ignition and knocking in the hydrogen engine and their value ranges. These include excess air coefficient (1.0 to 3.5), engine speed (800 to 4000 rpm), load rate (20% to 100%), ignition advance angle (-10 degrees to 30 degrees crankshaft angle), virtual hot spot location (intake side, center, exhaust side), and oil volatility rating. Specifically, the system supports setting a higher sampling density for known high-risk ranges (e.g., excess air coefficient 2.0 to 2.5).
[0145] Space-filling sampling step S402: The system uses the Latin hypercube sampling algorithm to divide the value range of each parameter into N equal intervals (N is the number of test cases to be generated), and randomly selects a sample point in each interval. Through this hierarchical random sampling method, it is ensured that the generated test case set is uniformly distributed in the multidimensional parameter space, which avoids sample clustering and ensures coverage of edge cases.
[0146] Test Case Sequence Construction Step S403: The system converts the sampled parameter combinations into specific test scripts. Each script includes information such as the stabilization time of the operating condition, the signal injection strategy (injection time, injection type, intensity distribution), and the expected response threshold. All scripts are arranged sequentially to form an automated test sequence and saved in a standard file format for the test execution module to call.
[0147] In one embodiment, the system supports switching between two signal injection modes to adapt to different testing requirements; see [link to relevant documentation]. Figure 7 Specifically:
[0148] Direct electrical signal injection includes: a switch matrix that directly connects the digital-to-analog converter output of the real-time simulator to the sensor input pin of the controller.
[0149] The workflow is as follows: the real-time model calculates the abnormal cylinder pressure value and knock oscillation waveform, and the digital-to-analog converter board converts it into an analog voltage signal of 0 to 5 volts or -5 to 5 volts, which directly drives the controller input circuit.
[0150] This mode, through precise control of signal parameters (amplitude, frequency, phase), has excellent repeatability and is suitable for logic verification and parameter calibration of control algorithms.
[0151] Physical excitation injection includes: the switching matrix disconnects the direct voltage output and instead connects the power drive circuit.
[0152] In one embodiment, a pre-ignition stochastic sub-model is included, see [link to relevant documentation]. Figure 8-9 The model incorporates a state transition algorithm based on Markov chains. It pre-classifies the engine's combustion states across all operating conditions into three categories: normal combustion, mild pre-ignition, and severe pre-ignition. The model then dynamically calculates the state transition probability based on real-time engine operating parameters (such as excess air coefficient, engine speed, load, and cylinder wall temperature).
[0153] Meanwhile, based on the Markov memoryless chain, a memory effect is introduced. If the controller performs pre-ignition-related protective intervention actions in the previous working cycle of the engine, the model will automatically reduce the probability of pre-ignition in the next working cycle, thereby suppressing the risk of pre-ignition in continuous cycles. The specific effects are explained in detail with reference to the attached figures below:
[0154] Combination Figure 8 The dynamic functional relationship between the pre-ignition probability and the operating conditions is shown in the figure. As the engine's excess air coefficient λ changes, the combustion state transition probability exhibits a corresponding dynamic change pattern: the black dashed line in the figure represents the normal combustion probability, and the black solid line represents the pre-ignition probability. Within the lean combustion range of 1.0 to 1.6, the pre-ignition probability remains low, while the normal combustion probability remains stable. When the excess air coefficient λ continuously increases to the range of 1.9 to 2.2, the pre-ignition probability rises rapidly and reaches a peak, corresponding to a significant increase in the risk of pre-ignition under lean combustion conditions. As the excess air coefficient continues to increase, the pre-ignition probability slowly declines and tends to stabilize, while the normal combustion probability remains stable throughout. These curve changes intuitively verify the core mechanism of this model, which can dynamically and adaptively update the combustion state transition probability based on real-time operating parameters.
[0155] Combination Figure 9 The impact of the protection action on the probability of pre-ignition in subsequent cycles was investigated by comparing and verifying the changes in the probability of pre-ignition in the continuous working cycles of the engine. The gray horizontal dashed line in the figure represents the traditional memoryless effect model. The traditional Markov model has the property of no memory. The combustion state probability of a single cycle is completely independent of the historical cycle conditions and is not affected by the protection action or combustion state of the previous cycle. Therefore, the probability of pre-ignition always remains constant in all continuous working cycles (cycle 1 to cycle 6), and it is impossible to achieve adaptive risk attenuation.
[0156] The black solid line in the figure represents the improved model of the memory effect introduced in this embodiment: In the first and second cycles, the initial pre-ignition probability of this model is basically at the same level as the traditional memoryless model; after the protection action of the previous cycle is triggered, relying on the linkage mechanism of the cyclic memory effect, the probability of pre-ignition in cycle 3 drops sharply, reaching the lowest value of the entire cycle; in the subsequent continuous operation from cycle 3 to cycle 6, although the probability of pre-ignition slowly recovers as the cycle progresses, the probability of pre-ignition throughout the entire process is significantly lower than that of the traditional memoryless model, which fully verifies that the cyclic memory effect introduced in this embodiment can effectively reduce the probability of pre-ignition in subsequent cycles after the protection action, and achieve continuous suppression of the risk of engine pre-ignition under continuous operating conditions.
[0157] In one embodiment, a knock signal synthesis sub-model is included. Based on the calculated in-cylinder pressure rise rate and combined with the high-frequency characteristics of hydrogen knock, a multi-band superimposed attenuated sine wave signal is synthesized in real time and superimposed on the cylinder pressure signal or used as an independent sensor output signal. See [link to documentation]. Figure 10-11 As shown.
[0158] This study compares and analyzes the relationship between cylinder pressure and crankshaft angle under normal combustion and pre-ignition + knock conditions. Under normal combustion, cylinder pressure changes smoothly with crankshaft angle, reaching a peak of approximately 40 bar near top dead center. However, under pre-ignition + knock conditions, the air-fuel mixture spontaneously combusts during the compression stroke (approximately -25°CA), causing a sharp rise in cylinder pressure, exceeding 75 bar and far surpassing the safety thresholds for components. Furthermore, the pressure peak phase is ahead of the curve, resulting in severe mechanical shock. This embodiment introduces a pre-ignition stochastic model with a memory effect, which can accurately identify early risks before pressure mutations occur, preventing the formation of destructive spikes in cylinder pressure as shown by the black dashed curve in the figure, thus ensuring safe and stable engine operation.
[0159] In one embodiment, it further includes an input / output interface mapping module. This module is responsible for mapping the physical quantities calculated by the model into electrical signal values, and mapping the acquired controller drive signals into the actuator parameters required by the model.
[0160] In one embodiment, a specific example of performing a typical pre-ignition protection verification test is provided, including the following steps:
[0161] Test case generation steps: Test cases are generated automatically based on Latin hypercube sampling technology, and encrypted according to high-risk areas. See [link / reference]. Figure 12 As shown.
[0162] The left image shows that traditional methods repeatedly sample at common operating points (clustering in the central area), which is difficult to cover edge areas such as high speed / low load. The right image shows that the present invention uses the LHS algorithm, with 30 test points evenly filling the entire parameter space. In particular, it has carried out intensive sampling in the "high-risk area" (medium-high load 2000-3500rpm area) where pre-ignition is prone to occur, which improves the test coverage by more than 5 times and can effectively detect controller defects under edge operating conditions.
[0163] Test initialization steps: The host computer loads the test case configuration file and parses the target operating condition parameters and expected response indicators. The real-time simulator starts the model and runs to the target operating point. After the parameters stabilize, a communication connection with the controller is established.
[0164] Dynamic signal injection steps: The system enters the test cycle counting. At the preset injection cycle point, the pre-ignition random occurrence model calculates the probability and makes a state determination based on the current operating conditions. If an abnormality is determined, the signal reconstruction and excitation layer injects abnormal signals, including abnormal cylinder pressure curves and high-frequency knock oscillation signals, at a precise crankshaft angle position.
[0165] Controller response acquisition steps: In multiple consecutive loops after signal injection, the system rapidly acquires the controller's output signals and internal status parameters, including ignition advance angle change trajectory, throttle opening command, fault flag status, etc. Figure 13-14 As shown.
[0166] After injecting a pre-ignition signal in the 10th cycle, the controller, after a one-cycle recognition delay, began rapidly retarding the ignition angle in the 11th cycle, with a maximum retarding of 12°CA. Simultaneously, to protect the engine, the controller triggered torque limiting logic, reducing relative torque by 40% over three cycles. As the anomaly disappeared, the ignition angle and torque gradually returned to normal levels after approximately eight cycles. The system accurately recorded these quantitative indicators for calibration and verification.
[0167] Logical judgment and indicator calculation steps: After the test, the system automatically calculates performance indicators such as recognition latency, action amplitude, and recovery characteristics, and compares them with expected values. If all indicators are within the allowable range, the test case is judged to pass; otherwise, it is judged to fail.
[0168] Adaptive iteration and report generation steps: Based on the judgment results, the system executes an adaptive strategy, automatically adjusting parameters for the next round of testing or recording failure data. After all test cases are executed, a detailed test report is automatically generated.
[0169] Figure 15 This is an electronic device structure block diagram of a hardware-in-the-loop testing method for a hydrogen engine controller provided by one or more embodiments of the present invention.
[0170] like Figure 15 As shown, this application provides an electronic device, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0171] The memory stores a computer program that, when executed by a processor, causes the processor to perform the steps of a hardware-in-the-loop test method for a hydrogen engine controller.
[0172] This application also provides a computer-readable storage medium storing a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of a hardware-in-the-loop test method for a hydrogen engine controller.
[0173] For the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0174] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0175] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A hardware-in-the-loop test system for a hydrogen engine controller, characterized in that, include: The system consists of a host computer layer, a real-time simulation layer, a signal reconstruction and excitation layer, a load simulation layer, and a test object layer. The upper-level computer includes: a model compilation and management module, a test case automatic generation module, and a monitoring and data analysis module, which are used to complete the compilation and management of the one-dimensional model of the hydrogen engine, automatic generation of test cases, monitoring and data analysis of the test process, and output of visual reports. The real-time simulation layer includes a one-dimensional fluid and combustion calculation submodule, a pre-ignition random occurrence submodule, a knock signal synthesis submodel, and an input / output interface mapping submodule, which are used to run a real-time model of the hydrogen engine; and to calculate the in-cylinder state in real time and actively generate pre-ignition or knock signals. The signal reconstruction and excitation layer includes: direct electrical signal injection mode and physical excitation injection mode, which are used to convert simulated abnormal signals into analog electrical signals or physical vibration signals that can be recognized by the controller; The load simulation layer includes: ignition coil, hydrogen injector, and electronic throttle load simulators, used to reproduce the electrical load characteristics of real actuators; The tested object layer, including the hydrogen engine ECU, is used to receive simulation sensor signals and output drive commands, forming a closed-loop interaction with the real-time simulation layer.
2. The hardware-in-the-loop test system for a hydrogen engine controller according to claim 1, characterized in that, include: The pre-ignition random occurrence submodule is constructed based on Markov chains and classifies the combustion state into normal combustion, mild pre-ignition, and severe pre-ignition. The state transition probability is dynamically calculated by real-time operating parameters, which include: engine speed, load, excess air coefficient, cylinder wall temperature, and oil volatility characteristics.
3. The hardware-in-the-loop test system for a hydrogen engine controller according to claim 1, characterized in that, include: The detonation signal synthesis sub-model is used to generate a multi-band superimposed attenuated sine wave, the amplitude of which is positively correlated with the pressure rise rate. The waveform characteristics match the physical properties of hydrogen detonation.
4. The hardware-in-the-loop test system for a hydrogen engine controller according to claim 1, characterized in that, include: The direct electrical signal injection mode includes: directly outputting analog cylinder pressure and knock voltage to the ECU pins via the DAC board; Physical excitation injection mode: drives a high-frequency vibration exciter to drive a real knock sensor and outputs a charge signal with link characteristics.
5. The hardware-in-the-loop test system for a hydrogen engine controller according to claim 1, characterized in that, include: The signal reconstruction and excitation layer can automatically or manually switch between direct electrical signal injection mode and physical excitation injection mode to meet the requirements of controller algorithm verification and sensor signal link integrity verification, respectively.
6. The hardware-in-the-loop test system for a hydrogen engine controller according to claim 1, characterized in that, include: The input / output interface mapping module is used to map the cylinder pressure, temperature, and knock oscillation physical quantities output by the real-time simulation layer into standard analog electrical signals, and to map the ignition, hydrogen injection, and throttle drive signals output by the tested ECU into actuator parameters that the model can recognize.
7. The hardware-in-the-loop test system for a hydrogen engine controller according to claim 1, characterized in that, The pre-ignition random occurrence submodule includes: when the ECU performs ignition delay or torque limiting protection actions in the previous cycle, the submodule automatically reduces the probability of pre-ignition occurring in the current cycle.
8. A hardware-in-the-loop testing method for a hydrogen engine controller, characterized in that, Includes the following steps: Load test cases, start the hydrogen engine model and stabilize it to the target operating condition, and establish a communication connection with the ECU; Based on the engine's real-time operating conditions and Markov chain probability, the pre-ignition abnormal cylinder pressure curve and high-frequency knock signal are determined and generated. At a specified crankshaft angle position, an abnormal signal is injected into the ECU using either an electrical signal or a physical excitation method; Collect the control parameters and protection status parameters of the ECU, and complete the sampling and recording at a resolution no less than the preset crankshaft angle or preset time. The control parameters and protection status parameters include: ignition angle, torque limit, and protection flag parameters; Calculate the recognition delay, action amplitude, and recovery characteristic indicators, compare them with the threshold to determine whether the test case passes. If it passes, the parameters for the next round of testing are adaptively adjusted.
9. An electronic device, characterized in that, include: The processor, communication interface, memory, and communication bus are connected, with the processor, communication interface, and memory communicating with each other via the communication bus. The memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of the hardware-in-the-loop testing method for a hydrogen engine controller as described in claim 8.
10. A computer-readable storage medium, characterized in that, It stores a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of the hardware-in-the-loop test method for a hydrogen engine controller as described in claim 8.