Grid synchronization control method, device and equipment of photovoltaic inverter and medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHANGSHA UNIVERSITY OF SCIENCE AND TECHNOLOGY
- Filing Date
- 2026-05-27
- Publication Date
- 2026-08-07
AI Technical Summary
[0003]尽管如此,现有锁相环在动力学性能上仍面临突出问题,一方面,传统PI调节器受限于“响应速度与稳定性”之间的固有矛盾,参数调节存在两难局面:若提高PI参数以期加快响应速度,则极易导致系统超调、震荡甚至锁相失稳,尤其在电网电压出现跌落、突升等扰动时表现更加明显;另一方面,为防止系统震荡通常需适当降低PI参数,进而又导致锁相追踪电网相位的速度显著变慢,系统瞬态响应迟滞,逆变器无法实时同步跟踪电网,有可能引发离网、失步等安全隐患
[0050]本发明通过基于轻量级递归神经网络的动态相位趋势预测机制,构建q轴电压残差序列,以预测未来控制周期的相位变化趋势,与传统PI反馈控制仅依赖当前误差进行调节的方式相比,本发明的方法能够在电压扰动发生前主动输出补偿相位增量,显著提前了相位跟踪响应时机,有效缩短了同步建立时间;特别是在电压突变、频率跳变等暂态工况下,系统可凭借预测通道快速调整输出频率指令,避免了传统方法因积分累积滞后导致的相位超调或失锁风险,大幅提升了锁相环在复杂非理想电网条件下的动态适应能力;
Smart Images

