A deterministic timing interface method and system for power hardware-in-the-loop testing
By introducing a unified time reference and data age determination mechanism into the power hardware-in-the-loop test system, the problem of port data time misalignment caused by interface delay fluctuations is solved, and the repeatability and consistency of test results are achieved, adapting to devices under test with different dynamic characteristics.
Patent Information
- Application Number
- CN202611668181.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-27
- Publication Date
- 2026-11-24
AI Technical Summary
In existing power hardware-in-the-loop testing systems, interface latency fluctuations cause port data time misalignment, making it difficult to guarantee the consistency and reproducibility of test conditions, especially in fast dynamic scenarios where test results are discrete.
A unified time reference mechanism is adopted, which divides the data into three categories: directly valid, reconfigurable, and time invalid by using the source time, target time, and time validity information of the port data. Port status time mapping and target time caching are implemented to ensure that the actual execution time of the port output command is not affected by communication latency.
It improves the repeatability and consistency of PHIL test results, reduces the impact of port status reproduction accuracy, and adapts to devices under test and test scenarios with different dynamic characteristics.
Smart Images

Figure CN123158944A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of real-time simulation of power systems and power hardware-in-the-loop testing, and particularly relates to a deterministic timing interface method and system for power hardware-in-the-loop testing. Background Technology
[0002] Power Hardware-in-the-Loop (PHIL) technology is a closed-loop testing technique developed based on real-time digital simulation and hardware-in-the-loop technology. It simulates the operating conditions of the power grid or external system through a real-time simulation device, converts the simulation reference quantity into actual power output via a power interface, and simultaneously collects the port responses of the device under test (DUT) and feeds them back to the simulation system, constructing a closed-loop test environment in which the digital model and the actual power device participate together. With the rapid development of new energy power generation, energy storage converters, and grid-connected power electronic equipment, the demand for equipment performance testing, fault ride-through verification, and dynamic characteristic calibration continues to grow. The real-time simulation step size of PHIL systems is constantly shortening, and interface communication is gradually adopting high-speed industrial networks. Interface latency and its impact on test accuracy and closed-loop stability are gradually becoming key factors restricting PHIL testing capabilities.
[0003] Existing research on PHIL interfaces mainly focuses on two directions: one is interface delay compensation technology, which typically employs phase compensation, prediction compensation, Smith prediction, model prediction, and other methods to reduce the impact of fixed communication delay on closed-loop dynamic characteristics; the other is high-precision time synchronization technology, which uses solutions such as PTP, TSN, and distributed clocks to enable real-time simulators, power interfaces, and acquisition devices to obtain a high-precision unified clock reference. Some PHIL systems also improve time consistency among multiple devices through timestamp marking, data buffer scheduling, and periodic synchronization.
[0004] However, existing technologies typically treat clock synchronization, communication delay compensation, and power interface execution as relatively independent issues. Even if the clocks of all nodes in the system are synchronized, the port data sampling time, message communication arrival time, real-time simulation calculation time, and the actual execution time of the power interface cannot be naturally aligned. When there are random delay fluctuations in the interface, phenomena such as the use of outdated data across cycles, the combination of data from different physical times in calculations, and the communication arrival time directly determining the power execution time are also prone to occur. For the test object with a short dynamic time scale, the above-mentioned time misalignment is more likely to be transformed into port waveform errors and test result discrepancies. Especially in fast dynamic test scenarios such as fault ride-through, voltage disturbances, and phase angle jumps, the actual application time of the test event is affected by communication delay, making it difficult to guarantee the consistency and reproducibility of test conditions.
[0005] Therefore, this field is gradually evolving from simply focusing on average interface latency to defining data time semantics, determining data timeliness, deterministic scheduling, and executing at target times under a unified time benchmark. However, a systematic interface solution that transforms a unified time benchmark into port data time semantics, timeliness determination, state reconstruction, and deterministic execution has not yet been developed. Summary of the Invention
[0006] The purpose of this invention is to address the problems raised in the background section by providing a deterministic timing interface method and system for power hardware-in-the-loop testing.
[0007] To achieve the above objectives, the present invention adopts the following technical solution: a deterministic timing interface method for power hardware-in-the-loop testing, comprising the following steps:
[0008] A unified time base is established based on the real-time simulation step size of the power hardware-in-the-loop system, and the port data transmitted between the real-time simulation device, the power interface device and the device under test are associated with the unified time base.
[0009] Configure source time information and time validity information for the port feedback data generated by the device under test. The source time information is used to characterize the physical state generation time corresponding to the port feedback data. The time validity information includes the direct use time range, the reconfigurable time range, and the failure time range.
[0010] Configure target execution time information for the port output commands generated by the real-time simulation device. The target execution time information is used to characterize the physical moment when the port output commands are scheduled to act on the power interface device.
[0011] The data age of the port feedback data is determined based on the time difference between the source time information of the port feedback data and the target processing time. Based on the time validity information, the port feedback data is divided into directly valid data, reconfigurable data, and time-failed data. The target processing time is the time corresponding to the simulation cycle in which the real-time simulation device performs model calculations on the port feedback data.
[0012] For directly valid data, it is allowed to directly participate in the model calculation of the corresponding real-time simulation cycle; for reconfigurable data, port state time mapping is implemented based on the time difference between its source time information and the target processing time to obtain the estimated port state value corresponding to the target processing time; for time-failed data, it is prohibited from directly participating in the current real-time simulation calculation.
[0013] Based on the port status or estimated port status corresponding to the target processing time, a port output instruction is generated and written into the execution cache corresponding to the target execution time information.
[0014] The power interface device is based on a unified time base and executes port output commands when the physical time corresponding to the target execution time information is reached, so that the actual execution time of the port output command is not directly determined by its communication arrival time.
[0015] Furthermore, port data is represented using a unified temporal semantic data structure, which includes:
[0016] The Value field represents the port measurement value, model calculation value, control command value, or event command value.
[0017] The SourceTime field indicates the time when the physical state corresponding to the data was generated; for feedback measurement data, it is the actual sampling time, and for simulation-generated data, it is the simulation state time on which the data is based.
[0018] The TargetTime field indicates the target time when the data is scheduled to participate in real-time calculations or actually be applied to the power port;
[0019] The ValidityInformation field indicates the time constraints that allow data to be used directly, undergo state restructuring, or be deemed invalid.
[0020] The Type field indicates the data type, which determines the specific time semantics and processing method of each time field.
[0021] For data types that do not require a target execution time, the TargetTime field is set to a predefined invalid value, a reserved value, or identified by the data type as not participating in the current data processing.
[0022] Furthermore, the time range, reconfigurable time range, and failure time range are directly used to pass the first time threshold. Second time threshold Defined and satisfying The age of the data returned by the port is recorded as ,but:
[0023] when When the port feedback data falls within the direct usage time range, it is determined to be directly valid data;
[0024] when When the port feedback data is within the reconfigurable time range, it is determined to be reconfigurable data;
[0025] when If the port feedback data falls within the invalidation time range, it is determined to be time-invalidated data.
[0026] Furthermore, the first time threshold and the second time threshold are determined based on at least one of the following parameters:
[0027] Real-time simulation step size, electromagnetic dynamic time scale of the device under test, control bandwidth of the device under test, resonant frequency of the device under test, key mode frequencies of the device under test, and target test frequency band.
[0028] Furthermore, for reconfigurable data, based on the time difference between its source time information and the target processing time, and combined with at least one of the following: historical port data values, port input quantities, dynamic parameters of the measured object, or state model, port state time mapping is implemented to obtain the estimated port state value corresponding to the target processing time.
[0029] The port state estimates satisfy the following relationship:
[0030] ;
[0031] in, Indicates the time of target processing; Indicates the source time of the port feedback data; Indicates the source time Port status; This represents the time difference between the source time and the target processing time of the port feedback data. ; This indicates the available historical port data; Indicates the available input or stimulus quantity; Indicates the parameters of the object or interface model being tested; This represents the state-time mapping or reconstruction relationship;
[0032] The state-time mapping adopts at least one of the following methods: state extrapolation based on the rate of change of state, interpolation or extrapolation based on multiple historical samples, state propagation based on discrete state space model, state prediction based on parametric model, and state estimation based on state observer.
[0033] When using first-order state extrapolation, the rate of state change is calculated based on the source time information of the data from adjacent ports, rather than based on the communication arrival time.
[0034] Furthermore, the time validity information of the port output command includes the latest valid arrival period for which the port output command is allowed to enter the execution buffer. The latest valid arrival period is:
[0035] ;
[0036] in, The target execution cycle for the port output command. The number of reserved cycles required for the power interface to complete buffer updates and prepare for output;
[0037] When the port output command arrives no later than the latest valid arrival cycle, it is written to the target execution cycle. The corresponding cache to be executed, and in the periodic implement;
[0038] When a port output command arrives later than the latest valid arrival period, it is judged as a time-expired command and is prohibited from being executed immediately according to the communication arrival time.
[0039] Furthermore, for data out-of-order issues caused by changes in communication latency, the determination is made based on the SourceTime field, TargetTime field, or data sequence number;
[0040] When the SourceTime of newly arrived data is earlier than the SourceTime of already used data, the newly arrived data is prohibited from overwriting the update state that has already entered the calculation process.
[0041] Furthermore, for time-expired data, at least one of the following methods is used for processing: discarding, maintaining the previous valid state, using a spare state value, or marking an anomaly.
[0042] A deterministic timing interface system for power hardware-in-the-loop testing, comprising:
[0043] The unified time reference module is used to establish a unified time reference between the real-time simulation device, the power interface device, and the device under test.
[0044] The time semantic generation module is used to configure source time information and time validity information for port feedback data, and to configure target execution time information for port output instructions.
[0045] The time validity determination module is used to determine whether the data returned by the port is directly valid, reconstructable, or time-expired based on its age.
[0046] The state-time reconstruction module is used to map the port state to the target processing time based on the time difference between the source time information of the reconstructable data and the target processing time, so as to obtain the estimated port state value at the target time.
[0047] The real-time simulation module is used to generate port output commands based on direct valid data or the reconstructed target time port status.
[0048] The pending execution cache module is used to store port output instructions according to the target execution time corresponding to the port output instructions;
[0049] The deterministic execution module is used to apply the corresponding port output command to the power interface device when the target execution time is reached on the unified time base.
[0050] Furthermore, the time validity determination module determines the direct usable time range and reconfigurable time range of the port feedback data based on at least one of the following: real-time simulation step size, electromagnetic dynamic time scale of the device under test, control bandwidth, resonant frequency, key mode frequency, or target test frequency band.
[0051] Compared with traditional arrival-driven PHIL interfaces, the present invention has at least the following advantages:
[0052] 1. Distinguish between the numerical correctness of port data and the validity of physical time. By using a unified time semantic data structure, the data is given clear source time, target time, and time validity information. This prevents data that is numerically correct but outdated from directly entering the current PHIL closed-loop calculation, thus avoiding interference from outdated port status on simulation accuracy.
[0053] 2. A three-level time validity determination mechanism of direct validity, reconfigurability, and time expiration is adopted to make port data of different ages correspond to different processing strategies. While ensuring the timeliness of real-time calculation, the effective utilization range of port data is fully expanded, taking into account both test accuracy and data utilization efficiency.
[0054] 3. By using the target execution time and pending execution caching mechanism, communication latency fluctuations within the allowable range are absorbed by caching and time margin, without directly changing the actual execution time of the power port, suppressing the conversion of random communication latency into port execution jitter, and improving the repeatability and consistency of PHIL test results.
[0055] 4. By reconstructing the port state time-mapping, the phase offset and amplitude error of the port state caused by the fixed data age can be compensated, reducing the impact of time delay on the accuracy of port state reproduction.
[0056] 5. The effective time range can be determined based on at least one of the following: real-time simulation step size, dynamic time scale of the test object, control bandwidth, key modal frequency, or target test frequency band, so that the fast dynamic test object can be subject to more stringent time validity constraints, and adapt to test devices and test scenarios with different dynamic characteristics. Attached Figure Description
[0057] Figure 1 This is a flowchart of the deterministic timing interface method of the present invention;
[0058] Figure 2 This is a flowchart of the three-level time validity determination process of the present invention.
[0059] Figure 3 This is a schematic diagram illustrating the mapping of port states from the source time to the target time.
[0060] Figure 4 This is the minimum PHIL closed-loop simulation model.
[0061] Figure 5 This is a comparison diagram of port current waveforms for random timing and deterministic timing.
[0062] Figure 6 This is a comparison chart of current errors between random and deterministic timing sequences.
[0063] Figure 7 This is a comparison diagram of port voltage waveforms for random timing and deterministic timing.
[0064] Figure 8 This is a comparison chart of voltage errors between random and deterministic timing sequences. Detailed Implementation
[0065] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings. It should be understood that the following embodiments are only used to illustrate the technical concept and possible implementation of the present invention, and are not intended to limit the scope of protection of the present invention.
[0066] In this invention, "deterministic timing interface" refers to an interface technology that uses a unified time base to assign explicit source time, target time, and time validity semantics to port data, and decouples the actual execution time of the power port from the arrival time of the communication message through data age classification, port state time reconstruction, and target time caching execution mechanism.
[0067] like Figure 1 As shown, a deterministic timing interface method for power hardware-in-the-loop testing includes the following steps:
[0068] S1. Establish a unified time reference based on the real-time simulation step size of the power hardware-in-the-loop system, and associate the port data transmitted between the real-time simulation device, the power interface device, and the device under test with the unified time reference.
[0069] Specifically, the unified time base is established based on the real-time simulation step size of the PHIL system. The real-time simulation device, power interface device, and device under test all operate synchronously with this unified time base as a reference. All port data transmitted within the system is mapped to the same time coordinate system. The port data is encapsulated using a unified time semantic data structure, which includes the following fields: Value, SourceTime, TargetTime, ValidityInformation, and Type.
[0070] The Value field represents the port measurement value, model calculation value, control command value, or event command value.
[0071] The SourceTime field indicates the time when the physical state corresponding to the data was generated; for feedback measurement data, it is the actual sampling time, and for simulation-generated data, it is the simulation state time on which the data is based.
[0072] The TargetTime field indicates the target time when the data is scheduled to participate in real-time calculations or actually be applied to the power port;
[0073] The ValidityInformation field indicates the time constraints that allow data to be used directly, undergo state restructuring, or be deemed invalid.
[0074] The Type field indicates the data type, which determines the specific time semantics and processing method of each time field.
[0075] For data types that do not require a target execution time, the TargetTime field is set to a pre-defined invalid value, a reserved value, or identified by the data type as not participating in current data processing. Reserved values are identifiers reserved for future expansion or to represent null semantics, and do not represent a valid target execution time. This unified time semantics belongs to a logical data structure; physical communication messages can be implemented using fixed-length encoding or fixed-length encoding based on message type. This invention does not limit the message byte length or the underlying communication protocol.
[0076] The port feedback data output by the device under test, after being encapsulated using time semantics, is represented as follows:
[0077] ;
[0078] In the formula, This represents the port feedback quantity of the device under test, corresponding to the Value field. The SourceTime field represents the actual sampling time of the feedback quantity. This is a marker value for processing without a preset target time, corresponding to the TargetTime field; This is for time validity information; This serves as a data type identifier, corresponding to the Type field.
[0079] The port output commands generated by the real-time simulation device, after being encapsulated using time semantics, are represented as follows:
[0080] ;
[0081] In the formula, This is a port voltage reference instruction, corresponding to the Value field; Generate the corresponding model state time for the instruction, corresponding to the SourceTime field; The TargetTime field represents the target execution time at which the instruction is applied to the power port. This is for time validity information; This serves as a data type identifier, corresponding to the Type field.
[0082] S2. Configure source time information and time validity information for the port feedback data generated by the device under test. The source time information is used to characterize the physical state generation time corresponding to the port feedback data. The time validity information includes the direct use time range, the reconfigurable time range, and the failure time range.
[0083] Specifically, the port feedback data output by the device under test is configured with source time information, which corresponds to the actual sampling time of the feedback data, i.e., the actual generation time of the physical state of the port of the device under test.
[0084] Time validity information includes the direct use time range, the reconfigurable time range, and the failure time range, which are used to define the effective use boundaries of feedback data and distinguish the time conditions under which data can be used directly, reconfigurable, or fail.
[0085] S3. Configure target execution time information for the port output commands generated by the real-time simulation device. The target execution time information is used to characterize the physical moment when the port output commands are scheduled to act on the power interface device.
[0086] Specifically, the port output command generated by the real-time simulation device is configured with target execution time information, which represents the physical moment when the port output command is scheduled to act on the power interface device.
[0087] S4. Determine the data age of the port feedback data based on the time difference between the source time information of the port feedback data and the target processing time, and divide the port feedback data into directly valid data, reconfigurable data and time-failed data according to the time validity information. The target processing time is the time corresponding to the simulation cycle in which the real-time simulation device performs model calculations on the port feedback data.
[0088] Specifically, let the source time of the port feedback data be... The target processing time is The data age of the port feedback data Satisfying the relation Target processing time This refers to the moment in the simulation cycle corresponding to the real-time simulation device performing model calculations on the port feedback data.
[0089] Directly using the time range, reconfigurable time range, and failure time range through the first time threshold Second time threshold Defined and satisfying .
[0090] like Figure 2 As shown, based on the data age The port feedback data is divided into three categories:
[0091] when When the port feedback data is within the direct usage time range, it is determined to be directly valid data;
[0092] when When the port feedback data is within the reconfigurable time range, it is determined to be reconfigurable data;
[0093] when When the port feedback data falls within the failure time range, it is determined to be time-failed data.
[0094] The first and second time thresholds are determined based on at least one of the following parameters: real-time simulation step size, electromagnetic dynamic timescale of the device under test, control bandwidth of the device under test, resonant frequency of the device under test, key mode frequency of the device under test, and target test frequency band.
[0095] For equivalent resistance Equivalent inductance The measured object has a dynamic time scale of:
[0096] ;
[0097] When the object being tested is In scenarios with inductive loads, the dynamic time constant The smaller the value, the shorter the direct use time range and the reconfigurable time range, reducing the test error caused by using outdated data for rapidly dynamic test objects; for other types of test devices, the corresponding feature time scale can be selected according to their dynamic characteristics.
[0098] For time-expired data, it is processed by at least one of the following methods: discarding, maintaining the previous valid state, using a spare state value, or marking an anomaly.
[0099] To address the out-of-order data phenomenon caused by communication latency fluctuations, the system identifies out-of-order packets based on the SourceTime field, TargetTime field, or data sequence number. When the SourceTime of newly arrived data is earlier than the SourceTime of old data that has already been put into computation, the newly arrived data is prohibited from overwriting the update state that has already entered the computation process.
[0100] S5. For directly valid data, it is allowed to directly participate in the model calculation of the corresponding real-time simulation cycle; for reconfigurable data, port state time mapping is implemented according to the time difference between its source time information and the target processing time to obtain the estimated port state value corresponding to the target processing time; for time-failed data, it is prohibited to directly participate in the current real-time simulation calculation.
[0101] Specifically, the age of directly valid data is within the direct usage time range, and the timeliness meets the requirements of real-time calculation, so it can be directly input into the real-time simulation model for calculation.
[0102] The data age of reconfigurable data exceeds the scope of direct use but is still within the scope of reconfigurability. Port state time mapping is performed on it to obtain the estimated port state value corresponding to the target processing time.
[0103] like Figure 3 As shown, the port state estimates satisfy the following relationship:
[0104] ;
[0105] in, Indicates the time of target processing; Indicates the source time of the port feedback data; Indicates the source time Port status; This represents the time difference between the source time and the target processing time of the port feedback data. ; This indicates the available historical port data; Indicates the available input or stimulus quantity; Indicates the parameters of the object or interface model being tested; This represents the state-time mapping or reconstruction relationship;
[0106] The state-time mapping adopts at least one of the following methods: state extrapolation based on the rate of change of state, interpolation or extrapolation based on multiple historical samples, state propagation based on discrete state space model, state prediction based on parametric model, and state estimation based on state observer.
[0107] As one specific implementation method, first-order state extrapolation is used to complete the reconstruction calculation:
[0108]
[0109] It should be noted that the rate of change of state The calculation is based on the source time information of adjacent port data, rather than on the arrival time of communication. For example, the source times of two adjacent port data are respectively... and The corresponding port statuses are as follows: and Then the rate of change of state is expressed as:
[0110]
[0111] Time-failed data is prohibited from being directly used in the current real-time simulation calculation and should be processed according to the preset failure handling rules.
[0112] S6. Generate port output instructions based on the port status or estimated port status corresponding to the target processing time, and write the port output instructions into the pending execution cache corresponding to the target execution time information.
[0113] Specifically, the real-time simulation module receives directly valid data or estimated port states at the target time obtained through reconstruction, and runs a virtual power grid model to generate port output commands. The port output commands carry target execution time information, along with a constraint on the latest valid arrival period that can be written into the pending execution cache.
[0114] The latest valid arrival period is:
[0115] ;
[0116] in, The target execution cycle for the port output command. The number of reserved cycles required for the power interface to complete buffer updates and prepare for output.
[0117] When the port output command arrives no later than the latest valid arrival period, it is written into the target execution period. The corresponding cache to be executed, and in the periodic Execution: When a port output command arrives later than the latest valid arrival period, it is determined to be a time-failed command and execution is prohibited immediately according to the communication arrival time.
[0118] When conducting fault ride-through, voltage disturbance, and phase angle jump test scenarios, the target execution time is pre-configured for the fault and disturbance commands, and the commands are written into the execution cache before the target execution time arrives.
[0119] S7. The power interface device is based on a unified time reference and executes the port output command when the physical time corresponding to the target execution time information is reached, so that the actual execution time of the port output command is not directly determined by its communication arrival time.
[0120] Specifically, the power interface device performs timing based on a unified time base. When the timing reaches the target execution time corresponding to the output instruction, the corresponding instruction is retrieved from the execution buffer and output to the power interface device.
[0121] Therefore, under the premise of meeting the deadline constraint, the actual execution cycle is equal to the target execution cycle. The traditional arrival-driven relationship is no longer used. Communication delay fluctuations within the allowable range are absorbed by buffering and time margin. The actual execution time of the port output instruction is no longer determined by the message arrival time.
[0122] In fault ride-through, voltage disturbance, and phase angle jump tests, the power interface outputs the disturbance command only after the preset target execution time is reached, thus decoupling the fault and disturbance application time from the message communication arrival time, ensuring the accuracy and reproducibility of the test event application time. Specific Implementation
[0124] In one specific embodiment, a single-phase equivalent minimum PHIL closed-loop simulation model is established to verify the technical effect of the present invention. The simulation model is as follows: Figure 4 As shown. The virtual power grid model is represented as follows:
[0125] ;
[0126] in, Used as a reference for the output voltage of the virtual power grid; Ideal voltage for the virtual power grid; For virtual grid resistance; For virtual power grid inductance; The current flowing from the virtual power grid to the device under test; For current Regarding time The rate of change;
[0127] The object under test adopts The load has the following circuit equation:
[0128] ;
[0129] in, The voltage at the port of the device under test; The inductance of the load being tested; The resistance of the load being measured is 1.
[0130] The basic step size for real-time simulation is set to The system's basic parameters are: the effective value of the ideal grid voltage. 230V rms Characterizing the ideal voltage amplitude of the virtual grid; virtual grid resistance It is 0.15 Characterizes the voltage drop characteristics of the virtual power grid line resistance; virtual power grid inductance. The value is 2mH, which characterizes the inductance voltage drop of the virtual power grid line; the measured load resistance is... 8 , for the tested The resistance parameters of the load; the reference inductance of the load under test. 2mH is the measured value. Reference inductance parameters of the load.
[0131] To reduce discretization error, the measured The load is modeled using an exact discrete model under zero-order hold conditions:
[0132] ;
[0133] in For the first Discrete current values for each simulation step size For the first Discrete port voltage values with a simulation step size , The coefficients of the discrete model are calculated as follows: .
[0134] Two comparison schemes were set up: a traditional random timing interface and the deterministic timing interface of this invention, ensuring that the average total latency of the two schemes was basically the same. The feedback link latency step size of the traditional random timing interface... Forward link delay step size The port output command is executed immediately upon arrival; the feedback link of the deterministic timing interface of this invention has a fixed step size delay. Forward link fixed step delay The port output instructions are written to the pending execution cache and executed uniformly during the target execution cycle.
[0135] Simulation results are as follows Figures 5-8 As shown, the current error Voltage error represents the difference between the actual current and the ideal current. This represents the difference between the actual voltage and the ideal voltage. Simulation results show that, under conditions of similar average interface delay, the port current and port voltage waveforms of traditional random timing interfaces exhibit significant high-frequency jitter. In contrast, the deterministic timing interface provided by this invention can significantly reduce the conversion of random communication timing into port waveform jitter, resulting in smoother port waveforms, significantly reduced current and voltage errors, and higher repeatability of experimental results.
[0136] Based on the above, by changing only the inductance value of the tested object, the impact of the dynamic time scale on the time validity is verified. (Inductance of the tested object) Using values of 5mH, 3mH, 2mH, 1mH, and 0.5mH respectively, the corresponding dynamic time constant ranges from 62.5μs to 625μs. Simulation results show the following trends: as the inductance of the measured object decreases and the dynamic time constant shortens, the dynamic response of the measured object accelerates. The impact of the same interface time error on the port state gradually increases, and the waveform error and ripple level of traditional random timing interfaces rise significantly. The deterministic timing interface provided by this invention, through time validity determination and target time execution mechanisms, exhibits better adaptability to fast-moving measured objects and can effectively reduce test errors caused by stale data and random delays. Therefore, the direct usable time range and reconfigurable time range of the feedback data can be adaptively adjusted according to the dynamic time scale of the measured object.
[0137] The port state time-mapping effect of reconfigurable data was verified using a first-order state extrapolation method. Three sets of control cases were set up: ideal no-interface delay, no state reconstruction, and state time-mapping using the present invention. The port current amplitude, phase, and root mean square error were compared. Simulation results show that without state reconstruction, a fixed data age leads to phase shift and amplitude error in the port state. After using port state time-mapping, the amplitude and phase of the port current are closer to the ideal no-interface-delay case, and the port state misalignment caused by the fixed data age is effectively compensated.
[0138] System Implementation Examples
[0139] This invention also provides a deterministic timing interface system for power hardware-in-the-loop testing, used to execute the aforementioned deterministic timing interface method for power hardware-in-the-loop testing. The system includes a unified time base module, a time semantics generation module, a time validity determination module, a state and time reconstruction module, a real-time simulation module, an execution buffer module, and a deterministic execution module. Each module can be implemented in software, hardware, or a combination of both.
[0140] The unified time reference module is used to establish a unified time reference between the real-time simulation device, the power interface device, and the device under test. Its output is connected to the time semantic generation module, the time validity determination module, and the deterministic execution module, respectively. Specifically, it is used to generate global synchronized time coordinates based on the real-time simulation step size, providing a unified time reference for all devices and data in the system.
[0141] The time semantic generation module is used to configure source time information and time validity information for port feedback data, and to configure target execution time information for port output instructions. The input end is connected to the unified time base module, and the output end is connected to the time validity determination module and the pending execution cache module, respectively. Specifically, it is used to complete the time semantic encapsulation of port data and assign corresponding time fields and constraint information to each type of data.
[0142] The time validity determination module is used to determine whether the data is directly valid, reconstructable, or time-invalid based on the data age of the data fed back from the port. The input end is connected to the time semantic generation module, and the output end is connected to the real-time simulation module and the state time reconstruction module, respectively. Specifically, it is used to calculate the data age, perform three-level validity determination, and distribute the data to the corresponding processing link according to the determination result.
[0143] The state-time reconstruction module is used to map the port state to the target processing time based on the time difference between the source time information of the reconstructable data and the target processing time, and obtain the estimated port state value at the target time. The input end is connected to the time validity determination module, and the output end is connected to the real-time simulation module. Specifically, it is used to perform state-time mapping calculation on the reconstructable data to compensate for the port state misalignment caused by the fixed data age.
[0144] The real-time simulation module is used to generate port output instructions based on directly valid data or the reconstructed target time port status. Its input terminals are connected to the time validity determination module and the state time reconstruction module, respectively, and its output terminal is connected to the pending execution cache module. Specifically, it is used to run a virtual power grid model and calculate and generate port output instructions based on the target time port status.
[0145] The pending execution cache module is used to store the port output instructions according to the target execution time corresponding to the port output instructions. Its input end is connected to the time semantic generation module and the real-time simulation module respectively, and its output end is connected to the deterministic execution module. Specifically, it is used to cache the output instructions according to the target execution cycle and absorb communication latency fluctuations within the allowable range.
[0146] The deterministic execution module is used to apply the corresponding port output command to the power interface device when the target execution time is reached under a unified time base. The input end is connected to the unified time base module and the execution buffer module respectively, and the output end is connected to the external power interface device. Specifically, it is used to trigger the command output according to the target time, so as to decouple the execution time from the communication arrival time.
[0147] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A deterministic timing interface method for power hardware-in-the-loop testing, characterized in that, include: A unified time base is established based on the real-time simulation step size of the power hardware-in-the-loop system, and the port data transmitted between the real-time simulation device, the power interface device and the device under test are associated with the unified time base. Configure source time information and time validity information for the port feedback data generated by the device under test. The source time information is used to characterize the physical state generation time corresponding to the port feedback data. The time validity information includes the direct use time range, the reconfigurable time range, and the failure time range. The port output command generated by the real-time simulation device is configured with target execution time information, which is used to characterize the physical moment when the port output command is scheduled to act on the power interface device. The data age of the port feedback data is determined based on the time difference between the source time information of the port feedback data and the target processing time. The port feedback data is divided into directly valid data, reconfigurable data and time-failed data according to the time validity information. The target processing time is the time corresponding to the simulation cycle in which the real-time simulation device performs model calculations on the port feedback data. For the directly valid data, it is allowed to directly participate in the model calculation of the corresponding real-time simulation cycle; for the reconfigurable data, port state time mapping is implemented according to the time difference between its source time information and the target processing time to obtain the estimated port state value corresponding to the target processing time; for the time-failed data, it is prohibited from directly participating in the current real-time simulation calculation. Based on the port status or port status estimate corresponding to the target processing time, a port output instruction is generated and written into the cache to be executed corresponding to the target execution time information; The power interface device is based on a unified time base and executes port output instructions when the physical time corresponding to the target execution time information is reached, so that the actual execution time of the port output instructions is not directly determined by the communication arrival time.
2. The deterministic timing interface method for power hardware-in-the-loop testing according to claim 1, characterized in that, The port data is represented using a unified temporal semantic data structure, which includes: The Value field represents the port measurement value, model calculation value, control command value, or event command value. The SourceTime field indicates the physical state generation time corresponding to the data; for feedback measurement data, it is the actual sampling time, and for simulation-generated data, it is the simulation state time on which the data is based. The TargetTime field indicates the target time at which the data is scheduled to participate in real-time calculations or actually be applied to the power port; The ValidityInformation field indicates the time constraint information that the data can be used directly, undergo state reconstruction, or be determined to be invalid. The Type field indicates the data type, which determines the specific time semantics and processing method of each time field. For data types that do not require a target execution time, the TargetTime field is set to a predefined invalid value, a reserved value, or identified by the data type as not participating in the current data processing.
3. The deterministic timing interface method for power hardware-in-the-loop testing according to claim 1, characterized in that, The direct use time range, reconfigurable time range, and failure time range are determined by a first time threshold. Second time threshold Defined and satisfying The age of the data returned by the port is recorded as ,but: when When the port feedback data is within the direct usage time range, it is determined to be directly valid data; when When the port feedback data is within the reconfigurable time range, it is determined to be reconfigurable data; when When the port feedback data falls within the failure time range, it is determined to be time-failed data.
4. The deterministic timing interface method for power hardware-in-the-loop testing according to claim 3, characterized in that, The first time threshold and the second time threshold are determined based on at least one of the following parameters: Real-time simulation step size, electromagnetic dynamic time scale of the device under test, control bandwidth of the device under test, resonant frequency of the device under test, key mode frequencies of the device under test, and target test frequency band.
5. The deterministic timing interface method for power hardware-in-the-loop testing according to claim 3, characterized in that, For the reconfigurable data, based on the time difference between its source time information and the target processing time, and combined with at least one of the port data historical values, port input quantities, dynamic parameters of the measured object, or state models, port state time mapping is implemented to obtain the estimated port state value corresponding to the target processing time. The port state estimates satisfy the following relationship: ; in, Indicates the time of target processing; Indicates the source time of the port feedback data; Indicates the source time Port status; This represents the time difference between the source time and the target processing time of the port feedback data. ; This indicates the available historical port data; Indicates the available input or stimulus quantity; Indicates the parameters of the object or interface model being tested; This represents the state-time mapping or reconstruction relationship; The state-time mapping adopts at least one of the following methods: state extrapolation based on the rate of change of state, interpolation or extrapolation based on multiple historical samples, state propagation based on discrete state space model, state prediction based on parametric model, and state estimation based on state observer. When using first-order state extrapolation, the rate of state change is calculated based on the source time information of the data from adjacent ports, rather than based on the communication arrival time.
6. The deterministic timing interface method for power hardware-in-the-loop testing according to claim 1, characterized in that, The time validity information of the port output command includes the latest valid arrival period for which the port output command is allowed to enter the execution buffer. The latest valid arrival period is: ; in, The target execution cycle for the port output command. The number of reserved cycles required for the power interface to complete buffer updates and prepare for output; When the port output instruction arrives no later than the latest valid arrival period, it is written into the target execution period. The corresponding cache to be executed, and in the periodic implement; When the port output command arrives later than the latest valid arrival period, it is determined to be a time-failed command and execution is prohibited according to the communication arrival time.
7. The deterministic timing interface method for power hardware-in-the-loop testing according to claim 2, characterized in that, For data out-of-order issues caused by changes in communication latency, the judgment is made based on the SourceTime field, TargetTime field, or data sequence number; When the SourceTime of newly arrived data is earlier than the SourceTime of already used data, the newly arrived data is prohibited from overwriting the update state that has already entered the calculation process.
8. The deterministic timing interface method for power hardware-in-the-loop testing according to claim 1, characterized in that, For the time-failed data, it is processed by at least one of the following methods: discarding, maintaining the previous valid state, using a spare state value, or an anomaly marker.
9. A deterministic timing interface system for power hardware-in-the-loop testing, characterized in that, include: The unified time reference module is used to establish a unified time reference between the real-time simulation device, the power interface device, and the device under test. The time semantic generation module is used to configure source time information and time validity information for port feedback data, and to configure target execution time information for port output instructions. The time validity determination module is used to determine whether the data fed back from the port is directly valid data, reconstructable data, or time-expired data based on its age. The state time reconstruction module is used to map the port state to the target processing time based on the time difference between the source time information of the reconstructable data and the target processing time, so as to obtain the estimated value of the port state at the target time. The real-time simulation module is used to generate port output instructions based on the directly valid data or the reconstructed target time port status. The pending execution cache module is used to store the port output instruction according to the target execution time corresponding to the port output instruction; A deterministic execution module is used to apply a corresponding port output command to the power interface device when the target execution time is reached under the unified time reference.
10. The deterministic timing interface system for power hardware-in-the-loop testing according to claim 9, characterized in that, The time validity determination module determines the direct usable time range, reconfigurable time range, and failure time range of the port feedback data based on at least one of the following: real-time simulation step size, electromagnetic dynamic time scale of the device under test, control bandwidth, resonant frequency, key mode frequency, or target test frequency band.
