Simulation test system and method for controlling HIL based on fuel cell
By constructing a joint Gaussian process model and accident perturbation model, the posterior distribution of perturbation variables is dynamically generated, which solves the problem of insufficient environmental reflection in the HIL simulation test of fuel cell controllers, and comprehensive stress testing and environmental coupling of control strategies are realized, which improves the diversity and coverage of tests.
Patent Information
- Application Number
- CN202510627627.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-08-15
AI Technical Summary
The existing HIL simulation test of fuel cell controllers is difficult to truly reflect the highly dynamic environment faced by the vehicle during actual operation, resulting in insufficient coverage of the simulation results on the actual operating conditions, affecting the representativeness of the test and the efficiency of discovering potential hidden dangers of the controller.
By constructing a joint Gaussian process model with vehicle position and simulation time as input and disturbance value as output, we use known observation data to train spatial and temporal kernel functions, and online regression updates are performed through the added sensing data of each round of simulation iteration, and dynamically generate the posterior distribution of disturbance variables, combining the accident disturbance model and environmental trajectory to realize multi-time and continuously changing disturbance input, enhancing the coupling between the test scenario and the actual road conditions.
It improves the diversity and coverage of test samples, can stress test the control strategy under different disturbance combinations, dynamically respond to spatiotemporal and spatial environment information, and ensures the comprehensiveness and effectiveness of simulation tests.
Smart Images