Figure CN122267879B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power supply circuit system technology, and in particular to a grid-connected synchronous control method, device, equipment and medium for photovoltaic inverters. Background Technology
[0002] In the fields of new energy power generation and photovoltaic grid connection, inverter synchronization with the grid is a crucial link in the stable operation of grid-connected power generation systems. Currently, inverter grid-connected synchronization control commonly employs phase-locked loop (PLL) technology, which detects and tracks the grid voltage phase at the grid connection point (PCC) to synchronize the inverter's output current with the grid voltage. However, the mainstream existing PLL solutions are mostly SRF-PLL (Synchronous Rotating Coordinate PLL), DSOGI-PLL (Dual Quadratic Generalized Integral PLL), and DSP implementations with PI (Proportional-Integral) regulation. These systems typically rely on fine tuning of the PI parameters, continuously correcting the synchronization angle through feedback loops to improve grid-connected synchronization accuracy. Under normal operating conditions, such PLL structures can meet the synchronization speed and accuracy requirements and have become a widely adopted general solution in the industry.
[0003] Despite this, existing phase-locked loops (PLLs) still face significant challenges in dynamic performance. On one hand, traditional PI regulators are constrained by the inherent contradiction between response speed and stability, leading to a dilemma in parameter adjustment: increasing PI parameters to accelerate response speed can easily cause system overshoot, oscillation, or even PLL instability, especially when grid voltage drops or surges occur. On the other hand, to prevent system oscillation, PI parameters usually need to be appropriately reduced, which significantly slows down the PLL's tracking speed of the grid phase, resulting in sluggish transient response and the inverter's inability to synchronize with the grid in real time, potentially causing safety hazards such as grid disconnection and loss of synchronization. These problems are particularly prominent in new scenarios such as complex grid environments, load fluctuations, and large-scale integration of distributed power sources, directly affecting the power quality and grid connection security of photovoltaic systems.
[0004] Furthermore, while some technologies utilize high-order harmonic detection, adaptive filtering, and signal observation to enhance phase-locked loop (PLL) sensitivity, these often require higher sampling rates and DSP computing resources, potentially leading to reduced system complexity and reliability. Model predictive control and other technologies, while forward-looking, are highly dependent on grid parameters, lack portability and compatibility, and are difficult to implement. Overall, the industry lacks a system-level optimization solution that can simultaneously balance the dynamic response speed and steady-state control stability of PLLs without increasing system structural complexity or significantly raising hardware requirements. Summary of the Invention
[0005] The purpose of this invention is to provide a grid-connected synchronization control method, device, equipment, and medium for photovoltaic inverters. By using a recurrent neural network for phase deviation prediction, it overcomes the phase error problem caused by the lag in traditional PI control, and effectively improves the accuracy and stability of grid-connected synchronization of photovoltaic inverters.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is: a grid-connected synchronous control method for a photovoltaic inverter, comprising the following steps:
[0007] S1: Real-time acquisition of three-phase voltage signals at the power grid common connection point, and preprocessing of the three-phase voltage signals to obtain the q-axis voltage residual;
[0008] S2: The q-axis voltage residual is serialized and sampled to construct a short-time phase deviation time series;
[0009] S3: Input the short-time phase deviation time series into a pre-trained recurrent neural network model to obtain the predicted phase angle increment; wherein, the pre-trained recurrent neural network model is obtained by training based on the existing short-time phase deviation time series;
[0010] S4: Based on the predicted phase angle increment and combined with the photovoltaic grid-connected operating conditions, the synchronous phase angle is calculated;
[0011] S5: Based on the aforementioned synchronization phase angle, control the grid-connected synchronization phase of the photovoltaic inverter.
[0012] By using the q-axis voltage residual sequence and a lightweight recurrent neural network to predict the dynamic phase trend, the phase change trend within the future control cycle can be obtained. This allows for proactive output of compensating phase increments before voltage disturbances occur, effectively improving the dynamic adaptability under complex and non-ideal power grid conditions.
[0013] Furthermore, in S2, constructing the short-time phase deviation time series specifically includes:
[0014] S2.1: Divide the complete power frequency cycle interval based on the power grid voltage frequency estimation result, and perform whole power frequency cycle alignment processing on the q-axis voltage residual according to the power frequency cycle interval;
[0015] S2.2: Construct a sliding time window, perform serial sampling on the q-axis voltage residual after the full power frequency cycle alignment within the sliding time window, and obtain the short-time phase deviation time series;
[0016] The sliding time window is configured with a window length based on a preset fixed number of complete power frequency cycles.
[0017] By aligning the q-axis voltage residual with the full power frequency cycle and using a sliding time window with a fixed power frequency cycle length for sampling, the temporal regularity and feature validity of the short-time phase deviation time series can be guaranteed. This solves the problem of spectral aliasing and period mismatch that are easily introduced by conventional irregular short-time sampling, thus providing highly consistent input samples for subsequent recurrent neural networks.
[0018] Furthermore, in S4, the specific calculation process for the synchronization phase angle includes:
[0019] The angular frequency output by the PI controller is weighted and fused with the predicted phase angle increment to obtain the composite angular frequency;
[0020] The synchronous phase angle is obtained by integrating the composite angular frequency.
[0021] The composite angular velocity is obtained by weighted fusion of PI output angular frequency and predicted phase increment, and the synchronization phase is solved by integration. Through predictive compensation, the phase lag problem of traditional PI integral control is effectively overcome, and the accuracy and fit of synchronization phase calculation are greatly improved.
[0022] Furthermore, the weighting coefficients of the weighted fusion are dynamically adjusted according to the photovoltaic grid-connected operating conditions:
[0023] When a grid voltage surge is detected to exceed a preset threshold, the weighting coefficient corresponding to the angular frequency output by the PI controller is reduced. This reduces the PI control weight during voltage surges, ensuring that the system has a higher dynamic response capability during disturbances. This maintains the synchronization stability and real-time response of the phase-locked loop system under grid voltage surge conditions.
[0024] Furthermore, the integration operation on the composite angular frequency includes integration using a nonlinear integral gain, and the calculation steps for the nonlinear integral gain coefficient specifically include:
[0025] S4.1: Perform absolute value calculation on the q-axis voltage residual output at the current moment to obtain the phase error intensity index;
[0026] S4.2: Based on the preset nonlinear gain function structure, the high-voltage residual interval and the low-voltage residual interval are divided according to the phase error intensity index;
[0027] S4.3: Within the high-voltage residual range, the first slope function is used to map the phase error intensity index to generate the first gain coefficient;
[0028] Within the low-voltage residual range, the second slope function is switched to map the phase error intensity index to generate a second gain coefficient.
[0029] S4.4: Smoothly connect the first slope function and the second slope function at a preset segmentation threshold point to obtain a nonlinear gain function curve;
[0030] S4.5: Obtain the nonlinear integral gain coefficient based on the nonlinear gain function curve.
[0031] The phase error intensity index is constructed by using the q-axis voltage residual. The high and low gain slopes are matched in intervals and smoothly connected to form a nonlinear integral gain. This overcomes the inherent defects of fixed integral gain, such as slow convergence under large errors and easy overshoot and drift under small errors. High gain is used for fast debiasing when the residual is large, and low gain is used for stable convergence when the residual is small, thus balancing dynamic correction efficiency and steady-state control accuracy.
[0032] Furthermore, the division of the high-voltage residual interval and the low-voltage residual interval based on the phase error intensity index specifically includes:
[0033] When the grid voltage suddenly changes or the synchronization offset exceeds the preset segmentation threshold, the current interval is divided into a high-voltage residual interval.
[0034] When the grid voltage is in steady-state operation or the synchronization deviation is lower than the preset segmentation threshold, the current interval is divided into the low-voltage residual interval.
[0035] By dividing the high and low residual ranges based on threshold determination, it is possible to accurately distinguish between power grid disturbances and steady-state operating conditions, adapt to differentiated gain adjustment logic, and enhance the adaptation and adjustment effect under different operating conditions.
[0036] Furthermore, it also includes adaptively updating the piecewise threshold of the nonlinear gain function, specifically including the following steps:
[0037] S4.6.1: Based on the absolute value of the d-axis voltage residual, the current operating range is divided into a steady-state range or a disturbance range, and the initial segmentation threshold parameter set of the nonlinear integral gain function is determined based on the divided operating range; wherein, the d-axis voltage residual is obtained by preprocessing the three-phase voltage signal;
[0038] S4.6.2: Adjust the dynamic correction factor of the nonlinear integral gain function according to the d-axis voltage residual;
[0039] S4.6.3: Based on the dynamic correction factor and the current operating state division result, update the set of piecewise threshold parameters in the nonlinear gain function to generate the updated set of piecewise threshold parameters.
[0040] The operating range is divided in real time by the d-axis voltage residual, the gain segment threshold is dynamically corrected and updated online to adapt to the fluctuation of operating conditions, so that the nonlinear integral gain strategy can be adaptively optimized with the grid condition and continuously adapt to the actual grid-connected operation requirements.
[0041] Based on the same concept, the present invention also provides a grid-connected synchronization control device for a photovoltaic inverter, which is used to implement the above method, the device comprising:
[0042] The voltage acquisition module is used to acquire the three-phase voltage signal at the point of common coupling of the power grid in real time, and to preprocess the three-phase voltage signal to obtain the q-axis voltage residual.
[0043] The time series construction module is used to serialize and sample the q-axis voltage residual to construct a short-time phase deviation time series.
[0044] The phase angle increment prediction module is used to input the short-time phase deviation time series into a pre-trained recurrent neural network model to obtain the predicted phase angle increment; wherein, the pre-trained recurrent neural network model is obtained by training based on the existing short-time phase deviation time series.
[0045] The synchronization phase angle calculation module is used to calculate the synchronization phase angle based on the predicted phase angle increment and the photovoltaic grid-connected operating conditions.
[0046] The photovoltaic inverter control module is used to control the grid-connected synchronization phase of the photovoltaic inverter based on the synchronization phase angle.
[0047] Based on the same concept, the present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described above.
[0048] Based on the same concept, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described above.
[0049] Compared with the prior art, the beneficial effects of the present invention are:
[0050] This invention constructs a q-axis voltage residual sequence based on a dynamic phase trend prediction mechanism using a lightweight recurrent neural network to predict the phase change trend of future control cycles. Compared with the traditional PI feedback control method that only relies on the current error for adjustment, the method of this invention can actively output a compensating phase increment before voltage disturbances occur, significantly advancing the phase tracking response timing and effectively shortening the synchronization establishment time. Especially under transient conditions such as voltage sudden changes and frequency jumps, the system can quickly adjust the output frequency command with the help of the prediction channel, avoiding the risk of phase overshoot or loss of lock caused by integral accumulation lag in traditional methods, and greatly improving the dynamic adaptability of the phase-locked loop under complex and non-ideal power grid conditions.
[0051] Furthermore, this invention dynamically synthesizes the angular frequency output by the PI controller and the predicted phase angle increment generated by the prediction channel to form a composite angular frequency command. The weighting coefficients can be adaptively adjusted based on disturbance characteristics such as the voltage change rate detected in real time: under strong disturbance conditions, the weighting coefficients are automatically reduced to enhance the dominant role of the prediction term and improve response sensitivity; under steady-state operation, the weighting coefficients are increased to strengthen the steady-state suppression capability of the PI feedback loop, thereby achieving rapid response under disturbance conditions and accurate convergence under steady-state conditions.
[0052] Meanwhile, a nonlinear gain function is introduced before the integration stage, enabling the system to use high gain to accelerate the convergence process when the q-axis voltage component is large, and smoothly switch to low gain mode when approaching the synchronization state. This effectively suppresses the oscillation phenomenon near the steady state and further enhances the smoothness and robustness of the transient process. Attached Figure Description
[0053] To more clearly illustrate the technical method of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only one embodiment of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 This is a flowchart of a grid-connected synchronization control method for a photovoltaic inverter according to an embodiment of the present invention. Detailed Implementation
[0055] The technical methods of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0056] The technical methods of this application will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0057] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0058] The following disclosure provides many different embodiments or examples for implementing different structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the invention. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0059] Example 1
[0060] Figure 1 A flowchart of the grid-connected synchronization control method for a photovoltaic inverter provided in an embodiment of the present invention is shown, as follows: Figure 1 As shown, the method specifically includes the following steps:
[0061] S1: Real-time acquisition of three-phase voltage signals at the power grid common connection point, and preprocessing of the three-phase voltage signals to obtain q-axis voltage residuals; wherein, the preprocessing includes performing Clark coordinate transformation to generate voltage components in the αβ stationary coordinate system, and calculating the q-axis voltage residuals based on the voltage components.
[0062] S1.1: The three-phase voltage signal of the power grid at the point of common coupling (PCC) is collected based on the three-phase voltage sensor to obtain the original voltage analog signal input, which serves as the basic data source for subsequent coordinate transformation;
[0063] Based on a three-phase voltage sensor array installed at the point of common coupling (PCC), the sampling object is set as the three-phase AC voltage signal of the power grid. This serves as the data source for subsequent coordinate transformations;
[0064] A high-precision RMS voltage sensor (parameters: linearity error ≤0.1%, response time ≤200μs) is used to realize real-time sensing and output of three-phase voltage waveforms, and the introduction of external electromagnetic interference is reduced by shielded twisted pair structure;
[0065] Furthermore, by using differential sampling (sampling frequency: ≥10kHz), phase consistency acquisition of the three-phase signal is achieved, and continuous waveform data in the analog domain is obtained to ensure that the instantaneous values required for coordinate system transformation are not missed or have phase shifts.
[0066] Furthermore, for the analog signal at the sensor output, a low-noise operational amplifier buffer circuit (with gain set to 1) is introduced at the front end to achieve signal impedance matching and stable driving capability, so as to prevent waveform distortion caused by the sampling charging and discharging effect of the analog-to-digital conversion input port.
[0067] Furthermore, by configuring an anti-aliasing filter (with a cutoff frequency set to 4.5kHz) at the sensor output, the high-frequency isolated wave components are suppressed from entering the downstream analog-to-digital conversion process, thereby reducing interference from irrelevant frequency components in the digital domain sampling sequence.
[0068] Through the above-mentioned combined sampling link, the three-phase voltage analog signal of the power grid is output to the analog-to-digital conversion unit in high-fidelity form, realizing the technical conditions for constructing the original sampling base current, and providing a stable and accurate input for subsequent Clark coordinate transformation and αβ component calculation;
[0069] For example, in a distributed photovoltaic grid-connected system, a high-precision voltage sensor, model HV-3P-0.1, is selected as the three-phase voltage sensor at the point of common coupling. The sensor has a rated range of 0~500V, a linearity error of 0.05%, and a response time of 150μs. The sampling frequency is set to 12kHz, and a 24-bit differential sampling module is selected. Type-following ADC front-end structure. In actual operation, the acquired u a =235.4V, u b =234.9V, u c =234.7V, corresponding to phases of 0°, −120°, and 120°, respectively, and the periodic waveform recording shows a constant phase difference. The anti-aliasing filter parameters are a second-order RC structure. When the cutoff frequency is set to 4.8kHz, it can significantly suppress noise frequency components higher than 6kHz in a laboratory power grid environment, and reduce the harmonic distortion rate of the sampled data waveform to 0.3%. Under the above configuration, the signal waveform at the analog-to-digital converter input terminal has no step distortion, and the αβ components obtained after Clark transformation can maintain a phase error within 0.01°, supporting the dynamic phase difference compensation control strategy of the grid-connected inverter phase-locked loop to achieve a high-response and stable synchronization effect.
[0070] S1.2: Perform analog-to-digital conversion processing on the acquired three-phase voltage analog signal to obtain a digital voltage sampling sequence, where k represents the current sampling time, thereby converting the voltage signal from an analog signal to a digital signal;
[0071] S1.3: Perform coordinate transformation processing on the three-phase voltage digital sampling sequence based on the Clark transformation matrix to obtain the voltage components in the αβ stationary coordinate system;
[0072] Digital sampling sequence Matrix operation method (parameter: Clark transformation matrix) This enables the orthogonal mapping from the three-phase stationary coordinate system to the two-phase αβ stationary coordinate system.
[0073] Through the preset Clark transformation matrix values This enables element-wise multiplication and grouped addition of matrix coefficients with the current sampled value, and obtains intermediate results for the α and β components.
[0074] Furthermore, using the formula for the product of a matrix and a column vector:
[0075] ;
[0076] in, The instantaneous voltage component along the α-axis. For the β-axis instantaneous voltage component;
[0077] This matrix operation transforms the three-phase non-quadrature signal space into a two-phase quadrature component space, reducing the complexity of phase calculation and providing orthogonal voltage components for subsequent Park transform.
[0078] By using a clear matrix coefficient mapping step, the digital voltage sampling results from the previous step are transformed into voltage components in the αβ stationary coordinate system, achieving the orthogonal decoupling effect before coordinate space rotation.
[0079] For example, in a scenario where the rated voltage at the PCC point is 380V and the sampling frequency is 10kHz, ub k =−110.0V, When using the Clark transformation matrix described above Perform a product operation:
[0080] Calculated ,
[0081] ,have to Under these sampling conditions, the output αβ components, after subsequent low-pass filtering, can significantly improve the accuracy of the Park transform in calculating the q-axis residual, thus supporting the stability of the dynamic phase trend prediction process.
[0082] S1.4: Perform low-pass filtering on the voltage components in the αβ coordinate system obtained by transformation to remove high-frequency noise components and improve the calculation accuracy of the q-axis voltage residual in the subsequent Park transformation. The filter used is a second-order Butterworth low-pass filter with a cutoff frequency of 1kHz.
[0083] S1.5: The filtered voltage components in the αβ coordinate system are used as the output results to obtain the q-axis voltage residual uq(k) based on the Park transform, and then a short-time phase deviation time series is constructed to support the preparation of input data for the dynamic phase trend prediction model.
[0084] S1.6: Based on the filtered αβ stationary coordinate system voltage components, perform Park coordinate transformation, using the current synchronization phase angle as the reference angle, to obtain the q-axis voltage residual in the rotating coordinate system, which serves as the phase-locked loop control error signal;
[0085] The filtered voltage components in the αβ stationary coordinate system and As input variables, the Park coordinate transformation algorithm is used (parameter: reference phase angle). This allows the voltage in the stationary coordinate system to be projected onto the d and q axes in the synchronously rotating coordinate system.
[0086] By constructing the Park transformation matrix This achieves a linear mapping from the αβ component to the dq component, and yields the instantaneous voltage component u in the rotating coordinate system. d with u q ;
[0087] Furthermore, through the formula This enables the numerical calculation of the q-axis voltage residual, thereby obtaining the phase-locked loop control error signal.
[0088] Through the above calculation process, the αβ component output by the Clark transform is converted into the q-axis component that reflects the phase deviation, ensuring that the component has a monotonic response characteristic to the synchronization error, making it suitable as a unified error signal source for the phase-locked loop PI controller and prediction module.
[0089] For example, in an embedded DSP controller for distributed photovoltaic grid connection, let the filtered αβ components be... and The measured phase angle θ is 1.0472 radians, calculated using the Park transformation matrix. The residual value increases significantly under the condition of sudden change in grid voltage, triggering the subsequent sliding time window serial sampling and adaptive weighted fusion process, thereby achieving a significant improvement in phase fast tracking and synchronization stability.
[0090] S2: The q-axis voltage residual is serialized and sampled to construct a short-time phase deviation time series.
[0091] S2.1: Based on the power grid voltage frequency estimation results, divide the complete power frequency cycle interval, and perform whole power frequency cycle alignment processing on the q-axis voltage residual according to the power frequency cycle interval:
[0092] The q-axis voltage residuals within multiple consecutive power frequency cycles are periodically aligned, and the complete power frequency cycle intervals are divided based on the power grid voltage frequency estimation results to ensure that the time series maintains continuity and consistency at the cycle boundaries.
[0093] S2.2: Construct a sliding time window, perform serialized sampling within the sliding time window on the q-axis voltage residuals that have completed full power frequency cycle alignment, and obtain a short-term phase deviation time series;
[0094] Among them, the sliding time window configures the window length according to a preset fixed number of full power frequency cycles. Specifically, the window length is set to N consecutive power frequency cycles, and serialized sampling within the sliding time window is performed on the q-axis voltage residuals to obtain a short-term phase deviation time series;
[0095] Based on the q-axis voltage residual sequence after cycle alignment processing, adopt a sliding time window construction method (parameter: window length N consecutive power frequency cycles) to achieve time domain coverage and overlap control between adjacent sampling frames, so as to ensure the smooth connection and continuous tracking of phase change characteristics during the serialized sampling process;
[0096] Furthermore, through a window shift control algorithm (parameter: shift step P, P < N), realize the per-cycle rolling update of the sampling window, and calibrate the time stamp for each sampling point within the window to ensure that trend analysis can be carried out based on an accurate time reference in the subsequent feature extraction stage;
[0097] Furthermore, perform index reconstruction operation on the q-axis voltage residual sampling values within the sliding time window, use a linear queue structure to enqueue the latest sampling point and dequeue the earliest sampling point, and form an ordered sampling vector with a fixed length to eliminate the influence of data jumps at the queue boundary on the phase deviation calculation;
[0098] Furthermore, calculate the short-term phase deviation time series of the sampling sequence within the window through the following formula to form the input data of the prediction model:
[0099] ;
[0100] where, u q is the q-axis voltage residual sampling value, is the sampling index of the current control cycle, is the number of power frequency cycles within the window;
[0101] Through windowed sampling and serialized index management, convert the previous cycle alignment processing result into a short-term phase deviation time series that can be directly used as the input of a recurrent neural network, and achieve high-fidelity capture and feature retention of the phase dynamic trend;
[0102] For example, under a rated grid frequency of 50Hz, a window length of N=5 consecutive power frequency cycles and a shift step size of P=1 cycle are selected to window the q-axis voltage residual sample values after cycle alignment. The sampling frequency is set to 10kHz, so that each cycle contains 200 sample values. The initial queue of the sliding time window loads 5×200=1000 sample points, and then every shift of 1 cycle, the last 200 points of the queue are replaced with the latest sample values. In a real-world scenario, the short-time phase deviation time series formed by this method has a length of 1000, and each sample point is bound to a timestamp in microseconds for the recurrent neural network to learn time-series features. When the grid voltage frequency is disturbed to 51Hz, the windowed sampling still maintains the continuity of the phase change curve, and the maximum mean square error between the feature waveform and the original signal phase error curve is reduced to one-third of the original, significantly improving the input quality and stability of the prediction model.
[0103] Normalization is performed on the q-axis voltage residual sequence obtained within the sliding time window to eliminate the influence of grid voltage amplitude fluctuations on phase trend prediction, thereby obtaining the normalized short-time phase deviation time series and completing the construction of the short-time phase deviation time series.
[0104] S3: Input the short-time phase deviation time series into a pre-trained recurrent neural network model to obtain the predicted phase angle increment; wherein, the pre-trained recurrent neural network model is obtained by training based on the existing short-time phase deviation time series.
[0105] The normalized short-time phase deviation time series is input into the recurrent neural network training framework as the input sample set for model training, supporting the online learning and parameter convergence of the dynamic phase trend prediction module. Based on the short-time phase deviation time series, a lightweight recurrent neural network model is trained using the backpropagation algorithm to obtain the converged phase trend prediction parameters. The recurrent neural network includes a single-layer gated recurrent unit and a linear output layer. Specifically, it includes:
[0106] S3.1: Based on the q-axis voltage residual sequence acquired through a sliding time window, a short-time phase deviation time series dataset is constructed to serve as the training input sample for a recurrent neural network;
[0107] Normalized phase deviation time series was obtained based on sliding time window acquisition. The time series is used as the original feature input, and a time series reconstruction method (parameters: window length N, stride 1) is used to convert the single-channel sequence into a two-dimensional sample matrix structure.
[0108] Furthermore, through the sequence label generation method (parameter: prediction step size T) pThis allows for the pairing of the sample matrix with the future control cycle phase increment Δθ, and the acquisition of the input-output data pairs required for supervised learning.
[0109] Furthermore, a data partitioning algorithm (parameters: training set ratio 0.8, validation set ratio 0.2) is adopted to randomly divide the sample data into training and validation sets and generate corresponding index lists to support the subsequent supervised training of the recurrent neural network.
[0110] Furthermore, a time series batching method (parameter: batch size B) is adopted to achieve batch processing and arrangement of training set samples, maintain the temporal integrity of the phase difference time series and the dimensionality of samples within the batch, and generate a tensor structure adapted to the input interface of the GRU unit.
[0111] The above processing method transforms the q-axis voltage residual sequence collected by the sliding time window into two-dimensional tensor samples and corresponding target phase increment data required by the recurrent neural network, thereby realizing the input preparation for the training stage of the dynamic phase trend prediction model.
[0112] For example, in a distributed photovoltaic grid-connected system, if the sliding time window length N is set to 3 power frequency cycles and the sampling frequency is 10kHz, then each window contains 30,000 sampling points. Through time series reconstruction, a feature vector of length 30,000 is retained in each sample, corresponding to a prediction step size T. p The number of sampling points is set to 10,000 points, representing one power frequency cycle. A sequence label generation method is used to calculate the future predicted phase increment Δθ for each feature sequence, using the following formula:
[0113] ;
[0114] Where θ is the current grid phase estimated by the phase-locked loop, and T p To predict the number of sampling points for the step size, a data subset algorithm was used to randomly divide a total of 10,000 samples into 8,000 training sets and 2,000 validation sets. Batch processing was performed with a batch size of B=64, generating a feature tensor of dimension (64, 30,000) and a target Δθ tensor of dimension (64, 1). This processing significantly improved the temporal feature capture capability of the GRU model in actual operation, ensuring accurate output of the next cycle's phase increment during the online prediction phase. This enables rapid response and high-precision control for inverter grid-connected synchronization.
[0115] S3.2: Initialize a lightweight recurrent neural network structure containing a single-layer gated recurrent unit (GRU) and a linear output layer, where the GRU unit is used to capture the dynamic change features of the time series, and the linear output layer is used to map the predicted values to the phase increment space;
[0116] Based on the short-time phase deviation time series dataset constructed in step S3.1, the input object is the normalized time series matrix with a corresponding dimension of N×1, where N is the sliding time window length, and the sampled values are... ;
[0117] A network structure initialization method (parameters: input dimension N, hidden state dimension H, output dimension 1, activation function type is hyperbolic tangent tanh) is adopted, and the basic operation module of a single-layer gated recurrent unit (GRU) is loaded into the embedded computing unit of the controller to realize the function of capturing dynamic changes in time series.
[0118] Furthermore, the weight matrix is constructed using the following method (parameter: input weight matrix W). x Hidden state weight matrix W h Bias vector For the three gating structures of GRU: reset gate, update gate, and candidate hidden layer, independent weight matrices and bias terms are established respectively, and an initial set of network parameters is obtained to ensure effective modeling of nonlinear dynamic relationships in time series.
[0119] Furthermore, an initialization method is used through linear transformation (parameters: input dimension H, output dimension 1, weight matrix W). o Bias vector b o This enables the construction of a linear output layer and generates a mapping mechanism from the hidden state to the phase increment space, allowing the network to output the predicted phase angle increment for the next control cycle.
[0120] Furthermore, by using parameter binding, the hidden state output of the GRU unit is used as the input of the linear layer, and vector multiplication and bias addition are used to form a complete "GRU feature extraction - linear prediction" structure, thereby completing the initialization of the recurrent neural network and ensuring that the network has the basic ability to learn online and predict trends.
[0121] Through the above recursive neural network structure initialization process, the normalized time series data in the previous step is transformed into the initial weights and mapping relationships of the network that can be used for subsequent backpropagation optimization, thus realizing the structural construction and functional readiness of the phase trend prediction module.
[0122] For example, in the embedded DSP controller of a distributed photovoltaic grid-connected system, the normalized time series length N is set to 8, the hidden state dimension H of the GRU unit is set to 16, and the activation function is tanh. During GRU initialization, the input weight matrix W... x The size is 16×1, and the hidden state weight matrix W h The size is 16×16, corresponding to the bias vector. All lengths are 16. During the initialization of the linear output layer, the weight matrix W... o The size is 1×16, and the bias vector is b. o The length is 1. In one initialization run, the input time series is... The hidden state vector h is obtained through GRU structure calculation. k h k The length is 16; it is then executed in the linear output layer. W o h is a 1×16 vector k The vector is 16×1, and the matrix multiplication result is a scalar prediction value with consistent scaling. This scalar corresponds to the initial predicted output of the phase angle increment. During real-time operation of the controller, this initialization model can be directly embedded into the subsequent training process without offline tuning. The output results in the grid voltage disturbance test scenario show a significant reduction in phase tracking delay time and a significant improvement in dynamic response speed.
[0123] S3.3: Based on the aforementioned short-time phase deviation time series, a loss function is defined using the minimum mean square error criterion to measure the degree of deviation between the network output and the actual phase increment;
[0124] S3.4: The backpropagation through-time (BPTT) algorithm is used to iteratively update the parameters of the recurrent neural network. The weight matrix and bias terms inside the GRU unit are adjusted according to the gradient of the loss function to optimize the network's ability to fit the phase trend.
[0125] Using the normalized short-time phase deviation time series as the training input for the recurrent neural network, the backpropagation through-time (BPTT) algorithm is employed (parameter: time expansion step size). The learning rate η is used to iteratively update the network parameters, thereby realizing the gradient calculation and propagation of sequence features in the time dimension;
[0126] Furthermore, through the gradient calculation process, the gradients of the input gate, reset gate, and candidate hidden state weight matrices and bias vectors of the single-layer gated recurrent unit (GRU) are calculated one by one, and the gradients of each time step are accumulated in the time expansion dimension to obtain global gradient information for the complete sequence.
[0127] Furthermore, based on the calculated global gradient information, a gradient descent update rule is used to update the internal weight matrix of the GRU. and the corresponding bias terms The synchronization adjustment is performed, and its update formula is:
[0128] ;
[0129] in, W This is the weight matrix that needs to be updated.W new For the updated weights, W old The weights are the weights before the update, and η is the learning rate. The gradient of the target loss function with respect to the weights;
[0130] Furthermore, the weight vector of the linear output layer With bias Perform the same gradient descent update process to ensure that the predicted output space is optimized synchronously with the temporal characteristics of GRU;
[0131] By using the gradient pruning method (parameter: pruning threshold γ), the magnitude of the calculated global gradient is limited to avoid gradient explosion caused by long-term sequence expansion, thereby maintaining a stable parameter update process while ensuring network convergence.
[0132] By iteratively updating the entire sequence using the BPTT algorithm, the phase deviation time series input in the previous step is mapped to better network parameter data, thereby enabling the recurrent neural network to achieve high-precision fitting of dynamic phase trends.
[0133] For example, in a distributed photovoltaic grid-connected system, let the time unfolding step be... The learning rate η is 0.001, the pruning threshold γ is 5.0, and the training input is a normalized phase bias vector sequence of length N=20. After performing BPTT expansion, the weights of the three gate structures of the GRU are calculated for each time step. Gradients are calculated and accumulated. For the input gate weights W... in Its gradient mean in a certain batch of training is 0.0032, and the update formula is: Each update reduces the prediction bias of the hidden states across the entire sequence. This is achieved by adjusting the output layer weights. After performing the same update rules, the mean squared error of the validation set decreased from the initial 0.025 to 0.004 when the training iteration reached 150, indicating that the network has significantly improved the accuracy of phase trend prediction. When this training result is deployed to the controller, it can maintain the stability and speed of synchronous phase prediction during grid voltage surge responses. Under typical disturbance scenarios, the response time of composite angular frequency commands is shortened by approximately 40ms compared to the untrained model, significantly improving the robustness of photovoltaic inverter grid-connected synchronization.
[0134] S3.5: Introduce an early stopping mechanism during training. When the validation set error does not decrease significantly for several consecutive training cycles, training will be terminated to prevent model overfitting and ensure that the parameters converge to a stable state.
[0135] During the training of recurrent neural networks, the convergence state of the model is monitored in real time, and an early stopping mechanism is introduced to control the number of training rounds.
[0136] A validation set error monitoring method (parameters: validation set sample size M, sliding evaluation period P) is adopted to calculate the mean square error of the current network on the validation set after each training cycle iteration.
[0137] Furthermore, by using a threshold judgment algorithm (parameters: error decrease threshold ε, duration period Q), the magnitude of the change in the validation set error within Q consecutive training periods is evaluated, and an error stability indicator scalar is obtained.
[0138] Furthermore, through the early stopping decision function To achieve when the validation set error When the decrease in value over Q consecutive training epochs is less than a preset threshold ε, a control signal to stop training is output, where the loss function... for:
[0139] ;
[0140] Where n is the number of validation set samples, and y is the actual phase increment. These are the model's predicted values;
[0141] Furthermore, by calling the stop signal through the controller interface, the current number of training iterations, network weight matrix, and bias vector are output and stored in the internal parameter storage module for subsequent online deployment.
[0142] By using an early stopping mechanism, the training results of the previous step are transformed into a stable and reliable set of model parameters, thereby achieving the expected technical effect of maintaining prediction accuracy and generalization ability while preventing overfitting.
[0143] For example, in the training process of a GRU network for a distributed photovoltaic grid-connected inverter controller, the number of validation set samples M is selected as 500, the sliding evaluation period P is set to 5 training rounds, the error reduction threshold ε is set to 0.0005, the phase increment unit is radians, and the duration period Q is set to 10. When the network's validation set error reduction does not exceed 0.0005 in 10 consecutive training rounds, the early stopping judgment function... A stop signal is output, and training terminates after the 120th iteration. At this point, the recorded GRU weight matrix is 64×64 in size, and the bias vector length is 64. After deployment, the final model can maintain the stability of phase prediction in scenarios with rapid fluctuations in grid voltage, and the response time is shortened to within one control cycle, significantly improving the system's real-time synchronization capability and robustness.
[0144] S3.6: Output the parameters of the recurrent neural network model after training convergence and deploy them to the controller for online real-time prediction of the phase angle increment of the next control cycle. This is to support the implementation of subsequent weighted fusion strategies.
[0145] S4: Based on the predicted phase angle increment and combined with the photovoltaic grid-connected operating conditions, the synchronous phase angle is calculated. The specific calculation process of the synchronous angle includes:
[0146] The angular frequency output by the PI controller is weighted and fused with the predicted phase angle increment to obtain a composite angular frequency: the angular frequency output by the traditional phase-locked loop PI controller is weighted and fused with the phase angle increment predicted by the recurrent neural network to generate a composite angular frequency command, wherein the weighting coefficients are dynamically adjusted according to the grid voltage change rate. Specifically, this includes:
[0147] Based on the dynamic phase trend increment predicted by the recurrent neural network, the corresponding predicted angular frequency component is calculated to obtain the instantaneous angular frequency response of the prediction channel.
[0148] The dynamic phase trend increment based on the recurrent neural network prediction module output in the previous control cycle The discrete-time angular frequency conversion method is adopted (parameter: T s This enables the mapping and conversion of phase increments to instantaneous angular frequency components;
[0149] Furthermore, through the discrete division formula, With control period T s The ratio is calculated to obtain the instantaneous angular frequency response value of the predicted channel. The formula is as follows:
[0150] ;
[0151] in, T is the dynamic phase increment predicted by the recurrent neural network. s The discrete sampling period of the phase-locked loop controller;
[0152] Furthermore, by employing a numerical precision limitation strategy (parameters: floating-point operation precision of 1e-6, step change limit of ±10%), restrictions are imposed. With T s The ratio is within the physically feasible range, ensuring Stability and noise immunity of the calculation process;
[0153] Furthermore, a timestamp alignment mechanism is employed (parameters: sampling time k and prediction output time k+1) to achieve... Effective binding with the current control cycle to avoid control command deviations caused by data delays or predicted phase drift;
[0154] By using the discrete-time angular frequency conversion method, the dynamic phase increment predicted by the recurrent neural network is converted into the instantaneous angular frequency component of the prediction channel, thereby realizing the instantaneous response characteristics of the prediction branch in the control system.
[0155] For example, in a grid-connected control system for a distributed photovoltaic inverter with a rated capacity of 20kW, the sampling period T s Set to 0.0001 seconds, the recurrent neural network outputs in the current cycle. The value is 0.003 radians. The angular frequency component is predicted using a formula. Radius per second. In the control strategy, this value is directly used as the instantaneous angular frequency input of the prediction channel, and is weighted and fused with the filtered angular frequency of the PI control channel. Test results show that under the condition of 8% amplitude change in grid voltage, the fused composite angular frequency can recover to the steady-state level within two sampling periods, the peak value of inverter output voltage phase error is significantly reduced, and the dynamic response speed is significantly improved.
[0156] The angular frequency signal output by the traditional phase-locked loop PI controller is obtained and low-pass filtered to remove high-frequency noise interference, resulting in a smooth feedback angular frequency signal, which serves as a stable input to the feedback control channel.
[0157] Based on the real-time detection results of the grid voltage change rate, the dynamic value of the weighting coefficient is calculated so as to reduce the weighting coefficient value during voltage abrupt changes and increase the weighting coefficient value during steady state.
[0158] Based on the grid voltage change rate provided by the voltage sampling module and the sliding time window differential module Real-time detection values are obtained using a piecewise linear mapping method (parameter: perturbation threshold set V). th steady-state weight range This enables dynamic adaptive calculation of the weighting coefficient α;
[0159] Furthermore, through a threshold comparison algorithm (parameters: This enables multi-level disturbance classification of the current power grid state and obtains disturbance level identifiers, which are used to drive the selection of the piecewise mapping function;
[0160] Furthermore, by using a normalization transformation method (parameter: maximum detected rate of change), the voltage change rate is normalized, generating a standard disturbance intensity index R in the range [0,1]. norm This is to improve the consistency of weighting factor calculation under different power grid levels;
[0161] The composite angular frequency is integrated to obtain the synchronization phase angle; the feedback angular frequency signal and the predicted angular frequency signal are weighted and fused to generate a composite angular frequency command, thereby achieving synergistic optimization of dynamic response and steady-state suppression capability.
[0162] A composite angular frequency command is sent to the integrator unit to generate a synchronization phase angle, which serves as the reference signal for subsequent Park transformation and synchronization control, thereby completing the mapping conversion from angular frequency to phase. The composite angular frequency command is integrated to generate the synchronization phase angle, and a Park coordinate transformation is performed based on this synchronization phase angle to generate a control signal in a synchronous rotating coordinate system. Specifically, this includes:
[0163] The composite angular frequency command is subjected to discrete integration to generate the synchronization phase angle θ under the current control cycle, which serves as the core synchronization signal output by the phase-locked loop.
[0164] Based on the aforementioned synchronous phase angle, sine and cosine function values are constructed as the basic trigonometric function components of the Park coordinate transformation matrix to achieve the transformation from the αβ stationary coordinate system to the dq synchronous rotating coordinate system.
[0165] The voltage components in the αβ coordinate system obtained after Clark transformation are input into the Park transformation matrix. The coordinate transformation is performed by combining the sine and cosine function values to generate the d-axis voltage components and q-axis voltage components in the synchronous rotating coordinate system, so as to realize the decoupled representation of the voltage vector in the rotating reference system.
[0166] Receive trigonometric function components obtained from the preceding steps and And the αβ stationary coordinate system voltage component u output from step S1.3 α with u β , as the input variable of the Park transformation matrix;
[0167] The standard Park coordinate transformation method (parameter: synchronous phase angle θ) is used to achieve a linear orthogonal transformation from the αβ stationary coordinate system to the dq synchronous rotating coordinate system, thus eliminating the influence of the voltage vector on the change of the rotating reference system.
[0168] Furthermore, the αβ components are coupled with the trigonometric function components of the synchronization phase angle for calculation by constructing the following matrix transformation formula:
[0169] ;
[0170] Among them, u d u represents the direct-axis voltage component in a synchronously rotating coordinate system. q Represents the quadrature-axis voltage component in a synchronously rotating coordinate system;
[0171] Furthermore, through matrix multiplication, the formula for calculating the direct axis components is obtained:
[0172] ;
[0173] And the formula for calculating the cross-axis components is obtained:
[0174] ;
[0175] Furthermore, the real-time calculation of the above formula is performed by a low-latency multiply-accumulate unit to ensure that the dq components can be updated instantly in each control cycle;
[0176] Furthermore, by optimizing the multiplier and accumulator pipeline structure in the hardware DSP, the waiting time for trigonometric function calculations and multiplication operations is reduced, thereby reducing the computational latency of the coordinate transformation process.
[0177] Through the matrix operations and hardware acceleration processing described above, the voltage components in the αβ stationary coordinate system of the previous step are transformed into the direct and quadrature axis components in the dq synchronous rotating coordinate system, thereby realizing the decoupled representation of the voltage vector and improving the accuracy and dynamic response performance of synchronous control.
[0178] For example, under rated operating conditions, the synchronization phase angle θ is set to 45°. , The αβ components collected in step S1.3 are Applying the formula for the direct axis components, we obtain... Applying the formula for cross-axis components, we obtain... In this scenario, the direct-axis component is entirely composed of the projection of the α component, while the quadrature-axis component is negative and has the same amplitude as the direct-axis component, achieving effective decomposition in the synchronous rotating coordinate system and verifying the accuracy and real-time performance of the coordinate decoupling process. In dynamic response testing, this computational structure stably outputs the dq component within a 50 μs update cycle, significantly improving the phase control accuracy and voltage amplitude consistency of the inverter's grid-connected synchronization.
[0179] Furthermore, in the weighted fusion calculation, the weighting coefficients of the weighted fusion are dynamically adjusted according to the photovoltaic grid-connected operating conditions:
[0180] Real-time monitoring of the grid voltage change rate; when a sudden change in grid voltage exceeds a preset threshold, a weighting coefficient adjustment strategy is executed to reduce the weighting coefficient corresponding to the angular frequency output by the PI controller. This includes the following steps:
[0181] A sliding time window differential calculation is performed on the instantaneous sampled value of the grid voltage to obtain the voltage change rate dV / dt, where the length of the sliding time window is half a power frequency cycle. The forward differential algorithm is used to differentiate the voltage sampled values at adjacent times to reflect the dynamic disturbance intensity of the grid voltage.
[0182] Based on the comparison between the voltage change rate and the preset dynamic disturbance threshold, when the voltage change rate exceeds the threshold, a grid voltage change event trigger signal is generated. The preset threshold is set according to the rated voltage and typical disturbance range to distinguish between steady-state fluctuations and significant change scenarios.
[0183] Based on the grid voltage change rate dV / dt obtained from the preceding sub-steps, a threshold comparison method is used (parameter: dynamic disturbance threshold V). thr This enables the classification and determination of instantaneous voltage fluctuation amplitude;
[0184] Furthermore, a piecewise linear comparison algorithm is used (parameter: the boundary value V that distinguishes between steady-state fluctuations and abrupt changes). thr ), to achieve the relationship between dV / dt and V thr Real-time comparison, and obtain the logical decision result S. flag S flag =1 indicates a sudden voltage change event in the power grid, S flag =0 indicates a steady-state or small-disturbance scenario;
[0185] Furthermore, a sign discrimination and amplitude filtering method (parameter: minimum response delay window L) is used. min ), to achieve S flag Signal jitter suppression and generation of a stable mutation trigger flag S event ;
[0186] Furthermore, the event decision mapping function E is adopted. map (Parameter: Mapping level is binary mode), to implement S event The signal is converted into a grid voltage surge trigger signal E that can be recognized by the phase-locked loop control unit. trigger ;
[0187] Through the above-mentioned hierarchical judgment and event mapping processing method, the voltage change rate dV / dt result of the previous step is converted into a data trigger signal for controlling the weight adjustment, so as to realize the accurate identification of the disturbance scene and the real-time driving of the subsequent weighting coefficient adjustment.
[0188] For example, in a distributed photovoltaic grid-connected system, the rated voltage reference value is set to 380V, and the corresponding dynamic disturbance threshold V... thr The sampling rate is set to 50V / s based on the rated voltage and typical disturbance range. When using the threshold comparison method, the sampling period T... sThe time is 0.5ms, and the voltage change rate obtained through the previous steps is 62.4V / s. A piecewise linear comparison algorithm is used to determine... Output the initial judgment flag S flag =1. The symbol discrimination and amplitude filtering method maintains S for 5 consecutive sampling periods. flag After =1, a stable trigger flag S is generated. event =1, ensuring that false triggering will not occur due to instantaneous sampling noise. Event decision mapping function E map S event =1 converted to E trigger =1, and input to the weighting coefficient adjustment module. In this scenario, the controller receives E trigger Then, within 1ms, the weighting coefficient α is reduced from 0.7 to 0.3, which significantly improves the dominant role of the prediction channel in the phase-locked loop, so that the inverter output voltage phase remains synchronous and stable in the grid voltage rapidly decreasing band, without phase jump phenomenon.
[0189] Based on the grid voltage change event trigger signal, a dynamic adjustment strategy for the weighting coefficient α is executed to reduce the weight ratio of the traditional PI controller output channel in the composite angular frequency. The initial value of α is 0.7, which is gradually reduced to 0.3 when a disturbance is detected, so as to enhance the dominant role of the prediction channel in phase tracking.
[0190] The adjusted weighting coefficients and the predicted channel output are weighted and fused to generate a new composite angular frequency command, ensuring that the system has a higher dynamic response capability during disturbances.
[0191] The composite angular frequency command is input into the integrator to generate a synchronous phase, which is then fed back to the Park coordinate transformation stage to achieve rapid synchronization tracking between the inverter output voltage and the grid voltage, thereby maintaining the synchronization stability and real-time response of the phase-locked loop system under sudden grid voltage changes.
[0192] Furthermore, the integration operation on the composite angular frequency includes integration using a nonlinear integral gain. The absolute value of the q-axis voltage residual at the current moment is input into a pre-established nonlinear gain function to generate a dynamic integral gain coefficient. The calculation steps for the nonlinear integral gain coefficient specifically include:
[0193] S4.1: Perform absolute value operation on the q-axis voltage residual output at the current moment to obtain an unsigned phase error intensity index, which is used as the input variable of the nonlinear gain function to obtain the phase error intensity index;
[0194] Based on the q-axis voltage residual u output by the Park coordinate transformation stage q This serves as the raw data input for detecting the phase error of the phase-locked loop;
[0195] Use the absolute value operation method (parameter: input u) q (Signal) to convert the original signed phase error signal into an unsigned phase error intensity index, thereby eliminating the directional influence of positive and negative offsets;
[0196] Furthermore, through the numerical computation module (bit width: 32-bit floating-point format), the operation of u is realized. q The numerical values are modulo-processed to obtain the absolute value result. This ensures that only the error magnitude information is retained in subsequent calls to the nonlinear gain function;
[0197] Furthermore, a data type conversion algorithm (parameters: floating-point to fixed-point format, scaling factor 0.001) is used to convert the absolute value result from the internal floating-point representation to a fixed-point format that adapts to the controller's numerical domain, and generate an input signal that adapts to the integer range.
[0198] Furthermore, through the quantization processing module (parameters: resolution 1e-5, saturation limiting ±1), numerical limiting operation is achieved on fixed-point data to prevent extreme values caused by abnormal jitter or sampling errors from entering the nonlinear gain function calculation stage;
[0199] Through the above absolute value operation and data preprocessing methods, the signed phase error signal of the previous control cycle is transformed into a safe and usable unsigned amplitude index, thereby achieving the stability and consistency of the input data of the nonlinear gain function.
[0200] For example, in a distributed photovoltaic grid-connected inverter control system, the q-axis voltage residual u after Park transformation q At a certain moment, the output value is -0.305V. The controller's signal processing module first performs absolute value calculation: , where u q The input q-axis voltage residual signal is processed to obtain 0.305V. A data type conversion is then performed, multiplying the floating-point value by a scaling factor of 0.001 and mapping it to a 16-bit fixed-point domain, resulting in a fixed-point number of 305. Next, a quantization module limits the amplitude, setting the saturation parameter to ±1, converting the input 305 to 0.305 and confirming it is within the allowable range. The final output unsigned phase error intensity index is 0.305, which is directly input to the subsequent nonlinear gain function module to achieve dynamic adjustment of the integral gain driven by the phase error amplitude. Under different operating conditions, such as sudden changes in grid voltage causing u... q The voltage changes instantaneously to -0.785V, the operation process is the same, and the final output amplitude is 0.785. This value will trigger the gain function to enter the high gain slope range, which will significantly improve the response speed and convergence capability of the phase-locked loop in this disturbance period.
[0201] S4.2: Based on the preset nonlinear gain function structure, the high-voltage residual interval and the low-voltage residual interval are divided according to the phase error intensity index, specifically:
[0202] When the grid voltage suddenly changes or the synchronization offset exceeds the preset segmentation threshold, the current interval is divided into a high-voltage residual interval.
[0203] When the grid voltage is in steady-state operation or the synchronization deviation is lower than the preset segmentation threshold, the current interval is divided into the low-voltage residual interval;
[0204] Among them, the larger the synchronization offset, the stronger the corresponding power grid disturbance; the smaller the synchronization offset, the more stable the operating condition and the weaker the disturbance.
[0205] S4.3: Within the high-voltage residual range, a high-gain slope function is used to map the phase error intensity index, generating a large integral gain coefficient, thereby improving the response speed of the phase-locked loop integral stage and accelerating the convergence process of the phase error.
[0206] Within the low-voltage residual range, the phase error intensity index is mapped to a low-gain slope function to generate a small integral gain coefficient, thereby suppressing overshoot and oscillation of the phase-locked loop integral stage and enhancing the stability of the system under steady-state conditions.
[0207] Based on the input phase error intensity index, a low-gain slope function mapping method is adopted (parameter: low-gain slope coefficient g). low , lower limit threshold T low Upper limit threshold T of the interval mid This enables gain suppression of phase error within the low-voltage residual range;
[0208] Furthermore, through a piecewise linear mapping algorithm (parameter: mapping interval) This achieves a low-slope linear relationship between the input error index and the integral gain coefficient within the low-pressure residual interval, and yields the initial low-gain coefficient matrix K. low ;
[0209] Furthermore, a normalization algorithm is employed (parameter: normalization factor N). factor ), to achieve K low The scaling consistency of the coefficient matrix under different sampling conditions is determined, and normalized low-gain coefficients are generated. ;
[0210] Furthermore, a smooth interpolation algorithm is used (parameters: interpolation order p, boundary point threshold T). mid This achieves a continuous transition of the normalized low-gain curve from the interval boundary to the high-voltage residual interval, and generates a smooth curve for the low-gain interval. ;
[0211] By multiplying and weighting the smoothed low-gain function output value with the target gain coefficient of the phase-locked loop integrator, the response speed of the integrator in the low-voltage residual range is suppressed and overshoot oscillation is mitigated.
[0212] For example, in a distributed photovoltaic inverter grid-connected test platform, a lower limit threshold T for the low-voltage residual range is set. low The value is 0.005 pu, and the upper limit threshold T is... mid The low gain slope coefficient is 0.02 pu. low When the absolute value of the q-axis voltage residual is 0.01 pu, the integral gain coefficient K is calculated using a low-slope linear function, with a value of 0.3.
[0213] ;
[0214] in, This represents the absolute value of the current residual. Substitute the parameters into the formula:
[0215] ;
[0216] Calculated This coefficient has been normalized (factor). To maintain numerical consistency, a third-order spline interpolation algorithm is used in T. mid The boundary point and the gain curve of the high-voltage residual interval are continuously connected. Test results show that after using this low-gain function in the low-voltage residual interval, the phase response curve of the phase-locked loop integral stage tends to be stable, the overshoot amplitude is significantly reduced, and the steady-state phase jitter amplitude of the system is controlled within 1°, which significantly improves the grid-connected synchronization stability of the photovoltaic inverter under steady-state conditions. Similarly, the high-gain coefficient in the high-voltage residual interval is derived according to the calculation method of the aforementioned low-voltage gain coefficient.
[0217] S4.4: The high-gain slope function and the low-gain slope function are smoothly connected at a preset segmented threshold point to obtain a nonlinear gain function curve, so as to ensure that the integral gain coefficient transitions smoothly between different error intensity ranges and avoids control output disturbances caused by sudden gain changes.
[0218] S4.5: Obtain the nonlinear integral gain coefficient based on the nonlinear gain function curve.
[0219] The nonlinear integral gain coefficient is output to the phase-locked loop integrator, which is used to perform nonlinear weighting on the angular frequency output by the PI controller, thereby achieving the synergistic optimization control objective of response speed and stability.
[0220] In one embodiment, the formula for calculating the weighting coefficient α using piecewise linear function mapping is as follows:
[0221] ;
[0222] Where f is a piecewise linear mapping function, when R norm When the output α is greater than the high perturbation threshold range min When R norm Output α when it is less than the low perturbation threshold range max When the disturbance interval is in the middle, linear interpolation is used for calculation;
[0223] Furthermore, a linear interpolation algorithm is employed (parameters: In the disturbance interval, the current α value is calculated according to the ratio of the disturbance intensity index to the threshold distance, as shown in the following formula:
[0224] ;
[0225] Among them, R low With R high These are the normalization thresholds for low and high perturbations, respectively;
[0226] Through the above mapping calculation, the voltage change rate characteristic is transformed into a weighting coefficient α that adapts to the current dynamic state of the power grid, so as to achieve the expected effect of increasing the prediction channel weight under disturbance conditions and increasing the feedback channel weight under steady-state conditions.
[0227] For example, in a distributed photovoltaic grid-connected instance, the grid rated voltage is 380V, and the sampling period T s The time window is 0.5ms, the sliding time window length is 10ms, and the instantaneous voltage change rate is calculated for each sampling. Set a high threshold for disturbance. The disturbance threshold is 150V / ms. The rate is 50V / ms, and the normalized maximum rate of change is set to 200V / ms. The value detected at a certain moment... It is 120V / ms, which is obtained after normalization. It belongs to the medium disturbance range; the linear interpolation formula is used to calculate: R low = 0.25, R high = 0.75, α max =0.7, α min =0.3, substituting into the formula, we get:
[0228] ;
[0229] The calculated value of α is 0.42. This value is used for the weighted fusion of the subsequent feedback angular frequency signal and the predicted angular frequency signal. The verification results show that under disturbance conditions, the proportion of the prediction channel is significantly improved, and the grid-connected inverter achieves the effect of fast synchronous phase response under dynamic fluctuations of grid voltage.
[0230] Furthermore, it also includes adaptively updating the piecewise threshold of the nonlinear gain function, specifically including the following steps:
[0231] S4.6.1: Based on the absolute value of the d-axis voltage residual, the current operating range is divided into a steady-state range or a disturbance range, and the initial segmentation threshold parameter set of the nonlinear integral gain function is determined based on the divided operating range; wherein, the d-axis voltage residual is obtained by preprocessing the three-phase voltage signal;
[0232] The specific preprocessing process includes: performing sliding time window mean filtering on the d-axis voltage components after Park transformation to suppress high-frequency noise interference and obtain a smoothed d-axis voltage reference value, wherein the length of the sliding time window is updated synchronously with the current grid frequency estimate.
[0233] Based on the smoothed d-axis voltage reference value, the deviation of the voltage relative to the rated voltage reference value, i.e., the d-axis voltage residual, is calculated and used as the input error signal for feedback adjustment to reflect the degree of voltage deviation under the current synchronization state.
[0234] Feedback regulation is performed based on the d-axis voltage component after Park transformation, and the stability of the integral element is maintained by dynamically updating the piecewise threshold parameter of the nonlinear gain function.
[0235] Based on the absolute value of the voltage deviation, the current operating state is divided into a steady-state interval or a disturbance interval, and the initial set of segmented threshold parameters for the nonlinear gain function is determined accordingly. The steady-state interval corresponds to a lower threshold to suppress integral drift.
[0236] S4.6.2: Adjust the dynamic correction factor of the nonlinear integral gain function according to the d-axis voltage residual; combine the current gain output value of the nonlinear gain function constructed in the previous step with the polarity direction of the voltage deviation, calculate the dynamic correction factor of the integral gain coefficient, and use it to adjust the response sensitivity of the integral element.
[0237] S4.6.3: Based on the dynamic correction factor and the current operating state division result, update the set of piecewise threshold parameters in the nonlinear gain function to generate an updated set of piecewise threshold parameters to adapt to changes in grid disturbances and maintain the stability of the integral element.
[0238] S5: Based on the aforementioned synchronization phase angle, control the grid-connected synchronization phase of the photovoltaic inverter.
[0239] The q-axis voltage component is fed back to the phase-locked loop control unit as a phase error detection signal, which is used to drive the phase-locked loop to dynamically adjust the synchronization phase θ in order to maintain the phase consistency between the grid-connected voltage and the grid voltage.
[0240] The d-axis voltage component is used as the input signal of the amplitude control loop to adjust the inverter output voltage amplitude to match the grid voltage amplitude and achieve synchronous control of the grid-connected voltage amplitude.
[0241] This invention, while maintaining the basic architecture of traditional phase-locked loops, achieves a fundamental leap in control performance through a "trend-aware + adaptive fusion" mechanism. It eliminates the need for high-order filters, generalized integrators, or multi-model switching structures, and does not rely on external communication support or precise system modeling, thus possessing excellent engineering feasibility and platform compatibility. The entire algorithm has low computational load, making it suitable for deployment in embedded real-time control systems. Furthermore, it requires minimal historical data for training, converges rapidly, and can complete online learning and parameter updates under limited resource conditions. This constructs a novel phase-locked control paradigm that combines speed, stability, and environmental adaptability, effectively overcoming the technical bottleneck of the trade-off between response speed and stability in traditional feedback control. It significantly improves the synchronization reliability and grid connection quality of distributed photovoltaic inverters in complex grid-connected environments with severe voltage fluctuations, high harmonic content, and frequent frequency offsets.
[0242] Example 2
[0243] Based on the same concept, embodiments of the present invention also provide a grid-connected synchronization control device for a photovoltaic inverter, which is used to implement the method described in embodiment 1, the device comprising:
[0244] The voltage acquisition module is used to acquire the three-phase voltage signal at the point of common coupling of the power grid in real time, and to preprocess the three-phase voltage signal to obtain the q-axis voltage residual.
[0245] The time series construction module is used to serialize and sample the q-axis voltage residual to construct a short-time phase deviation time series.
[0246] The phase angle increment prediction module is used to input the short-time phase deviation time series into a pre-trained recurrent neural network model to obtain the predicted phase angle increment; wherein, the pre-trained recurrent neural network model is obtained by training based on the existing short-time phase deviation time series.
[0247] The synchronization phase angle calculation module is used to calculate the synchronization phase angle based on the predicted phase angle increment and the photovoltaic grid-connected operating conditions.
[0248] The photovoltaic inverter control module is used to control the grid-connected synchronization phase of the photovoltaic inverter based on the synchronization phase angle.
[0249] Example 3
[0250] Based on the same concept, embodiments of the present invention also provide a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described in Embodiment 1 above.
[0251] Example 4
[0252] Based on the same concept, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the method described in Embodiment 1 above.
[0253] In the embodiments disclosed in this application, a computer storage medium may be a tangible medium that may contain or store programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of computer storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0254] The technical solution of the present invention has been described above with reference to the preferred embodiments shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of the present invention is obviously not limited to these specific embodiments. Without departing from the principles of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of the present invention.
[0255] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and rules of the present invention should be included within the scope of protection of the present invention.
Claims
1. A grid-connected synchronous control method for a photovoltaic inverter, characterized in that, Includes the following steps: S1: Real-time acquisition of three-phase voltage signals at the power grid common connection point, and preprocessing of the three-phase voltage signals to obtain the q-axis voltage residual; S2: The q-axis voltage residual is serialized and sampled to construct a short-time phase deviation time series; S3: Input the short-time phase deviation time series into a pre-trained recurrent neural network model to obtain the predicted phase angle increment; wherein, the pre-trained recurrent neural network model is obtained by training based on the existing short-time phase deviation time series; S4: Based on the predicted phase angle increment and combined with the photovoltaic grid-connected operating conditions, the synchronous phase angle is calculated; The specific calculation process for the synchronization phase angle includes: The angular frequency output by the PI controller is weighted and fused with the predicted phase angle increment to obtain the composite angular frequency; Among them, the weighting coefficient of the weighted fusion is dynamically adjusted according to the photovoltaic grid connection conditions: when a sudden change in grid voltage is detected to exceed a preset threshold, the weighting coefficient corresponding to the angular frequency output by the PI controller is reduced; The synchronization phase angle is obtained by integrating the composite angular frequency. The integration of the composite angular frequency includes integration using a nonlinear integral gain, and the calculation steps for the nonlinear integral gain coefficient specifically include: S4.1: Perform absolute value calculation on the q-axis voltage residual output at the current moment to obtain the phase error intensity index; S4.2: Based on the preset nonlinear gain function structure, the high-voltage residual interval and the low-voltage residual interval are divided according to the phase error intensity index; S4.3: Within the high-voltage residual range, the first slope function is used to map the phase error intensity index to generate the first gain coefficient; Within the low-voltage residual range, the second slope function is switched to map the phase error intensity index to generate a second gain coefficient. S4.4: Smoothly connect the first slope function and the second slope function at a preset segmentation threshold point to obtain a nonlinear gain function curve; S4.5: Obtain the nonlinear integral gain coefficient based on the aforementioned nonlinear gain function curve; S5: Based on the aforementioned synchronization phase angle, control the grid-connected synchronization phase of the photovoltaic inverter.
2. The grid-connected synchronous control method for a photovoltaic inverter according to claim 1, characterized in that, In S2, constructing the short-time phase deviation time series specifically includes: S2.1: Divide the complete power frequency cycle interval based on the power grid voltage frequency estimation result, and perform whole power frequency cycle alignment processing on the q-axis voltage residual according to the power frequency cycle interval; S2.2: Construct a sliding time window, perform serial sampling on the q-axis voltage residual after the full power frequency cycle alignment within the sliding time window, and obtain the short-time phase deviation time series; The sliding time window is configured with a window length based on a preset fixed number of complete power frequency cycles.
3. The grid-connected synchronous control method for a photovoltaic inverter according to claim 1, characterized in that, The division of the high-pressure residual interval and the low-pressure residual interval based on the phase error intensity index specifically includes: When the grid voltage suddenly changes or the synchronization offset exceeds the preset segmentation threshold, the current interval is divided into a high-voltage residual interval. When the grid voltage is in steady-state operation or the synchronization deviation is lower than the preset segmentation threshold, the current interval is divided into the low-voltage residual interval.
4. The grid-connected synchronous control method for a photovoltaic inverter according to claim 3, characterized in that, It also includes adaptively updating the piecewise threshold of the nonlinear gain function, specifically including the following steps: S4.6.1: Based on the absolute value of the d-axis voltage residual, the current operating range is divided into a steady-state range or a disturbance range, and the initial segmentation threshold parameter set of the nonlinear integral gain function is determined based on the divided operating range; wherein, the d-axis voltage residual is obtained by preprocessing the three-phase voltage signal; S4.6.2: Adjust the dynamic correction factor of the nonlinear integral gain function according to the d-axis voltage residual; S4.6.3: Based on the dynamic correction factor and the current operating state division result, update the set of piecewise threshold parameters in the nonlinear gain function to generate the updated set of piecewise threshold parameters.
5. A grid-connected synchronous control device for a photovoltaic inverter, used to implement the method according to any one of claims 1 to 4, characterized in that, The device includes: The voltage acquisition module is used to acquire the three-phase voltage signal at the point of common coupling of the power grid in real time, and to preprocess the three-phase voltage signal to obtain the q-axis voltage residual. The time series construction module is used to serialize and sample the q-axis voltage residual to construct a short-time phase deviation time series. The phase angle increment prediction module is used to input the short-time phase deviation time series into a pre-trained recurrent neural network model to obtain the predicted phase angle increment; wherein, the pre-trained recurrent neural network model is obtained by training based on the existing short-time phase deviation time series. The synchronization phase angle calculation module is used to calculate the synchronization phase angle based on the predicted phase angle increment and the photovoltaic grid-connected operating conditions. The photovoltaic inverter control module is used to control the grid-connected synchronization phase of the photovoltaic inverter based on the synchronization phase angle.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Method for improving adaptive variable gain fast response phase-locked loop
CN107134999A