Photovoltaic inverter hardware-in-the-loop simulation test method based on digital twinning
Patent Information
- Application Number
- CN202610732796.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-26
- Publication Date
- 2026-09-11
- Estimated Expiration
- 2046-05-26
AI Technical Summary
现有测试工况多来源于标准电压跌落、频率偏移、相位跳变或人工设定的故障组合,难以充分表征真实光伏电站中辐照度扰动和电网扰动的边界扰动特征,导致测试环境与现场运行状态之间存在偏差;现有数字孪生模型通常侧重静态参数校准或单次仿真一致性验证,缺少以真实光伏电站运行状态为驱动、以光伏环境数字孪生模型为响应的动态同步机制,难以持续生成与现场状态一致的光伏环境孪生状态;现有硬件在环测试多以人工枚举或经验选取方式确定扰动动作参数,难以基于失稳评价目标自动反演边界失稳工况参数序列,测试效率和极端工况覆盖能力不足;当逆变器出现失稳或保护异常时,现有方法通常只能给出波形异常、保护动作或测试不通过结论,缺少基于可微算子映射关系的算子梯度归因能力,难以定位锁相环、最大功率点跟踪环节、电流控制环节、保护逻辑或拓扑切换逻辑中的控制缺陷,也难以进一步形成边界稳定裕度评价和抗扰控制优化策略
本发明通过相空间重构和最大Lyapunov指数估计识别辐照度扰动及电网扰动的边界扰动特征,解决现有测试工况依赖人工设定、难以覆盖真实现场边界扰动的问题,使光伏环境数字孪生模型能够保留幅值边界、变化速率和相轨迹边界等关键特征;通过驱动—响应同步结构将真实光伏电站运行状态与光伏环境数字孪生模型动态锁定,解决孪生模型与现场状态不同步的问题,提高硬件在环测试输入的时效性和一致性;通过改进型DeepONet算子模型建立测试状态空间、扰动动作空间和光伏环境孪生状态之间的可微算子映射关系,并在物理可行域内迭代生成边界失稳工况参数序列,解决极端工况依赖遍历搜索、测试效率低的问题;通过算子梯度归因定位控制逻辑缺陷,并结合边界稳定裕度生成抗扰控制优化策略,使测试结果由“是否失稳”进一步转化为“为何失稳、如何优化”的工程闭环,对提升光伏逆变器并网适应性、保护策略验证深度和大规模新能源接入安全性具有重要意义。
Smart Images