Figure CN120491602A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery simulation testing, and in particular to a simulation testing system and method based on fuel cell control HIL. Background Art
[0002] In existing fuel cell controller HIL simulation tests, the system often models the environment in which different subsystems are located as fixed or simplified statistical distributions. Although this can be used to construct preliminary scenario samples, it is difficult to truly reflect the highly dynamic environment faced by the vehicle during actual operation.
[0003] For example, when a vehicle enters a mountainous area from a city, or from day to night, the surrounding temperature, humidity, vibration, dust and other factors may change dramatically. Traditional modeling methods are difficult to capture these dynamic characteristics, resulting in insufficient coverage of actual operating conditions by simulation results, thereby reducing the representativeness of the test and the efficiency of discovering potential hidden dangers in the controller. Summary of the Invention
[0004] In response to the above-mentioned shortcomings of the existing technology, the present invention provides a simulation test system and method based on fuel cell control HIL, which can effectively solve the problem in the existing technology that the fuel cell controller HIL simulation test is difficult to truly reflect the highly dynamic environment faced during the actual operation of the vehicle, affecting the actual simulation test.
[0005] To achieve the above objectives, the present invention is implemented through the following technical solutions:
[0006] The present invention provides a simulation test method based on fuel cell control HIL, which at least includes:
[0007] Get the vehicle's subsystems and their locations;
[0008] Establish a daily working condition variable model, construct a spatiotemporal Gaussian process for the environmental variables at each location, calculate the posterior distribution, and jointly sample to generate environmental trajectories;
[0009] Establish accident disturbance model;
[0010] Construct an accident mapping table based on the daily operating condition variable model and the accident disturbance model;
[0011] Construct the LHS design matrix and inversely transform it into physical quantities, and construct the scenario vector under scenario j using the inversely transformed control parameters, environmental trajectories, accident indicator variables, and accident parameters;
[0012] Perform HIL simulation on each scenario vector in the t-th round scenario set, and update the test boundary in real time to obtain simulation diagnostic data and define the simulation result set;
[0013] Based on the simulation results, a frequency domain closed-loop model is constructed and H is calculated. ∞ Norm, calculate phase margin φ m,j , and the comprehensive score ρ is defined as j ;
[0014] The accident sensitivity is constructed based on the scenario vector and the comprehensive score, and the subsequent simulation test of the simulation controller is performed according to the accident sensitivity.
[0015] The method for constructing a spatiotemporal Gaussian process for the environmental variables at each location is:
[0016] Z i (b,t)~GP(m i (b,t),k i ((b,t), (b′,t′)))
[0017] Among them, b represents the current position of the vehicle, t represents the simulation time, and m i (b, t) represents the mean function of the historical observation data, k i ((b, t), (b′, t′)) represents the kernel function between any two points (b, t) and (b′, t′), Z i (b, t) represents an environmental disturbance experienced by subsystem i, and GP(·) represents a Gaussian process.
[0018] The method of joint sampling to generate environment trajectory is:
[0019] Compute the posterior distribution:
[0020]
[0021] Among them, (b n ,t n ,z n ) represents historical observation data, b n , t n 、z n Represents the location, time and environmental observation value of the nth record, Z i (b * ,t * ) represents the predicted environmental disturbance value, represents the posterior mean of the regression, represents the posterior variance of the regression, and N represents the number of observation samples used for Gaussian process regression;
[0022] Joint sampling generates environmental trajectories:
[0023]
[0024] in, represents the environmental value sampling corresponding to the kth time and space point, tk represents the kth time point, Indicates the position corresponding to the kth time step.
[0025] The accident disturbance model is specifically as follows:
[0026]
[0027] Among them, a crash (t) represents the time domain signal of the impact acceleration caused by the frontal / rearward collision, m eff represents the equivalent impact mass, v represents the relative velocity at the time of collision, A represents the collision contact area, represents the damping attenuation term, Δt represents the impact duration, F shear (t) represents the time domain signal of the tangential force generated by the side collision, R represents the force radius during the side collision, and θ represents the collision incident angle.
[0028] The method for updating the test boundary in real time is:
[0029] Input scene vector and boundary parameters
[0030] The environmental disturbance vector and the accident disturbance a crash (t) Injection subsystem dynamic model:
[0031]
[0032] Where x represents the system state vector, represents the state derivative vector, u represents the control input vector, which is composed of m command signals output by the fuel cell controller, f(·) represents the accident-free dynamics function, and gcrash(x) represents the accident input mapping matrix;
[0033] Perform a simulation run:
[0034] Assume running time T run With step size Δt s , at each moment t k =kΔt s Record simulation controller output y j [k](k=0,1,···,N s ),N s =T run / Δt s ;
[0035] Perform error calculation to get instantaneous error e j [k];
[0036] Based on the instantaneous error and its cumulative error E j[k] is the boundary parameter of the previous round renew.
[0037] The method for constructing the simulation result set is:
[0038] Establish simulation diagnostic data based on error sequence, loop crossing times, communication delay mean, and accident protection triggering times;
[0039] A simulation result set is established based on the simulation diagnostic data.
[0040] Building a frequency domain closed-loop model includes:
[0041] Perform short-time FFT on the instantaneous error and accident disturbance sequence, including selecting the window function, segment length L, performing fast Fourier transform on each segment, and obtaining the FFT of each segment;
[0042] Define the autopower spectrum;
[0043] Define the cross power spectrum;
[0044] Estimate the closed-loop transfer function.
[0045] The method for constructing accident sensitivity based on scenario vector and comprehensive score is:
[0046] Construct a perturbation scenario for each sensitive variable x, including temperature, humidity, dust concentration, speed, and contact area Increase x to Δx and perform the difference approximation:
[0047]
[0048] Among them, Δx represents the disturbance amplitude of the sensitive variable, ρ j (x) represents the comprehensive score calculated under the original scene vector, ρ j (x+Δx) represents the comprehensive score calculated in the perturbation scenario, S x,j represents the accident sensitivity of scenario j to sensitive variables;
[0049] Establish a sensitivity matrix based on accident sensitivity.
[0050] Compared with the prior art, the technical solution provided by the present invention has the following beneficial effects:
[0051] By considering disturbance factors closely related to the fuel cell control strategy, such as temperature, humidity, dust concentration, and light intensity, a joint Gaussian process model is constructed with vehicle position and simulation time as input and disturbance value as output. A time-space-dependent kernel function is trained using known observation data, and online regression updates are performed using newly added sensor data during each simulation iteration, dynamically generating the posterior distribution of the disturbance variable. The disturbance trajectory sampled from this distribution can be input into the control model in a multi-time, continuously changing manner, allowing the control strategy to be stress-tested under different disturbance combinations.
[0052] Secondly, by introducing a spatiotemporal-aware Gaussian process modeling framework into the original environment, the coupling between the test scenario and the actual road conditions is enhanced, enabling each round of HIL simulation scenarios to dynamically respond to spatiotemporal environmental information. At the same time, since each round of simulation is based on a dynamically updated posterior environmental prediction distribution, repeated sampling of certain invalid conditions is avoided, thereby improving the diversity and coverage of test samples. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. Those skilled in the art can also derive other drawings based on these drawings without inventive effort.
[0054] Figure 1 It is the overall module block diagram of the present invention. DETAILED DESCRIPTION
[0055] To make the purpose, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings 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 making any creative efforts shall fall within the scope of protection of the present invention.
[0056] With the rapid development of vehicles in the field of clean energy transportation, its core control unit - the fuel cell controller is responsible for managing multiple key functions such as hydrogen supply, air compression, cooling circuit, water management and power electronic output, which has a direct impact on the safety, stability and durability of the system.
[0057] Traditional fuel cell controller verification methods mainly rely on two methods:
[0058] 1) Bench test:
[0059] By building a real fuel cell stack, compressor, pump, heat exchanger, inverter and other complete machine test benches, operating condition testing and fault injection are carried out.
[0060] Disadvantages: Long debugging cycle; fault injection poses safety risks; it is difficult to quickly cover extreme and accident conditions.
[0061] 2) Software-in-the-loop simulation:
[0062] Run the control algorithm on a PC or general simulation platform to interact with the mathematical model of the fuel cell system.
[0063] Disadvantages: Unable to verify the true characteristics of the simulation controller hardware, such as timing performance, I / O compatibility, and electromagnetic compatibility (EMC); unable to truly evaluate the response to hardware failures.
[0064] To address these shortcomings, hardware-in-the-loop (HIL) testing is increasingly being adopted. This involves connecting real ECUs to high-speed real-time simulators. This approach preserves physical I / O, communication bus, and timing characteristics while safely and repeatably injecting various faults and extreme operating conditions into a virtual environment. However, existing HIL testing often focuses on a single operating condition (such as high and low temperatures, sudden load changes, or a specific type of fault), and environmental disturbances and accident scenarios are typically configured independently. There is a lack of a closed-loop testing mechanism that adaptively injects multi-dimensional environmental characteristics and multiple types of accident disturbances, and iteratively optimizes based on real-time feedback.
[0065] Single environmental disturbance: Mostly limited to a single dimension of temperature, humidity, or vibration, ignoring real driving conditions such as dust, water immersion, and light;
[0066] Accident scenes are sparse: accident scenes such as collisions and rollovers are often not set up or are only manually preset;
[0067] Rigid test boundaries: Lack of the ability to dynamically adjust test intensity based on simulation controller performance deviations;
[0068] Therefore, there is an urgent need for an HIL simulation test system that can jointly inject daily environment and multiple types of accident disturbances, dynamically adapt to test boundaries, and be based on online robustness / sensitivity evaluation and closed-loop learning, so as to comprehensively, efficiently and automatically verify the functional safety and robustness of the fuel cell controller under real driving and accident conditions.
[0069] The present invention will be further described below with reference to the embodiments.
[0070] Example 1 (see Figure 1 ): A simulation test method based on fuel cell control HIL, comprising the following steps:
[0071] S100, obtain the subsystem of the vehicle (fuel cell electric vehicle), including the fuel cell stack, air compressor, water management pump, heat exchanger / cooling system, inverter, the subsystem is the controlled target of the simulation controller, and determine the position L of the subsystem in the vehicle i For example, the fuel cell stack is in the center of the chassis, the air compressor is on the front cabin side, the water management pump is at the bottom of the front cabin, the heat exchanger / cooling system is in front of the cooling fan, and the inverter is on the inner wall of the rear cabin;
[0072] S200, for each position L i Establish a daily working condition variable model, including temperature, humidity, vibration, dust, and light (environmental variables), then:
[0073]
[0074] Among them, T i represents the temperature at a location, Ψ(·) represents the normal distribution, μ T i represents the mean, σ Ti represents the standard deviation, H i Indicates humidity, Representation interval The uniform distribution on Indicates the lower limit of humidity, Indicates the upper limit of humidity, V i (ω) represents the vibration power spectrum density function (PSD) of the position, ω represents the frequency, PSD Li (ω) represents the power spectrum curve obtained from the vehicle vibration test, D i Indicates the air dust concentration at a location, interval Determined according to the driving environment (city, suburbs, construction site, etc.), Respectively represent the lower and upper limits of air dust concentration, I i Indicates the light intensity at the location, interval Covering tunnels, day and night, sunny and rainy conditions, Respectively represent the lower and upper limits of light intensity, W i Indicates the flooding level of the location, interval [W i min ,W i max ] According to the water test standard (such as grade), W i min 、W i max Respectively represent the lower and upper limits of the flooding level.
[0075] Furthermore, the traditional static distribution cannot capture the time-varying and spatial correlation of the vehicle's environmental operating conditions at different road sections and times. Therefore, we introduce a position and time-space Gaussian process model to dynamically construct a realistic daily operating trajectory for each subsystem installation point. Before each simulation round, we update the posterior prediction distribution in real time through on-board observations and weather station observations, ensuring that the simulation environment closely matches real-world road operation. This results in:
[0076] Construct a spatiotemporal Gaussian process for the environmental variables at each location:
[0077] Zi(b,t)~GP(mi(b,t),ki((b,t),(b′,t′)))
[0078] Among them, b represents the current position of the vehicle, t represents the simulation time, and m i (b, t) represents the mean function of the historical observation data, k i ((b, t), (b′, t′)) represents the kernel function between any two points (b, t) and (b′, t′), Z i (b, t) represents a certain environmental disturbance experienced by subsystem i, GP(·) represents Gaussian process;
[0079] Compute the posterior distribution:
[0080]
[0081] Among them, (b n ,t n ,z n ) represents historical observation data, b n , t n 、z n Represents the location, time and environmental observation value of the nth record, Z i (b * ,t * ) represents the predicted environmental disturbance value, represents the posterior mean of the regression, describing the expected value of the prediction based on the existing observations, Represents the posterior variance of the regression, describing the uncertainty of the prediction, and N represents the number of observation samples used for Gaussian process regression;
[0082] Then, the joint sampling generates the environment trajectory:
[0083]
[0084] in, represents the environmental value sampling corresponding to the kth time and space point, t k represents the kth time point, Indicates the position corresponding to the kth time step.
[0085] Define the accident disturbance model, specify the acceleration or force pulse input for different collision types, and simulate the transient impact of the impact on each subsystem. Then we have:
[0086]
[0087] Among them, a crash (t) represents the time domain signal of the impact acceleration caused by the front / rear collision (front refers to the front of the vehicle, rear refers to the rear collision), m eff It represents the equivalent impact mass, which can be the total mass of the vehicle or the local equivalent mass of the impacted part, v represents the relative speed at the time of collision, A represents the collision contact area, represents the damping attenuation term, Δt represents the impact duration, F shear (t) represents the time domain signal of the tangential force generated by the side collision, R represents the force radius or the equivalent parameter of the moment of inertia during the side collision, and θ represents the collision incident angle, which determines the direction of the tangential force;
[0088] Combine the daily operating condition variable model with the accident disturbance model to construct the accident mapping table M={(L i ,T i ,H i ,V i (ω),D i ,I i ,W i ),(a crash ,F shear )}, used to generate each round of HIL simulation test scenarios.
[0089] It is worth noting that the above considerations take into account the differences in the environments in which the subsystems are located in the entire vehicle, and introduce a method of mapping the physical installation positions of the subsystems (such as the fuel cell stack in the center of the chassis, the air compressor on the front cabin side, etc.), so that each subsystem is matched with its actual installation point, so that the corresponding environmental variable distribution and accident disturbance model can be determined for different positions respectively, solving the problems of generalization of environmental models in simulation and difficulty of test conditions in reflecting the actual scenarios in which components are located.
[0090] S300, input the accident mapping table M, control parameter space {p k}、Probability of accident injection p crash ,Number of scenes N0;
[0091] Construct the LHS (Latin Hypercube) design matrix:
[0092] Let the total dimension d = |{p k}+6|{i}|+3, {i} represents the number of subsystems, 3 represents the accident parameter, v, θ, A, according to the weight Assign N0 intervals to each dimension (N0 represents the total number of scenes), and randomly scatter the samples in each interval to form an N0×d weighted Latin hypercube sample matrix Ξ;
[0093] Inverse transformation to physical quantity:
[0094] For the jth row and lth column j,l :
[0095] If the corresponding variable is normal T i ,but:
[0096] T i (j) =μT i +σT i Φ -1 (Ξ j,l )
[0097] Among them, Φ -1 represents the standard normal quantile function, represents the temperature of the i-th subsystem in scene j;
[0098] If it is a uniform distribution, then:
[0099] X (j) =a+(ba)Ξ j,l
[0100] Among them, X (j) represents the value of the environmental variable X in the jth scenario, such as temperature and humidity. a represents the lower limit of the environmental variable, and b represents the upper limit of the environmental variable.
[0101] If the vibration V i (ω), then Ξ j,l Mapped to the power spectrum curve in the corresponding frequency domain, it is pre-discretized and selected point by point and recorded as V i (j) (ω);
[0102] Execute accident injection judgment:
[0103]
[0104] Among them, U(0,1) represents a standard uniform random number, δ j is the accident indicator variable. If it is 1, the accident parameters are extracted from the accident distribution:
[0105] v (j) ~U[v min ,v max ],θ (j) ~U[0,2π],A (j w~U[A min ,Amax ]
[0106] Among them, v (j) represents the velocity when the collision occurs in the jth scene, v min 、v max Respectively represent the lower and upper limits of the speed, θ (j) represents the collision incident angle in the jth scene, A (j) Represents the collision contact area in the jth scene, A min 、A max Respectively represent the lower and upper limits of the accident contact area;
[0107] Thus, all the inverse transformed control parameters, environmental trajectories, accident indicator variables and accident parameters are constructed into the scenario vector under scenario j. in, represents the value of the kth control parameter in the jth scenario, k∈{1,···,m}, corresponding to different control inputs (such as hydrogen flow, current density, etc.), m represents the number of control parameters, δ j represents the accident indicator variable;
[0108] Then, the corresponding initial scene set can be output
[0109] S400: Further, for the t-th round scenario set S t Each scene vector in Perform HIL simulations and update test boundaries in real time, including:
[0110] Input scene vector and boundary parameters (represents the boundary parameters used in the tth round of iteration, defining the upper and lower limits of the control parameters that can be driven during simulation. In the 0th round, that is, t is 0, each Set to the loosest range physically allowed, for example, between the maximum and minimum values);
[0111] The environmental disturbance vector e=(T i ,H i ,D i ,I i ,W i ) and accident disturbance a crash (t) Injection subsystem dynamic model:
[0112]
[0113] Where x represents the system state vector, which is composed of the internal state of the simulated subsystem, such as pressure, stack temperature, membrane humidity, pump speed, etc., with a total of n components. represents the state derivative vector, which describes the instantaneous rate of change of the system state over time; u represents the control input vector, which is composed of m command signals output by the fuel cell controller (such as valve opening, pump current setting, compressor speed command, etc.); e represents the environmental disturbance vector, which includes all the environmental variable values in this scenario; f(·) represents the accident-free dynamic function; and gcrash(x) represents the accident input mapping matrix;
[0114] Perform a simulation run:
[0115] Assume running time T run With step size Δt s , at each moment t k =kΔt s Record simulation controller output y j [k](k=0,1,···,N s ),N s =T run / Δt s , thus, the simulation controller and subsystem models can be simulated on the HIL platform according to the scenario vector A fixed run time is executed to obtain sufficient dynamic response data. By recording the output signals of the simulated controller, raw measurements are provided for subsequent error calculation, robustness analysis, and boundary updates.
[0116] Perform error calculation:
[0117] e j [k]=y j [k]-y safe (k)
[0118] Among them, e j [k] represents the instantaneous error, y j [k] represents the output signal vector of the simulation controller at the kth sampling moment under scenario j, such as valve command, current setting, etc. safe (k) represents the reference output curve at the kth sampling moment, describing the expected output under the safety margin;
[0119] Based on the instantaneous error and its cumulative error E j [k] is the boundary parameter of the previous round renew:
[0120]
[0121] Among them, α k Represents the proportional coefficient, describing the response gain of the instantaneous error, β k Indicates the integral coefficient, which describes the response gain of the cumulative error and is used to correct long-term deviations. j [k] represents the cumulative error to the kth point in scene j, represents the kth boundary parameter after update, which is used for t+1 rounds of testing. clip(·) represents the truncation function, which describes how to limit the updated value to the upper and lower limits allowed by the design to prevent the value from overflowing or crossing the boundary. Therefore, the convenient parameter is dynamically adjusted according to the instantaneous error and cumulative error. Push subsequent scenarios toward more extreme conditions to quickly identify shortcomings in the simulation controller;
[0122] Thus, the simulation diagnostic data of this round is obtained ej[·] represents the error sequence, which reflects the tracking accuracy and deviation of the simulation controller in the current scenario. The number of loop overshoots refers to the number of times in HIL real-time simulation when the model calculation or I / O response time exceeds a single cycle Δt s When an error occurs, it is judged as a loop violation, which is used to evaluate the timing adaptability of the simulation platform and the simulation controller hardware. The pass delay statistics refer to the delay between the simulation controller sending commands to the simulator (real-time simulation hardware / software environment on the HIL platform) through interfaces such as CAN / CPI / analog I / O and receiving feedback. It is the average delay and measures the communication performance and stability between the simulation controller and the simulation model. The number of accident protection triggers refers to the actual number of triggers of the internal safety protection mechanism of the simulation controller (such as soft stop, hard stop, bypass switching, etc.) when an accident disturbance is injected, reflecting the safety protection logic coverage capability of the simulation controller under extreme impact.
[0123] Furthermore, the tth round of simulation is completed and the simulation result set R is obtained. t :
[0124] To quantify the stability (robustness) of the simulation controller in the current scenario and its sensitivity to various disturbance dimensions.
[0125] S500, conduct accident sensitivity assessment:
[0126] S510, construct a frequency domain closed-loop model, then:
[0127] For instantaneous error and accident disturbance sequence d j [k]=a crash (t k ),t k =kΔt s , a crash (t k ) indicates that k The instantaneous value of the accident impact acceleration corresponding to each simulation sampling moment is then subjected to a short-time FFT (Fast Fourier Transform). Specifically, a window function is selected, a segment length of L is used, and 50% overlap is used to make segments. A Fast Fourier Transform is performed on each segment to obtain the FFT of each segment:
[0128] El (ω n )=F{e j [k]} l ,D l (ω n )=F{d j [k]} l ,l=1,···,M
[0129] Among them, E l (ω n ), D l (ω n ) represent the frequency domain values of the instantaneous error and the accident disturbance sequence after transformation, M represents the number of segments, ω n represents the nth discrete frequency, F{·} l represents fast Fourier transform;
[0130] Defining the Autopower Spectrum * indicates complex conjugate;
[0131] Defining the cross power spectrum
[0132] To estimate the closed-loop transfer function
[0133] S520, calculate H ∞ Norm:
[0134]
[0135] Among them, ||G j ||H ∞ represents the maximum closed-loop gain of the jth scenario;
[0136] S530, calculate phase margin φ m,j :
[0137] φ m,j =180°+arg(G j (e jωc,j ))
[0138] Here, arg(·) represents the complex phase function. Through frequency domain analysis, the closed-loop stability and interference rejection of the simulation controller in the current scenario are quantified, providing a basis for subsequent scoring.
[0139] S540, calculate comprehensive score ρ j :
[0140]
[0141] Among them, ω1, ω2, ω3, ω4, and ω5 represent the corresponding weight coefficients, N overrunIndicates the number of loops. represents the mean communication delay, N prot Indicates the number of times the accident protection is triggered;
[0142] S550: Thus, the accident sensitivity is constructed based on the scenario vector and the comprehensive score:
[0143] Construct a perturbation scenario for each sensitive variable x (including temperature, humidity, dust concentration, speed, contact area) Increase x to Δx and calculate ρ based on S510-S540 j (x+Δx), and then perform the difference approximation:
[0144]
[0145] Among them, Δx represents the disturbance amplitude of the sensitive variable, which is preset to 1%-5%, and ρ j (x) represents the comprehensive score calculated under the original scene vector, ρ j (x+Δx) represents the perturbation scenario The composite score calculated below, S x,j represents the accident sensitivity of scenario j to sensitive variables, and then, according to all scenarios j = 1,···,|S t | and all sensitive variables form a sensitivity matrix {S x,j}.
[0146] It is worth noting that the instantaneous error sequence and the discretized accident pulse are used as inputs, and the closed-loop transfer function of each scenario is constructed through short-time FFT and power spectrum estimation, and H is extracted from it. ∞ The system then uses the norm (which measures the system's maximum amplification factor for the worst-case frequency disturbance) and phase margin (which assesses the system's tolerance for delay or phase disturbances). A comprehensive score is then constructed by combining timing diagnostic data such as the number of loop crossings, average communication delay, and the number of accident protection triggers, enabling comparable and rankable risk assessments across different scenarios.
[0147] Finally, a small disturbance is applied to each sensitive variable (temperature, humidity, vibration, dust) and accident parameter (collision speed, contact area), the score is recalculated and the difference is taken to quantify the accident sensitivity and clarify which dimensions have the most significant risk increase. This solves the problem of difficulty in judging frequency domain robustness and phase margin by relying solely on time domain errors, and ensures that subsequent test resources are concentrated on environments and accident conditions that can output simulated controller weaknesses, thereby improving the actual fit of the test.
[0148] The present invention also provides a simulation test system based on fuel cell control HIL, which is implemented according to the above method;
[0149] A computer-readable storage medium stores a computer program thereon. When the computer program is executed by a processor, the steps of the method described are implemented, which will not be described in detail here.
[0150] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements will not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A simulation test method based on fuel cell control HIL, characterized in that: The steps include: Get the vehicle's subsystems and their locations; Establish a daily working condition variable model, construct a spatiotemporal Gaussian process for the environmental variables at each location, calculate the posterior distribution, and jointly sample to generate environmental trajectories; Establish accident disturbance model; Construct an accident mapping table based on the daily operating condition variable model and the accident disturbance model; Construct the LHS design matrix and inversely transform it into physical quantities, and construct the scenario vector under scenario j using the inversely transformed control parameters, environmental trajectories, accident indicator variables, and accident parameters; Perform HIL simulation on each scenario vector in the t-th round scenario set, and update the test boundary in real time to obtain simulation diagnostic data and define the simulation result set; Based on the simulation results, a frequency domain closed-loop model is constructed and H is calculated. ∞ Norm, calculate phase margin φ m,j , and the comprehensive score ρ is defined as j ; The accident sensitivity is constructed based on the scenario vector and the comprehensive score, and the subsequent simulation test of the simulation controller is performed according to the accident sensitivity.
2. A simulation test method based on fuel cell control HIL according to claim 1, characterized in that: The method for constructing a spatiotemporal Gaussian process for the environmental variables at each location is: Z i (b,t)~GP(m i (b,t),k i ((b,t),(b′,t′))) Among them, b represents the current position of the vehicle, t represents the simulation time, and m i (b, t) represents the mean function of the historical observation data, k i ((b, t), (b′, t′)) represents the kernel function between any two points (b, t) and (b′, t′), Z i (b, t) represents an environmental disturbance experienced by subsystem i, and GP(·) represents a Gaussian process.
3. A simulation test method based on fuel cell control HIL according to claim 2, characterized in that: The method of generating environment trajectory by joint sampling is: Compute the posterior distribution: Among them, (b n ,t n ,z n ) represents historical observation data, b n , t n 、z n Represents the location, time and environmental observation value of the nth record, Z i (b * ,t * ) represents the predicted environmental disturbance value, represents the posterior mean of the regression, represents the posterior variance of the regression, and N represents the number of observation samples used for Gaussian process regression; Joint sampling generates environmental trajectories: in, represents the environmental value sampling corresponding to the kth time and space point, t k represents the kth time point, Indicates the position corresponding to the kth time step.
4. The simulation test method based on fuel cell control HIL according to claim 1, characterized in that: The accident disturbance model is specifically: Among them, a crash (t) represents the time domain signal of the impact acceleration caused by the frontal / rearward collision, m eff represents the equivalent impact mass, v represents the relative velocity at the time of collision, A represents the collision contact area, represents the damping attenuation term, Δt represents the impact duration, F shear (t) represents the time domain signal of the tangential force generated by the side collision, R represents the force radius during the side collision, and θ represents the collision incident angle.
5. A simulation test method based on fuel cell control HIL according to claim 4, characterized in that: The method for updating the test boundary in real time is: Input scene vector and boundary parameters The environmental disturbance vector and the accident disturbance a crash (t) Injection subsystem dynamic model: Where x represents the system state vector, represents the state derivative vector, u represents the control input vector, which is composed of m command signals output by the fuel cell controller, f(·) represents the accident-free dynamics function, and gcrash(x) represents the accident input mapping matrix; Perform a simulation run: Assume running time T run With step size Δt s , at each moment t k =kΔt s Record simulation controller output y j [k](k=0,1,···,N s ),N s =T run / Δt s ; Perform error calculation to get instantaneous error e j [k]; Based on the instantaneous error and its cumulative error E j [k] is the boundary parameter of the previous round renew.
6. The simulation test method based on fuel cell control HIL according to claim 1, characterized in that: The method for constructing the simulation result set is: Establish simulation diagnostic data based on error sequence, loop crossing times, communication delay mean, and accident protection triggering times; A simulation result set is established based on the simulation diagnostic data.
7. A simulation test method based on fuel cell control HIL according to claim 6, characterized in that: The constructing of the frequency domain closed-loop model includes: Perform short-time FFT on the instantaneous error and accident disturbance sequence to obtain the FFT of each segment; Define the autopower spectrum; Define the cross power spectrum; Estimate the closed-loop transfer function.
8. The simulation test method based on fuel cell control HIL according to claim 7, characterized in that: The method for constructing accident sensitivity based on scenario vectors and comprehensive scores is as follows: Construct a perturbation scenario for each sensitive variable x, including temperature, humidity, dust concentration, speed, and contact area Increase x to Δx and perform the difference approximation: Among them, Δx represents the disturbance amplitude of the sensitive variable, ρ j (x) represents the comprehensive score calculated under the original scene vector, ρ j (x+Δx) represents the comprehensive score calculated in the perturbation scenario, S x,j represents the accident sensitivity of scenario j to sensitive variables.
9. A simulation test system based on fuel cell control HIL, characterized in that: This is achieved by the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.