Figure CN122389373B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of photovoltaic power generation equipment simulation and testing technology, and in particular to a hardware-in-the-loop simulation and testing method for photovoltaic inverters based on digital twins. Background Technology
[0002] With the continuous expansion of grid-connected photovoltaic (PV) power generation, the stability testing of PV inverters under complex operating conditions such as low-voltage ride-through, high-voltage ride-through, grid frequency fluctuations, harmonic disturbances, and topology switching has attracted widespread attention. Existing PV inverter testing technologies mainly rely on real-time digital simulation platforms, hardware-in-the-loop simulation platforms, or pre-set fault condition libraries to verify the inverter's electrical response, control status, and protection action results. However, in practical applications, the following problems commonly exist: Existing test conditions are mostly derived from standard voltage drops, frequency shifts, phase jumps, or manually set fault combinations, which are insufficient to fully characterize the boundary disturbance characteristics of irradiance disturbances and grid disturbances in real photovoltaic power plants, resulting in discrepancies between the test environment and the actual field operation. Existing digital twin models typically focus on static parameter calibration or single simulation consistency verification, lacking a dynamic synchronization mechanism driven by the actual photovoltaic power plant operation and responding to the photovoltaic environment digital twin model, making it difficult to continuously generate photovoltaic environment twin states consistent with the field conditions. Existing hardware-in-the-loop tests mostly determine disturbance action parameters through manual enumeration or empirical selection, making it difficult to automatically invert the boundary instability condition parameter sequence based on the instability evaluation target, resulting in insufficient test efficiency and extreme condition coverage. When inverters experience instability or protection anomalies, existing methods can usually only provide conclusions such as waveform anomalies, protection actions, or test failures, lacking operator gradient attribution capabilities based on differentiable operator mapping relationships, making it difficult to locate control defects in phase-locked loops, maximum power point tracking loops, current control loops, protection logic, or topology switching logic, and also making it difficult to further develop boundary stability margin evaluation and disturbance rejection control optimization strategies.
[0003] Therefore, how to provide a hardware-in-the-loop simulation test method for photovoltaic inverters based on digital twins is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] One objective of this invention is to propose a hardware-in-the-loop simulation test method for photovoltaic inverters based on digital twins. This invention utilizes phase space reconstruction, Lyapunov exponent estimation, drive-response synchronization, and an improved DeepONet operator model. It details the implementation process of boundary disturbance identification, boundary instability condition generation, hardware-in-the-loop testing, and control logic defect localization. It has the advantages of high test coverage, accurate instability positioning, and high efficiency in disturbance rejection optimization.
[0005] The hardware-in-the-loop simulation and testing method for photovoltaic inverters based on digital twins according to embodiments of the present invention includes the following steps: Step 1: Collect photovoltaic power plant operating environment data, and after preprocessing, identify the boundary disturbance characteristics of irradiance disturbance and grid disturbance based on phase space reconstruction and maximum Lyapunov exponent estimation, and construct a photovoltaic environment digital twin model; Step 2: Using the actual operating state of a photovoltaic power plant as the driving system and the photovoltaic environment digital twin model as the response system, establish a driving-response synchronization structure to generate the synchronized photovoltaic environment twin state; Step 3: Determine the test state space based on the inverter's operating state, determine the disturbance action space based on the boundary disturbance intensity, fault combination, and topology switching parameters, and determine the instability evaluation target and instability judgment conditions; Step 4: Input the test state space, disturbance action space, and synchronized photovoltaic environment twin state into the improved DeepONet operator model. Generate differentiable operator mapping relationship by embedding causal state into Branch Net, frequency domain-time domain dual-channel Trunk Net, and photovoltaic circuit mechanism constraints. Step 5: Based on the differentiable operator mapping relationship, calculate the gradient of the instability evaluation target with respect to the disturbance action parameters, and iteratively generate the boundary instability condition parameter sequence within the physical feasible region; Step 6: Input the boundary disturbance signal and boundary instability condition parameter sequence generated based on the synchronized photovoltaic environment twin state into the hardware-in-the-loop simulation platform, collect the electrical response, control state and protection action results, and when the instability judgment condition is met, perform operator gradient attribution based on the differentiable operator mapping relationship to obtain the control logic defect location result; Step 7: Determine the boundary stability margin based on the Lyapunov exponent change and the phase trajectory boundary distance, and generate an anti-disturbance control optimization strategy and a hardware-in-the-loop test report based on the control logic defect location results.
[0006] Optionally, the photovoltaic power station operating environment data includes irradiance sampling sequence, module temperature sampling sequence, grid connection point voltage sampling sequence, grid connection point frequency sampling sequence, grid connection point phase sampling sequence, and grid connection point harmonic content sampling sequence; Based on the sampling timestamp, the photovoltaic power plant operating environment data is time-aligned, abnormal format data is removed, missing sampling points are marked, filtered, trend terms are deducted, and amplitude is normalized to generate a standard environmental time series. The average mutual information method is used to determine the time delay, the pseudo-nearest neighbor method is used to determine the target embedding dimension, and the standard environmental time series are arranged into photovoltaic environmental phase trajectories according to the time delay and the target embedding dimension. Based on the neighborhood radius, evolution step size and fitting time interval, the separation distance between neighboring trajectory points is calculated, and the maximum Lyapunov exponent is obtained according to the growth slope of the separation distance. When the maximum Lyapunov exponent is greater than the preset boundary disturbance discrimination threshold, the corresponding irradiance disturbance or grid disturbance is marked as a boundary disturbance, and the amplitude boundary, rate of change boundary, dominant frequency band and phase trajectory boundary are extracted from the photovoltaic environment phase trajectory. The disturbance mapping parameters are configured based on the amplitude boundary, rate of change boundary, dominant frequency band and phase trajectory boundary, and the disturbance mapping parameters, irradiance disturbance markers and grid disturbance markers are written into the photovoltaic environment digital twin model to generate irradiance disturbance data and grid disturbance data.
[0007] Optionally, step two specifically includes: The actual operating status of the photovoltaic power station includes real-time irradiance, module temperature, grid connection point voltage, grid connection point frequency, grid connection point phase, grid connection point harmonic content, and inverter grid connection power. The actual operating status of the photovoltaic power station is sorted according to the sampling timestamp to generate a driving state sequence; The photovoltaic environment digital twin model outputs irradiance disturbance data and grid disturbance data according to the same sampling timestamp as the driving state sequence, and generates a response state sequence; A drive-response synchronization structure is established by using the drive state sequence as the drive system and the response state sequence as the response system. The state deviation between the driving state sequence and the response state sequence in terms of irradiance, grid connection point voltage, grid connection point frequency, grid connection point phase, and grid connection point harmonic content is calculated based on time slices. Synchronization corrections are generated based on state deviations, and these corrections are used to correct the disturbance mapping parameters in the photovoltaic environment digital twin model. When the state deviation within a preset number of consecutive time slices does not exceed the preset synchronization deviation threshold, the corrected response state sequence is determined as the synchronized photovoltaic environment twin state.
[0008] Optionally, step three specifically includes: The inverter operating status includes DC side voltage, DC side current, AC side voltage, AC side current, phase-locked loop phase, phase-locked loop frequency, maximum power point tracking duty cycle, current loop control quantity, protection status, and grid-connected topology status. The inverter's operating status is matched with the synchronized photovoltaic environment twin status according to the sampling timestamp to generate an inverter status record; Extract the DC side status, AC side status, phase-locked loop status, maximum power point tracking status, current control status, protection status, and grid-connected topology status from the inverter status record to generate the test state space; Based on boundary disturbance strength parameters, voltage drop fault parameters, frequency offset fault parameters, phase jump fault parameters, harmonic injection fault parameters, and topology switching parameters, fault combinations are generated, and disturbance action space is generated based on boundary disturbance strength parameters, fault combinations, and topology switching parameters. The current operating state in the test state space is compared with the preset steady-state benchmark to determine the degree of steady-state deviation. The protection trigger status is determined based on the protection trigger type, protection trigger time, protection execution status, and protection reset status; The oscillation index is determined based on the number of alternating directions and amplitude variations of the AC side voltage, AC side current, and phase-locked loop frequency within a continuous time slice. Based on the steady-state deviation, protection trigger state, and oscillation index, an instability evaluation target is generated, and instability judgment conditions are determined.
[0009] Optionally, step four specifically includes: The test state space, disturbance action space, and synchronized photovoltaic environment twin state are paired according to the same sampling timestamp to generate standard operator input samples; The improved DeepONet operator model includes a causal state embedding Branch Net, a frequency-time dual-channel Trunk Net, an operator fusion unit, a photovoltaic circuit mechanism constraint unit, and an instability evaluation output unit; Inverter status, disturbance action parameters, irradiance disturbance data, and grid disturbance data are extracted from the standard operator input samples. Disturbance correlation weights are constructed based on the sampling time interval, amplitude difference, and phase trajectory distance of the photovoltaic environment for the irradiance disturbance data and grid disturbance data. Gaussian random field smoothing and variance estimation are performed on the irradiance disturbance data and grid disturbance data based on the disturbance correlation weights to generate disturbance prior vectors. Extract the inverter state of the previous moment, the current disturbance action parameters, and the synchronized photovoltaic environment twin state under the current sampling timestamp from the standard operator input samples, and concatenate them with the disturbance prior vector according to the feature dimension to generate the BranchNet input sequence. A causal transit mask is generated based on the protection state and the grid topology state. The Branch Net input sequence and the causal transit mask are then embedded into the Branch Net, and the branch coefficient vector is generated after ReLU activation, Tanh limiting mapping and gated loop processing. Input the sampling time point into the time channel of the frequency-time dual-channel Trunk Net to generate a time-domain basis function vector; input the frequency point and harmonic order into the frequency channel to generate a frequency-domain basis function vector. The channel fusion weights are determined based on the perturbation action parameters. The time-domain basis function vectors and frequency-domain basis function vectors are weighted and concatenated to generate dual-channel basis function vectors. The branch coefficient vector and the dual-channel basis function vector are fused by an operator fusion unit to generate the electrical response operator output. The photovoltaic circuit mechanism constraint unit performs DC-side power balance, AC-side voltage and current, grid connection point power conservation, inverter current limiting and protection action timing constraint verification on the output of the electrical response operator, and generates mechanism constraint deviation. The instability evaluation operator output is generated based on the standard operator input sample, electrical response operator output, mechanism constraint deviation, and instability evaluation target, and the differentiable operator mapping relationship is determined.
[0010] Optionally, step five specifically includes: Extract boundary disturbance intensity parameters, fault combination parameters, and topology switching parameters from the disturbance action space to generate initial disturbance action parameters; The physical feasible region is determined based on the allowable range of grid-connected voltage, the allowable range of grid-connected frequency, the range of phase change, the upper limit of harmonic content, the upper limit of boundary disturbance intensity, and the legal state of topology switching. The initial disturbance action parameters are input into the differentiable operator mapping relationship to obtain the electrical response operator output and the instability evaluation operator output, and the current instability evaluation value is calculated according to the instability evaluation target; The inverse automatic differentiation is performed on the current instability evaluation value relative to the disturbance action parameters to obtain the instability gradient vector; The perturbation action parameters are updated according to the preset step size, step size decay ratio, gradient clipping threshold and maximum number of iterations, and the updated perturbation action parameters are projected onto the physical feasible region. Repeat the calculation of the instability gradient vector, the update of the disturbance action parameters, and the projection of the physical feasible region until the current instability evaluation value reaches the preset target range, the increment of the instability evaluation value between two adjacent iterations is less than the preset increment threshold, or the number of iterations reaches the maximum number of iterations. Arrange the perturbation action parameters that satisfy the physical feasible region constraint in the order of iteration time to generate the parameter sequence of boundary instability conditions.
[0011] Optionally, step six specifically includes: Irradiance disturbance data and grid disturbance data are extracted based on the synchronized photovoltaic environment twin state, and boundary disturbance signals are generated by combining the boundary instability condition parameter sequence. Based on the hardware-in-the-loop simulation platform interface configuration, the boundary disturbance signal is mapped to an irradiance simulation signal, a grid connection point voltage disturbance signal, a grid connection point frequency disturbance signal, a phase disturbance signal, and a harmonic injection signal. According to the time sequence of the boundary instability condition parameter sequence, the boundary disturbance signal is input into the hardware-in-the-loop simulation platform, and the corresponding disturbance is applied to the photovoltaic inverter under test; During the disturbance application process, electrical response, control status and protection action results are collected and compared with instability judgment conditions. When the instability judgment conditions are met, an instability trigger record is generated. The control state field, disturbance action parameters, and synchronized photovoltaic environment twin state corresponding to the instability trigger record are input into the differentiable operator mapping relationship, and the operator gradient attribution is performed with the electrical response field and instability evaluation target as attribution references to obtain the gradient sensitivity of the control state field. The phase-locked loop status, maximum power point tracking status, current control status, protection status, and grid-connected topology status are sorted according to gradient sensitivity, and the defective control link is determined based on the correspondence between the control status field and the control link. The defect location results of the control logic are generated based on the defect control process.
[0012] Optionally, step seven specifically includes: Based on the control logic defect location results, instability trigger records, the synchronized photovoltaic environment twin state and inverter operating state, a stability margin evaluation state sequence is constructed, and the stability margin evaluation state sequence is reconstructed in phase space to generate a stability margin evaluation phase trajectory. The maximum Lyapunov exponent corresponding to the stability margin evaluation phase trajectory when no boundary instability condition parameter sequence is input is used as the benchmark exponent. The maximum Lyapunov exponent obtained by re-estimating the stability margin evaluation phase trajectory within the corresponding time window when the instability judgment condition is met is used as the current exponent, and the change in Lyapunov exponent is determined. Based on the trigger time in the instability trigger record, the corresponding phase trajectory point in the stability margin evaluation phase trajectory is read, and the stable operating boundary is determined based on the stability margin evaluation phase trajectory when no boundary instability condition parameter sequence is input, and the phase trajectory boundary distance is calculated. The boundary stability margin is determined based on the change in the Lyapunov exponent and the distance to the phase trajectory boundary. When the defect control loop is a phase-locked loop, strategies for adjusting the phase-locked loop bandwidth, limiting the phase error, and adjusting the frequency tracking filter parameters are generated based on the boundary stability margin. When the defect control loop is the maximum power point tracking loop, a duty cycle change step size adjustment and power disturbance observation period adjustment strategy are generated based on the boundary stability margin. When the defect control loop is a current control loop, current limiting, virtual damping and current loop control quantity adjustment strategies are generated based on the boundary stability margin. When the defect control loop is protection logic or topology switching logic, the protection action threshold, protection delay and topology switching timing adjustment strategy are generated based on the boundary stability margin. Based on the control logic defect location results, boundary stability margin, and control parameter adjustment strategy, an anti-disturbance control optimization strategy is generated. The boundary instability condition parameter sequence, boundary disturbance signal, electrical response, control state, protection action results, control logic defect location results, boundary stability margin, and anti-disturbance control optimization strategy are summarized to generate a hardware-in-the-loop test report.
[0013] The beneficial effects of this invention are: This invention identifies boundary disturbance characteristics of irradiance disturbances and grid disturbances through phase space reconstruction and maximum Lyapunov exponent estimation, solving the problem that existing test conditions rely on manual settings and are difficult to cover real-world boundary disturbances. This allows the photovoltaic environment digital twin model to retain key features such as amplitude boundaries, rates of change, and phase trajectory boundaries. Through a drive-response synchronization structure, the actual photovoltaic power plant operating state is dynamically locked to the photovoltaic environment digital twin model, solving the problem of asynchronous operation between the twin model and the field state, and improving the timeliness and consistency of hardware-in-the-loop test inputs. Furthermore, through an improved DeepONe... The t-operator model establishes a differentiable operator mapping relationship between the test state space, the disturbance action space, and the photovoltaic environment twin state. It iteratively generates the parameter sequence of boundary instability conditions within the physically feasible domain, solving the problem of low testing efficiency due to traversal search in extreme conditions. By locating control logic defects through operator gradient attribution and generating disturbance rejection control optimization strategies in combination with boundary stability margins, the test results are transformed from "whether it is unstable" to "why it is unstable and how to optimize" in an engineering closed loop. This is of great significance for improving the grid-connected adaptability of photovoltaic inverters, the verification depth of protection strategies, and the security of large-scale new energy access. Attached Figure Description
[0014] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of the hardware-in-the-loop simulation and testing method for photovoltaic inverters based on digital twins proposed in this invention; Figure 2 This is a schematic diagram of the hardware-in-the-loop simulation and testing method for photovoltaic inverters based on digital twins proposed in this invention; Figure 3 This is a framework diagram of the improved DeepONet operator model in the hardware-in-the-loop simulation test method for photovoltaic inverters based on digital twins proposed in this invention. Detailed Implementation
[0015] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0016] refer to Figures 1-3 The hardware-in-the-loop simulation and testing method for photovoltaic inverters based on digital twins includes the following steps: Step 1: Collect photovoltaic power plant operating environment data, and after preprocessing, identify the boundary disturbance characteristics of irradiance disturbance and grid disturbance based on phase space reconstruction and maximum Lyapunov exponent estimation, and construct a photovoltaic environment digital twin model; Step 2: Using the actual operating state of a photovoltaic power plant as the driving system and the photovoltaic environment digital twin model as the response system, establish a driving-response synchronization structure to generate the synchronized photovoltaic environment twin state; Step 3: Determine the test state space based on the inverter's operating state, determine the disturbance action space based on the boundary disturbance intensity, fault combination, and topology switching parameters, and determine the instability evaluation target and instability judgment conditions; Step 4: Input the test state space, disturbance action space, and synchronized photovoltaic environment twin state into the improved DeepONet operator model. Generate differentiable operator mapping relationship by embedding causal state into Branch Net, frequency domain-time domain dual-channel Trunk Net, and photovoltaic circuit mechanism constraints. Step 5: Based on the differentiable operator mapping relationship, calculate the gradient of the instability evaluation target with respect to the disturbance action parameters, and iteratively generate the boundary instability condition parameter sequence within the physical feasible region; Step 6: Input the boundary disturbance signal and boundary instability condition parameter sequence generated based on the synchronized photovoltaic environment twin state into the hardware-in-the-loop simulation platform, collect the electrical response, control state and protection action results, and when the instability judgment condition is met, perform operator gradient attribution based on the differentiable operator mapping relationship to obtain the control logic defect location result; Step 7: Determine the boundary stability margin based on the Lyapunov exponent change and the phase trajectory boundary distance, and generate an anti-disturbance control optimization strategy and a hardware-in-the-loop test report based on the control logic defect location results.
[0017] In this embodiment, step one specifically includes: The photovoltaic power plant operating environment data is collected, including irradiance sampling sequence, module temperature sampling sequence, grid connection point voltage sampling sequence, grid connection point frequency sampling sequence, grid connection point phase sampling sequence, and grid connection point harmonic content sampling sequence. The photovoltaic power plant operating environment data is time-aligned according to the sampling timestamp, abnormal format data is removed, missing sampling points are marked with missing markers, and the time-aligned data is filtered, trend term deduction and amplitude normalization are performed in sequence to generate a standard environmental time series. Phase space reconstruction is performed on the standard environmental time series. Specifically, the mutual information change under different time delays is calculated using the average mutual information method, and the delay corresponding to the first local minimum of mutual information is determined as the time delay. The separation ratio of neighboring trajectory points under different embedding dimensions is statistically analyzed using the pseudo-nearest neighbor method, and the embedding dimension corresponding to the separation ratio being lower than a preset threshold is determined as the target embedding dimension. The standard environmental time series is then arranged into a photovoltaic environmental phase trajectory according to the time delay and the target embedding dimension. Subsequently, based on the preset neighborhood radius, evolution step size, and fitting time interval, neighboring trajectory points are selected in the photovoltaic environmental phase trajectory. The separation distance between neighboring trajectory points is calculated according to the evolution step size, and the maximum Lyapunov exponent is obtained based on the growth slope of the separation distance within the fitting time interval. The maximum Lyapunov exponent is compared with a preset boundary disturbance discrimination threshold. When the maximum Lyapunov exponent is greater than the preset boundary disturbance discrimination threshold, the corresponding irradiance disturbance or grid disturbance is marked as a boundary disturbance, and the amplitude boundary, rate of change boundary, dominant frequency band, and phase trajectory boundary of the boundary disturbance are extracted from the photovoltaic environmental phase trajectory.
[0018] Disturbance mapping parameters are configured based on the amplitude boundary, rate of change boundary, dominant frequency band, and phase trajectory boundary of the boundary disturbance. These parameters record the boundary disturbance iteration state, disturbance amplitude range, disturbance rate of change, and disturbance frequency band range. The disturbance mapping parameters, irradiance disturbance markers, grid disturbance markers, amplitude boundaries, rate of change boundaries, dominant frequency band, and phase trajectory boundaries are recorded in the photovoltaic environment digital twin model. The disturbance mapping parameters corresponding to the irradiance sampling sequence are bound to the module temperature sampling sequence to form irradiance disturbance data. The disturbance mapping parameters corresponding to the grid connection point voltage sampling sequence, grid connection point frequency sampling sequence, grid connection point phase sampling sequence, and grid connection point harmonic content sampling sequence are bound to the grid disturbance data, thus generating the photovoltaic environment digital twin model.
[0019] In this embodiment, step two specifically includes: The system reads the actual operating status of a photovoltaic (PV) power plant, including real-time irradiance, module temperature, grid-connected voltage, grid-connected frequency, grid-connected phase, grid-connected harmonic content, and inverter grid-connected power. The operating status is then sorted according to the sampling timestamps to generate a drive state sequence. A PV environment digital twin model is then invoked, outputting irradiance disturbance data and grid disturbance data according to the same sampling timestamps as the drive state sequence, to generate a response state sequence.
[0020] A drive-response synchronization structure is established using the drive state sequence as the drive system and the response state sequence as the response system. Real-time irradiance, grid-connected voltage, grid-connected frequency, grid-connected phase, and grid-connected harmonic content are extracted from the drive and response state sequences by time slice, and the corresponding state deviations are calculated. Synchronization corrections are determined based on each state deviation and configured into the disturbance mapping parameters in the photovoltaic environment digital twin model to correct the disturbance amplitude range, disturbance change rate, and disturbance frequency band range. The corrected disturbance mapping parameters are then used to output a new response state sequence, and the state deviation between the drive state sequence and the new response state sequence is recalculated. When the state deviation within a preset number of consecutive time slices does not exceed a preset synchronization deviation threshold, the new response state sequence is determined as the synchronized photovoltaic environment twin state.
[0021] In this embodiment, step three specifically includes: The inverter operating status is read, including DC-side voltage, DC-side current, AC-side voltage, AC-side current, PLL phase, PLL frequency, maximum power point tracking duty cycle, current loop control variables, protection status, and grid-connected topology status. The inverter operating status is matched with the synchronized photovoltaic environment twin status according to the sampling timestamp, and the matched records are combined into an inverter status record.
[0022] Based on preset test state fields, the DC side state, AC side state, phase-locked loop state, maximum power point tracking state, current control state, protection state, and grid-connected topology state are extracted from the inverter state record. A test state space is then generated according to the corresponding state value range, normalization method, and state update cycle. Based on preset disturbance action ranges, boundary disturbance strength parameters, voltage sag fault parameters, frequency offset fault parameters, phase jump fault parameters, harmonic injection fault parameters, and topology switching parameters are generated. The combination relationships of voltage sag fault parameters, frequency offset fault parameters, phase jump fault parameters, and harmonic injection fault parameters are determined as fault combination parameters. The boundary disturbance strength parameters, fault combination parameters, and topology switching parameters are then combined to generate the disturbance action space.
[0023] According to the preset steady-state benchmark, the current operating state in the test state space is compared with the DC-side voltage benchmark, AC-side voltage benchmark, PLL frequency benchmark, current loop control quantity benchmark, and power fluctuation allowable range. The steady-state deviation is determined according to the interval to which each state field deviation belongs. Protection action records are read, and the protection triggering state is determined based on the protection triggering type, protection triggering time, protection execution state, and protection reset state. Based on preset voltage oscillation thresholds, current oscillation thresholds, frequency oscillation thresholds, and continuous oscillation time thresholds, the number of alternating changes in the direction and amplitude of AC-side voltage, AC-side current, and PLL frequency are statistically analyzed within a continuous time slice to determine oscillation indicators. The steady-state deviation, protection triggering state, and oscillation indicators are weighted and summarized according to preset weights to generate an instability evaluation target. Instability judgment conditions are determined based on the steady-state deviation, protection triggering state, and oscillation indicators; when the steady-state deviation exceeds the preset deviation threshold, the protection triggering state is abnormally triggered, or the oscillation indicator exceeds the preset oscillation threshold, the instability judgment conditions are deemed met.
[0024] In this embodiment, step four specifically includes: The test state space, disturbance action space, and synchronized photovoltaic environment twin state are input into the improved DeepONet operator model. Samples are paired according to the same sampling timestamp to generate operator input samples, which include inverter state fields, disturbance action parameter fields, and environment twin state fields. The operator input samples are then subjected to field order verification, outlier filtering, and amplitude normalization to generate standard operator input samples.
[0025] The improved DeepONet operator model includes a causal state embedding Branch Net, a frequency-time dual-channel Trunk Net, an operator fusion unit, a photovoltaic circuit mechanism constraint unit, and an instability evaluation output unit. The causal state embedding Branch Net generates the branch coefficient vector, the frequency-time dual-channel Trunk Net generates the dual-channel basis function vector, and the operator fusion unit generates the electrical response operator output. DC-side state, AC-side state, PLL state, maximum power point tracking state, current control state, protection state, grid topology state, boundary disturbance intensity parameters, fault combination parameters, topology switching parameters, irradiance disturbance data, and grid disturbance data are extracted from the standard operator input samples. Based on the sampling time interval, amplitude difference, and phase trajectory distance of the photovoltaic environment, disturbance correlation weights are established for irradiance disturbance data and grid disturbance data. A covariance matrix is constructed using the disturbance correlation weights. Irradiance disturbance data and grid disturbance data are used as random field observations. Based on the covariance matrix, the random field observations under different sampling timestamps are weighted smoothed and variance estimated to obtain mean features and variance features, and a disturbance prior vector is generated.
[0026] The inverter state from the previous moment, the current disturbance action parameters, the synchronized photovoltaic environment twin state at the current sampling timestamp, and the disturbance prior vector are concatenated according to preset feature dimensions to generate a Branch Net input sequence. A causal transitivity mask is generated based on the protection state and grid-connected topology state; this mask is used to mark valid state connections, valid control connections, and valid topology connections. The Branch Net input sequence and the causal transitivity mask are embedded into the Branch Net. The state response features are processed using the ReLU activation function, and the disturbance amplitude correlation features are subjected to amplitude-limited mapping using the Tanh activation function. A gated recurrent unit is used to extract the state transitivity between adjacent sampling timestamps, generating a branch coefficient vector.
[0027] The sampling time points, AC-side voltage sampling sequence, AC-side current sampling sequence, and PLL frequency sampling sequence from the hardware-in-the-loop simulation platform are read. The sampling time points are input into the time-domain channel of the frequency-time dual-channel Trunk Net, and a time-domain basis function vector is generated through time coordinate encoding and low-frequency dynamic response encoding. Frequency points and harmonic orders are extracted from the AC-side voltage sampling sequence, AC-side current sampling sequence, and PLL frequency sampling sequence, and input into the frequency-domain channel, generating a frequency-domain basis function vector through frequency coordinate encoding and resonant response encoding. Channel fusion weights are determined based on voltage drop fault parameters, frequency offset fault parameters, phase jump fault parameters, and harmonic injection fault parameters in the disturbance action parameter field. When voltage drop or frequency offset is the dominant disturbance action parameter, the fusion weight of the time-domain basis function vector is increased; when phase jump or harmonic injection is the dominant disturbance action parameter, the fusion weight of the frequency-domain basis function vector is increased. The time-domain basis function vector and the frequency-domain basis function vector are weighted and concatenated according to the channel fusion weights to generate a dual-channel basis function vector.
[0028] The operator fusion unit performs product calculations on the corresponding components of the branch coefficient vector and the dual-channel basis function vector, and summarizes the product results to generate the electrical response operator output. The photovoltaic circuit mechanism constraint unit reads the DC-side power balance constraint, AC-side voltage and current constraint, grid connection point power conservation constraint, inverter current limiting constraint, and protection action timing constraint, and compares the electrical response operator output with each of these constraints to generate mechanism constraint deviations. The electrical response operator output and the mechanism constraint deviations are input into the instability evaluation output unit, which generates an instability evaluation operator output according to the instability evaluation target. Based on the correspondence between the standard operator input sample, the electrical response operator output, and the instability evaluation operator output, the differentiable operator mapping relationship is determined.
[0029] To address the issue that existing simulation models for hardware-in-the-loop testing of photovoltaic inverters often rely on fixed circuit models or ordinary neural network fitting, making it difficult to simultaneously express the coupling relationship between disturbance actions, inverter control states, and frequency domain resonant responses, this implementation design incorporates a causal state embedding Branch Net, a frequency-domain-time dual-channel Trunk Net, and photovoltaic circuit mechanism constraints into the improved DeepONet operator model. The causal state embedding Branch Net jointly encodes the inverter state at the previous moment, the current disturbance action parameters, and the synchronized photovoltaic environment twin state, reducing response prediction bias caused by state fragmentation. The frequency-domain-time dual-channel Trunk Net extracts low-frequency ride-through response and high-frequency resonant features respectively, improving the ability to express voltage dips, phase jumps, and harmonic injection conditions. The photovoltaic circuit mechanism constraints perform power balancing, current limiting, and protection timing verification on the electrical response operator output, making the differentiable operator mapping relationship more consistent with the actual operating rules of the inverter, providing a reliable foundation for subsequent gradient inversion of boundary instability conditions and operator gradient attribution.
[0030] In this embodiment, step five specifically includes: The gradient of the instability evaluation target with respect to the disturbance action parameters is calculated based on the differentiable operator mapping relationship, and the boundary instability condition parameter sequence is iteratively generated within the physical feasible region. Specifically, boundary disturbance intensity parameters, fault combination parameters, and topology switching parameters are extracted from the disturbance action space to generate initial disturbance action parameters. The value boundaries of the disturbance action parameters are determined based on a preset physical feasible region, which includes the allowable range of grid-connected voltage, the allowable range of grid-connected frequency, the phase change range, the upper limit of harmonic content, the upper limit of boundary disturbance intensity, and the legal state of topology switching. The initial disturbance action parameters are input into the differentiable operator mapping relationship to obtain the corresponding electrical response operator output and instability evaluation operator output, and the current instability evaluation value is calculated based on the instability evaluation target. Inverse automatic differentiation is performed on the current instability evaluation value with respect to the disturbance action parameters to obtain the instability gradient vector.
[0031] The unstable gradient vector is clipped according to a preset initial step size, step size decay ratio, gradient clipping threshold, and maximum number of iterations, and the current iteration step size is determined. The perturbation action parameters are updated along the direction corresponding to the unstable gradient vector according to the current iteration step size, generating candidate perturbation action parameters. Each candidate perturbation action parameter is compared with a preset physical feasible region. Parameters exceeding the value boundary are adjusted to the nearest value boundary, and parameters that do not meet the topology switching legal state are replaced with parameters that met the topology switching legal state in the previous round, resulting in projected perturbation action parameters. The projected perturbation action parameters are re-input into the differentiable operator mapping relationship to update the electrical response operator output, the instability evaluation operator output, and the current instability evaluation value. The calculation of the unstable gradient vector, the update of perturbation action parameters, and the projection of the physical feasible region are then repeated. When the current instability evaluation value reaches the preset target interval corresponding to the instability evaluation target, the increment of the instability evaluation value between two adjacent iterations is less than the preset increment threshold, or the number of iterations reaches the maximum number of iterations, the iteration stops, and the disturbance action parameters obtained in each iteration and satisfying the physical feasible region constraint are arranged in the order of iteration time to generate the boundary instability condition parameter sequence.
[0032] In this embodiment, step six specifically includes: The boundary disturbance signal and boundary instability condition parameter sequence generated based on the synchronized photovoltaic environment twin state are input into the hardware-in-the-loop simulation platform. Specifically, irradiance disturbance data and grid disturbance data are extracted from the synchronized photovoltaic environment twin state, and boundary disturbance signals are generated according to the fault combination parameters and topology switching parameters in the boundary instability condition parameter sequence. The hardware-in-the-loop simulation platform interface configuration is read, and the boundary disturbance signal is mapped into an irradiance analog signal, a grid connection point voltage disturbance signal, a grid connection point frequency disturbance signal, a phase disturbance signal, and a harmonic injection signal according to the hardware-in-the-loop simulation platform interface configuration. The boundary disturbance signal and boundary instability condition parameter sequence are input into the hardware-in-the-loop simulation platform according to the time sequence, and the corresponding disturbances are applied to the photovoltaic inverter under test through the digital input port and analog output port.
[0033] During the disturbance application process, electrical response, control status, and protection action results are collected according to the sampling period of the hardware-in-the-loop simulation platform. The collected electrical response, control status, and protection action results are compared with the instability judgment conditions. When the electrical response, control status, or protection action results meet the instability judgment conditions, an instability trigger record is generated. The differentiable operator mapping relationship and the instability trigger record are read. The control status field, disturbance action parameters, and synchronized photovoltaic environment twin state corresponding to the instability trigger record are input into the differentiable operator mapping relationship. Using the corresponding electrical response field and instability evaluation target as attribution references, operator gradient attribution is performed to obtain the gradient sensitivity of the instability evaluation target relative to the control status field. The phase-locked loop state, maximum power point tracking state, current control state, protection state, and grid-connected topology state are sorted from high to low according to gradient sensitivity. Based on the preset correspondence between the control status field and the phase-locked loop, maximum power point tracking loop, current control loop, protection logic, and topology switching logic, the corresponding defective control loop is determined. The control logic defect location results are determined based on the defect control links. The control logic defect location results include the defect control links, corresponding control status fields, trigger condition parameters, gradient sensitivity sorting, and instability trigger records.
[0034] In this embodiment, step seven specifically includes: The boundary stability margin is determined based on the Lyapunov exponent change and the phase trajectory boundary distance, and an anti-disturbance control optimization strategy and a hardware-in-the-loop test report are generated in conjunction with the control logic defect location results. Specifically, the control logic defect location results, instability trigger records, synchronized photovoltaic environment twin state, and inverter operating state are read; a stability margin evaluation state sequence is constructed based on the synchronized photovoltaic environment twin state and inverter operating state, and the phase space of the stability margin evaluation state sequence is reconstructed to generate the stability margin evaluation phase trajectory. The maximum Lyapunov exponent corresponding to the stability margin evaluation phase trajectory when no boundary instability condition parameter sequence is input is used as the benchmark exponent. The maximum Lyapunov exponent re-estimated within the corresponding time window when the instability judgment condition is met is used as the current exponent. The Lyapunov exponent change is determined based on the change magnitude of the current exponent relative to the benchmark exponent.
[0035] Based on the trigger time in the instability trigger record, the corresponding phase trajectory point is read from the stability margin evaluation phase trajectory, and the stable operating boundary is determined based on the stability margin evaluation phase trajectory when no boundary instability condition parameter sequence is input. The distance between the corresponding phase trajectory point and the nearest boundary point in the stable operating boundary is calculated for each time slice, and the minimum distance within a preset time window is determined as the phase trajectory boundary distance. Based on the preset correspondence between the Lyapunov exponent change interval, the phase trajectory boundary distance interval, and the stability margin level, the stability margin level is matched, and the stability margin level and its corresponding margin value are determined as the boundary stability margin.
[0036] Based on the control logic defect location results and boundary stability margin, an anti-disturbance control optimization strategy is generated. When the defective control loop in the control logic defect location results is a phase-locked loop (PLL), strategies for adjusting PLL bandwidth, phase error limiting, and frequency tracking filter parameters are generated based on the boundary stability margin. When the defective control loop is a maximum power point tracking (MPPT) loop, strategies for adjusting duty cycle change step size and power disturbance observation period are generated based on the boundary stability margin. When the defective control loop is a current control loop, strategies for adjusting current limiting, virtual damping, and current loop control quantities are generated based on the boundary stability margin. When the defective control loop is protection logic or topology switching logic, strategies for adjusting protection action threshold, protection delay, and topology switching timing are generated based on the boundary stability margin. The anti-disturbance control optimization strategy is generated by combining the defective control loop, corresponding control state fields, gradient sensitivity sorting, boundary stability margin, and corresponding control parameter adjustment methods. A hardware-in-the-loop test report is generated by summarizing the photovoltaic power plant operating environment data, boundary instability condition parameter sequences, boundary disturbance signals, electrical responses, control states, protection action results, control logic defect location results, boundary stability margin, and anti-disturbance control optimization strategies.
[0037] Example 1: To verify the feasibility of this invention in practice, it was applied to a hardware-in-the-loop simulation test scenario of a 1.25MW string photovoltaic inverter in a 50MW centralized photovoltaic power station. The power station was equipped with four inverters under test. The acquisition period was set to 10ms, the test time window was 300s, and the photovoltaic power station operating environment data included irradiance sampling sequences, module temperature sampling sequences, grid connection point voltage sampling sequences, grid connection point frequency sampling sequences, grid connection point phase sampling sequences, and grid connection point harmonic content sampling sequences. During preprocessing, the low-pass filter cutoff frequency was set to 80Hz, and missing sampling points exceeding five consecutive points were marked as missing. The amplitude normalization range was set to 0 to 1. In phase space reconstruction, the average mutual information method determined the time delay to be 6 sampling points, the pseudo-nearest neighbor method determined the target embedding dimension to be 5, the neighborhood radius was set to 0.08, the evolution step size was set to 4 sampling points, the fitting time interval was set to 0.12s to 0.8s, and the preset boundary disturbance discrimination threshold was set to 0.015. Calculations showed that the maximum Lyapunov exponent corresponding to irradiance disturbance was 0.023, and the maximum Lyapunov exponent corresponding to grid disturbance was 0.031. Both were marked as boundary disturbances, and a digital twin model of the photovoltaic environment was constructed based on this.
[0038] In this scenario, the actual operating state of a photovoltaic power plant serves as the driving system, and a digital twin model of the photovoltaic environment serves as the response system. Preset synchronization deviation thresholds are set as follows: irradiance deviation not exceeding 2.5%, grid connection point voltage deviation not exceeding 1.2%, frequency deviation not exceeding 0.04Hz, and phase deviation not exceeding 1.5°. Synchronization is generated when these thresholds are met for 20 consecutive time slices. Inverter operating states include DC-side voltage, DC-side current, AC-side voltage, AC-side current, phase-locked loop (PLL) phase, PLL frequency, maximum power point tracking (MPPT) duty cycle, current loop control parameters, protection status, and grid-connected topology status. Boundary disturbance intensity parameters in the disturbance action space range from 0.1 to 1.0, voltage drop fault parameters range from 0.2 pu to 0.9 pu, frequency offset fault parameters range from ±1.2Hz, phase jump fault parameters range from ±25°, and harmonic injection fault parameters range from 2% to 8%. Topology switching parameters include three states: grid-connected, power-limited grid-connected, and short-term disconnection and reconnection. The instability judgment criteria are set as follows: steady-state deviation exceeds 0.18, protection trigger state is abnormal trigger or oscillation index exceeds 0.15.
[0039] In the improved DeepONet operator model, the causal state embedding Branch Net uses a 128-dimensional branch coefficient vector, and the hidden dimension of the gated recurrent unit is set to 64. In the frequency-time dual-channel Trunk Net, the time-domain channel has 30,000 sampling points, and the frequency-domain channel extracts harmonic orders from 1 to 25. The Gaussian random field smoothing window is set to 0.5s, and the perturbation correlation weight is determined by the sampling time interval, amplitude difference, and phase trajectory distance. In the physically feasible domain, the grid-connected voltage is allowed to range from 0.2pu to 1.2pu, the grid-connected frequency is allowed to range from 48.8Hz to 51.2Hz, and the upper limit of harmonic content is 8%. In the gradient iteration, the initial step size is set to 0.04, the step size decay ratio is set to 0.85, the gradient clipping threshold is set to 3.0, and the maximum number of iterations is set to 60. Comparison method A is a fixed standard low voltage ride-through and frequency offset test method, comparison method B is a common digital twin hardware-in-the-loop test method, comparison method C is a test method using unmodified DeepONet, and the present invention is a test method using boundary perturbation characteristics, drive-response synchronization structure, improved DeepONet operator model and operator gradient attribution.
[0040] Table 1 Comparison of Hardware-in-the-Loop Simulation Test Results of Photovoltaic Inverters
[0041] As shown in Table 1, Method A relies on fixed standard operating conditions, and only 7 sets of boundary instability operating conditions were found. Furthermore, the accuracy rate for locating control logic defects was only 41.2%, indicating that it is more suitable for compliance testing and not for discovering hidden control defects close to the instability boundary. Method B, after introducing a standard digital twin, reduced the environmental state synchronization error to 5.1%, but due to the lack of a driver-response synchronization structure and an inversion mechanism for instability evaluation targets, the number of boundary instability operating conditions found remained limited. Method C, after adopting the unmodified DeepONet, reduced the average operating condition generation time to 61.5 seconds, indicating that the operator model can improve the efficiency of operating condition generation. However, due to the lack of causal state embedding Branch Net, frequency-time dual-channel Trunk Net, and photovoltaic circuit mechanism constraints, the defect location accuracy remained below 70%.
[0042] Under the same hardware-in-the-loop simulation platform, the environmental state synchronization error of this invention is reduced to 1.6%, indicating that the synchronized photovoltaic environment twin state can better follow the actual photovoltaic power station operation state; the number of boundary instability conditions detected reaches 34, an increase of 61.9% compared to method C, indicating that the iteration based on differentiable operator mapping relationship and physical feasible region can approach the instability boundary faster; the average condition generation time is 28.7s, which is 77.3% shorter than method A, reducing the testing cost of manually traversing fault combinations; the control logic defect location accuracy reaches 88.3%, mainly due to the operator gradient attribution being able to establish a correspondence between the instability evaluation target and the phase-locked loop, maximum power point tracking loop, current control loop, protection logic, and topology switching logic; the average error of boundary stability margin is reduced to 4.6%, indicating that the change in Lyapunov exponent and the distance to the phase trajectory boundary can more stably reflect the degree to which the inverter approaches the instability boundary.
[0043] As demonstrated in this embodiment, the present invention can generate boundary disturbance signals and boundary instability parameter sequences based on the actual operating state of a photovoltaic power plant without relying on extensive manual enumeration of operating conditions. It then completes the acquisition of electrical response, control status, and protection action results through a hardware-in-the-loop simulation platform. When the instability judgment condition is met, the present invention further performs operator gradient attribution based on differentiable operator mapping relationships to obtain control logic defect location results. Combined with boundary stability margins, it generates disturbance rejection control optimization strategies and hardware-in-the-loop test reports. Therefore, the present invention can improve the boundary instability test coverage of photovoltaic inverters, shorten the extreme condition generation time, and expand the test results from simple anomaly judgment to defect location and disturbance rejection optimization, making it suitable for inverter control strategy verification in large-scale new energy grid-connected scenarios.
[0044] The above are merely preferred embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A hardware-in-the-loop simulation and testing method for photovoltaic inverters based on digital twins, characterized in that, Includes the following steps: Step 1: Collect photovoltaic power plant operating environment data, and after preprocessing, identify the boundary disturbance characteristics of irradiance disturbance and grid disturbance based on phase space reconstruction and maximum Lyapunov exponent estimation, and construct a photovoltaic environment digital twin model; Step 2: Using the actual operating state of a photovoltaic power plant as the driving system and the photovoltaic environment digital twin model as the response system, establish a driving-response synchronization structure to generate the synchronized photovoltaic environment twin state; Step 3: Determine the test state space based on the inverter's operating state, determine the disturbance action space based on the boundary disturbance intensity, fault combination, and topology switching parameters, and determine the instability evaluation target and instability judgment conditions; Step 4: Input the test state space, disturbance action space, and synchronized photovoltaic environment twin state into the improved DeepONet operator model. Generate differentiable operator mapping relationship by embedding causal state into Branch Net, frequency domain-time domain dual-channel Trunk Net, and photovoltaic circuit mechanism constraints. Step 5: Based on the differentiable operator mapping relationship, calculate the gradient of the instability evaluation target with respect to the disturbance action parameters, and iteratively generate the boundary instability condition parameter sequence within the physical feasible region; Step 6: Input the boundary disturbance signal and boundary instability condition parameter sequence generated based on the synchronized photovoltaic environment twin state into the hardware-in-the-loop simulation platform, collect the electrical response, control state and protection action results, and when the instability judgment condition is met, perform operator gradient attribution based on the differentiable operator mapping relationship to obtain the control logic defect location result; Step 7: Determine the boundary stability margin based on the Lyapunov exponent change and the phase trajectory boundary distance, and generate an anti-disturbance control optimization strategy and a hardware-in-the-loop test report based on the control logic defect location results.
2. The hardware-in-the-loop simulation and testing method for photovoltaic inverters based on digital twins according to claim 1, characterized in that, The photovoltaic power station operating environment data includes irradiance sampling sequence, module temperature sampling sequence, grid connection point voltage sampling sequence, grid connection point frequency sampling sequence, grid connection point phase sampling sequence, and grid connection point harmonic content sampling sequence; Based on the sampling timestamp, the photovoltaic power plant operating environment data is time-aligned, abnormal format data is removed, missing sampling points are marked, filtered, trend terms are deducted, and amplitude is normalized to generate a standard environmental time series. The average mutual information method is used to determine the time delay, the pseudo-nearest neighbor method is used to determine the target embedding dimension, and the standard environmental time series are arranged into photovoltaic environmental phase trajectories according to the time delay and the target embedding dimension. Based on the neighborhood radius, evolution step size and fitting time interval, the separation distance between neighboring trajectory points is calculated, and the maximum Lyapunov exponent is obtained according to the growth slope of the separation distance. When the maximum Lyapunov exponent is greater than the preset boundary disturbance discrimination threshold, the corresponding irradiance disturbance or grid disturbance is marked as a boundary disturbance, and the amplitude boundary, rate of change boundary, dominant frequency band and phase trajectory boundary are extracted from the photovoltaic environment phase trajectory. The disturbance mapping parameters are configured based on the amplitude boundary, rate of change boundary, dominant frequency band and phase trajectory boundary, and the disturbance mapping parameters, irradiance disturbance markers and grid disturbance markers are written into the photovoltaic environment digital twin model to generate irradiance disturbance data and grid disturbance data.
3. The hardware-in-the-loop simulation and testing method for photovoltaic inverters based on digital twins according to claim 1, characterized in that, Step two specifically includes: The actual operating status of the photovoltaic power station includes real-time irradiance, module temperature, grid connection point voltage, grid connection point frequency, grid connection point phase, grid connection point harmonic content, and inverter grid connection power. The actual operating status of the photovoltaic power station is sorted according to the sampling timestamp to generate a driving state sequence; The photovoltaic environment digital twin model outputs irradiance disturbance data and grid disturbance data according to the same sampling timestamp as the driving state sequence, and generates a response state sequence; A drive-response synchronization structure is established by using the drive state sequence as the drive system and the response state sequence as the response system. The state deviation between the driving state sequence and the response state sequence in terms of irradiance, grid connection point voltage, grid connection point frequency, grid connection point phase, and grid connection point harmonic content is calculated based on time slices. Synchronization corrections are generated based on state deviations, and these corrections are used to correct the disturbance mapping parameters in the photovoltaic environment digital twin model. When the state deviation within a preset number of consecutive time slices does not exceed the preset synchronization deviation threshold, the corrected response state sequence is determined as the synchronized photovoltaic environment twin state.
4. The hardware-in-the-loop simulation and testing method for photovoltaic inverters based on digital twins according to claim 1, characterized in that, Step three specifically includes: The inverter operating status includes DC side voltage, DC side current, AC side voltage, AC side current, phase-locked loop phase, phase-locked loop frequency, maximum power point tracking duty cycle, current loop control quantity, protection status, and grid-connected topology status. The inverter's operating status is matched with the synchronized photovoltaic environment twin status according to the sampling timestamp to generate an inverter status record; Extract the DC side status, AC side status, phase-locked loop status, maximum power point tracking status, current control status, protection status, and grid-connected topology status from the inverter status record to generate the test state space; Based on boundary disturbance strength parameters, voltage drop fault parameters, frequency offset fault parameters, phase jump fault parameters, harmonic injection fault parameters, and topology switching parameters, fault combinations are generated, and disturbance action space is generated based on boundary disturbance strength parameters, fault combinations, and topology switching parameters. The current operating state in the test state space is compared with the preset steady-state benchmark to determine the degree of steady-state deviation. The protection trigger status is determined based on the protection trigger type, protection trigger time, protection execution status, and protection reset status; The oscillation index is determined based on the number of alternating directions and amplitude variations of the AC side voltage, AC side current, and phase-locked loop frequency within a continuous time slice. Based on the steady-state deviation, protection trigger state, and oscillation index, an instability evaluation target is generated, and instability judgment conditions are determined.
5. The hardware-in-the-loop simulation and testing method for photovoltaic inverters based on digital twins according to claim 1, characterized in that, Step four specifically includes: The test state space, disturbance action space, and synchronized photovoltaic environment twin state are paired according to the same sampling timestamp to generate standard operator input samples; The improved DeepONet operator model includes a causal state embedding Branch Net, a frequency-time dual-channel TrunkNet, an operator fusion unit, a photovoltaic circuit mechanism constraint unit, and an instability evaluation output unit; Inverter status, disturbance action parameters, irradiance disturbance data, and grid disturbance data are extracted from the standard operator input samples. Disturbance correlation weights are constructed based on the sampling time interval, amplitude difference, and phase trajectory distance of the photovoltaic environment for the irradiance disturbance data and grid disturbance data. Gaussian random field smoothing and variance estimation are performed on the irradiance disturbance data and grid disturbance data based on the disturbance correlation weights to generate disturbance prior vectors. Extract the inverter state of the previous moment, the current disturbance action parameters, and the synchronized photovoltaic environment twin state under the current sampling timestamp from the standard operator input samples, and concatenate them with the disturbance prior vector according to the feature dimension to generate the Branch Net input sequence. A causal transit mask is generated based on the protection state and the grid topology state. The Branch Net input sequence and the causal transit mask are then embedded into the Branch Net, and the branch coefficient vector is generated after ReLU activation, Tanh limiting mapping and gated loop processing. Input the sampling time point into the time channel of the frequency-time dual-channel Trunk Net to generate a time-domain basis function vector; input the frequency point and harmonic order into the frequency channel to generate a frequency-domain basis function vector. The channel fusion weights are determined based on the perturbation action parameters. The time-domain basis function vectors and frequency-domain basis function vectors are weighted and concatenated to generate dual-channel basis function vectors. The branch coefficient vector and the dual-channel basis function vector are fused by an operator fusion unit to generate the electrical response operator output. The photovoltaic circuit mechanism constraint unit performs DC-side power balance, AC-side voltage and current, grid connection point power conservation, inverter current limiting and protection action timing constraint verification on the output of the electrical response operator, and generates mechanism constraint deviation. The instability evaluation operator output is generated based on the standard operator input sample, electrical response operator output, mechanism constraint deviation, and instability evaluation target, and the differentiable operator mapping relationship is determined.
6. The hardware-in-the-loop simulation and testing method for photovoltaic inverters based on digital twins according to claim 1, characterized in that, Step five specifically includes: Extract boundary disturbance intensity parameters, fault combination parameters, and topology switching parameters from the disturbance action space to generate initial disturbance action parameters; The physical feasible region is determined based on the allowable range of grid-connected voltage, the allowable range of grid-connected frequency, the range of phase change, the upper limit of harmonic content, the upper limit of boundary disturbance intensity, and the legal state of topology switching. The initial disturbance action parameters are input into the differentiable operator mapping relationship to obtain the electrical response operator output and the instability evaluation operator output, and the current instability evaluation value is calculated according to the instability evaluation target; The inverse automatic differentiation is performed on the current instability evaluation value relative to the disturbance action parameters to obtain the instability gradient vector; The perturbation action parameters are updated according to the preset step size, step size decay ratio, gradient clipping threshold and maximum number of iterations, and the updated perturbation action parameters are projected onto the physical feasible region. Repeat the calculation of the instability gradient vector, the update of the disturbance action parameters, and the projection of the physical feasible region until the current instability evaluation value reaches the preset target range, the increment of the instability evaluation value between two adjacent iterations is less than the preset increment threshold, or the number of iterations reaches the maximum number of iterations. Arrange the perturbation action parameters that satisfy the physical feasible region constraint in the order of iteration time to generate the parameter sequence of boundary instability conditions.
7. The hardware-in-the-loop simulation and testing method for photovoltaic inverters based on digital twins according to claim 1, characterized in that, Step six specifically includes: Irradiance disturbance data and grid disturbance data are extracted based on the synchronized photovoltaic environment twin state, and boundary disturbance signals are generated by combining the boundary instability condition parameter sequence. Based on the hardware-in-the-loop simulation platform interface configuration, the boundary disturbance signal is mapped to an irradiance simulation signal, a grid connection point voltage disturbance signal, a grid connection point frequency disturbance signal, a phase disturbance signal, and a harmonic injection signal. According to the time sequence of the boundary instability condition parameter sequence, the boundary disturbance signal is input into the hardware-in-the-loop simulation platform, and the corresponding disturbance is applied to the photovoltaic inverter under test; During the disturbance application process, electrical response, control status and protection action results are collected and compared with instability judgment conditions. When the instability judgment conditions are met, an instability trigger record is generated. The control state field, disturbance action parameters, and synchronized photovoltaic environment twin state corresponding to the instability trigger record are input into the differentiable operator mapping relationship, and the operator gradient attribution is performed with the electrical response field and instability evaluation target as attribution references to obtain the gradient sensitivity of the control state field. The phase-locked loop status, maximum power point tracking status, current control status, protection status, and grid-connected topology status are sorted according to gradient sensitivity, and the defective control link is determined based on the correspondence between the control status field and the control link. The defect location results of the control logic are generated based on the defect control process.
8. The hardware-in-the-loop simulation and testing method for photovoltaic inverters based on digital twins according to claim 1, characterized in that, Step seven specifically includes: Based on the control logic defect location results, instability trigger records, the synchronized photovoltaic environment twin state and inverter operating state, a stability margin evaluation state sequence is constructed, and the stability margin evaluation state sequence is reconstructed in phase space to generate a stability margin evaluation phase trajectory. The maximum Lyapunov exponent corresponding to the stability margin evaluation phase trajectory when no boundary instability condition parameter sequence is input is used as the benchmark exponent. The maximum Lyapunov exponent obtained by re-estimating the stability margin evaluation phase trajectory within the corresponding time window when the instability judgment condition is met is used as the current exponent, and the change in Lyapunov exponent is determined. Based on the trigger time in the instability trigger record, the corresponding phase trajectory point in the stability margin evaluation phase trajectory is read, and the stable operating boundary is determined based on the stability margin evaluation phase trajectory when no boundary instability condition parameter sequence is input, and the phase trajectory boundary distance is calculated. The boundary stability margin is determined based on the change in the Lyapunov exponent and the distance to the phase trajectory boundary. When the defect control loop is a phase-locked loop, strategies for adjusting the phase-locked loop bandwidth, limiting the phase error, and adjusting the frequency tracking filter parameters are generated based on the boundary stability margin. When the defect control loop is the maximum power point tracking loop, a duty cycle change step size adjustment and power disturbance observation period adjustment strategy are generated based on the boundary stability margin. When the defect control loop is a current control loop, current limiting, virtual damping and current loop control quantity adjustment strategies are generated based on the boundary stability margin. When the defect control loop is protection logic or topology switching logic, the protection action threshold, protection delay and topology switching timing adjustment strategy are generated based on the boundary stability margin. Based on the control logic defect location results, boundary stability margin, and control parameter adjustment strategy, an anti-disturbance control optimization strategy is generated. The boundary instability condition parameter sequence, boundary disturbance signal, electrical response, control state, protection action results, control logic defect location results, boundary stability margin, and anti-disturbance control optimization strategy are summarized to generate a hardware-in-the-loop test report.
Citation Information
Patent Citations
Diagnostic analysis method and system based on digital twinborn technology and intelligent management and control platform
CN119834726A
Method and apparatus for identifying control parameters of photovoltaic inverter
WO2022037581A1