VSG control method and device of DSP numerical control high-frequency bidirectional PCS converter
Through the multi-signal classification and depth deterministic strategic gradient network combined with phase locking ring compensation DSP CNC high-frequency bidirectional PCS converter VSG control method, the problems of voltage distortion and phase offset in traditional methods are solved, efficient dynamic response and stability improvement are achieved, and the control accuracy and reliability of the system are ensured under complex operating conditions.
Patent Information
- Application Number
- CN202510410442.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-07-08
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional DSP CNC high-frequency bidirectional PCS converters have voltage distortion and phase offset problems in actual applications, resulting in a decrease in dynamic response performance, especially in high-power bidirectional operating conditions, and the system stability and control performance are significantly reduced. The existing VSG control algorithms have poor adaptability and low fault diagnosis accuracy under complex operating conditions.
Through a multi-signal classification algorithm and a deep deterministic strategy gradient network combined with phase locking ring compensation, the interference components in different operating states can be accurately separated, and voltage feed-forward decoupling control is used for seamless switching, reducing control cycles and improving system stability and reliability.
It improves the system's transient response performance and stability, enhances the control accuracy and power conversion efficiency under high-frequency switching conditions, and ensures the control accuracy and reliability under complex operating conditions.
Smart Images

Figure CN120280950A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of bidirectional PCS converters, and particularly to a VSG control method and device for a DSP numerically controlled high-frequency bidirectional PCS converter. Background Art
[0002] As a key device in the smart grid, the VSG control technology of bidirectional PCS converters has received extensive attention. In practical applications of traditional DSP numerically controlled high-frequency bidirectional PCS converters, due to the superposition effect of the sampling period of PWM signals and the DSP operation delay, voltage distortion and phase offset problems exist in the system, severely restricting the dynamic response performance of the PCS system. Especially under high-power bidirectional operating conditions, fluctuations in the switching frequency will cause a decline in system stability, resulting in a significant reduction in control performance under low-power conditions.
[0003] The current VSG control algorithms have obvious deficiencies in dealing with complex operating conditions, mainly reflected in poor adaptability to system parameter changes, low fault diagnosis accuracy, etc. Especially during the grid-connected and off-grid switching process, due to the lack of an effective fault warning mechanism and an intelligent parameter optimization strategy, the system is prone to power fluctuations and transient oscillations, affecting power quality and equipment reliability. Summary of the Invention
[0004] This application provides a VSG control method and device for a DSP numerically controlled high-frequency bidirectional PCS converter. This application reduces the control period and calculation load of the PCS converter under high-frequency switching conditions, and ensures the control accuracy under complex operating conditions.
[0005] In the first aspect of this application, a VSG control method for a DSP numerically controlled high-frequency bidirectional PCS converter is provided. The VSG control method for the DSP numerically controlled high-frequency bidirectional PCS converter includes: Performing multi-signal classification on the output voltage, output current, DC bus voltage, and PWM modulation waveform of the PCS converter through a DSP chip to obtain a spectral feature vector; Calculating a VSG parameter group based on the spectral feature vector, and inputting the VSG parameter group into a deep deterministic policy gradient network for parallel training to generate a VSG real-time control strategy; Applying a phase-locked loop compensation to the VSG real-time control strategy to obtain a synchronized and compensated PWM modulation signal; Performing real-time fault warning on the synchronized and compensated PWM modulation signal, and using voltage feedforward decoupling control to perform seamless switching between grid-connected and off-grid modes to obtain a smooth transition control sequence.
[0006] The second aspect of the present application provides a VSG control device for a DSP numerically controlled high-frequency bidirectional PCS converter. The VSG control device for the DSP numerically controlled high-frequency bidirectional PCS converter includes: A multi-signal classification module, configured to perform multi-signal classification on the output voltage, output current, DC bus voltage, and PWM modulation waveform of the PCS converter through a DSP chip to obtain a spectral feature vector; A calculation module, configured to calculate a VSG parameter set based on the spectral feature vector, and input the VSG parameter set into a deep deterministic policy gradient network for parallel training to generate a VSG real-time control strategy; A compensation module, configured to apply a phase-locked loop compensation to the VSG real-time control strategy to obtain a PWM modulation signal after synchronous compensation; A switching module, configured to perform real-time fault warning on the PWM modulation signal after synchronous compensation, and perform seamless switching between grid-connected and off-grid modes by using voltage feedforward decoupling control to obtain a smooth transition control sequence.
[0007] Compared with the prior art, the present application has the following beneficial effects: By introducing a multi-signal classification algorithm and a power signal decoupling method with adaptive virtual impedance, accurate separation of interference components in different operating states is achieved, and the transient response performance of the system is improved. The genetic algorithm based on Lyapunov stability constraint is used to optimize the VSG parameters, combined with the parallel training mechanism of the deep deterministic policy gradient network, to enhance the stability of the system during bidirectional operation at rated power. An improved phase-locked loop compensation control strategy is designed, combined with a fuzzy adaptive fault detector, to reduce the control period of the system under high-frequency switching conditions. The seamless grid-connected and off-grid switching scheme based on voltage feedforward decoupling control improves the power conversion efficiency and system reliability. The real-time data processing based on the double-buffer mechanism and the TCP / IP parallel training architecture reduce the computational load of the DSP controller and ensure the control accuracy under complex working conditions. Description of the Drawings
[0008] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0009] The structures, proportions, sizes, etc. depicted in the accompanying drawings of this specification are only used to cooperate with the content disclosed in the specification for those familiar with this technology to understand and read, and are not used to limit the limiting conditions under which the present invention can be implemented. Therefore, they do not have substantial technical significance. Any modification of the structure, change in the proportional relationship, or adjustment of the size, without affecting the effects that the present invention can produce and the purposes that can be achieved, should still fall within the scope that can be covered by the technical content disclosed in the present invention.
[0010] Figure 1 is a schematic flowchart of the VSG control method for a DSP numerically controlled high-frequency bidirectional PCS converter provided by an embodiment of the present invention; Figure 2 is a schematic block diagram of the structure of a VSG control device for a DSP numerically controlled high-frequency bidirectional PCS converter provided by an embodiment of the present invention. Detailed implementation manners
[0011] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0012] The flowcharts shown in the accompanying drawings are only illustrative examples, and do not necessarily include all the contents and operations / steps, nor do they necessarily need to be executed in the described order. For example, some operations / steps can also be decomposed, combined, or partially merged. Therefore, the actual execution order may be changed according to the actual situation.
[0013] It should also be understood that the terms used in this specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in this specification of the present application and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to include the plural forms.
[0014] It should be further understood that the term "and / or" used in this specification of the present application and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations. Please refer to Figure 1 , an embodiment of the VSG control method for a DSP numerically controlled high-frequency bidirectional PCS converter in an embodiment of the present application includes: Step 100: Perform multi-signal classification on the output voltage, output current, DC bus voltage, and PWM modulation waveform of the PCS converter through a DSP chip to obtain a spectral feature vector; It is understandable that the execution entity of this application can be the VSG control device of the DSP numerical control high-frequency bidirectional PCS converter, or it can also be a terminal or a server. Specifically, it is not limited here. In the embodiments of this application, the server is taken as the execution entity for illustration.
[0015] Specifically, the output voltage, output current, DC bus voltage, and PWM modulation waveform of the PCS converter are digitally converted through a DSP chip, that is, continuous analog signals are sampled and converted into a discrete digital signal sequence through a high-precision analog-to-digital converter (ADC). To ensure the quality of the sampled signal, an appropriate sampling frequency is selected to meet the Nyquist sampling theorem, and an anti-aliasing filter is used to reduce high-frequency interference and ensure signal quality. A spatial correlation matrix is constructed based on the digital signal sequence, and this matrix describes the statistical correlation between different signal components. The correlation matrix is constructed by calculating the autocorrelation function or covariance matrix of the signal sequence. During the process of constructing the correlation matrix, in order to enhance the ability to extract signal features, a sliding window technique is used to segment the signal for calculation to improve the time resolution of the signal. The constructed spatial correlation matrix is subjected to eigenvalue decomposition to separate the signal subspace and the noise subspace. Among them, the larger eigenvalues correspond to signal components, while the smaller eigenvalues reflect the noise components. By screening out the eigenvectors corresponding to the signal part, a signal subspace projection matrix is constructed. Based on the signal subspace projection matrix, a power spectrum estimation operation is performed to obtain the frequency spectrum information of the signal. To enhance the resolution ability of the frequency spectrum, a high-resolution spectrum estimation method, such as the multiple signal classification algorithm or the maximum entropy spectrum estimation method, is used to obtain the power spectral density function, which describes the power distribution of the signal at different frequencies. Peak detection is performed on the power spectral density function to identify the main frequency components. And in order to adapt to the noise level and signal intensity changes under different working conditions, an adaptive threshold segmentation method is used to automatically identify the significant peaks in the power spectrum and eliminate the influence of noise. A method based on a dynamic threshold is used to adaptively adjust the detection threshold according to the statistical characteristics of the signal to ensure the accurate extraction of the main signal components. Calculate the energy contribution degree of each frequency component, that is, evaluate the proportion of each frequency component in the overall signal. Based on the power spectral density function, integration is performed to obtain the energy distribution of each frequency component, and it is classified and labeled according to the energy proportion of each component. According to the preset energy threshold, the main frequency component, harmonic component, and noise component are distinguished to achieve signal classification. On this basis, the maximum likelihood estimation method is used to calculate the amplitude and phase information of each component. The maximum likelihood estimation can perform optimal parameter estimation based on the statistical characteristics of the signal under the known power spectrum distribution to obtain the amplitude and phase information, and finally construct a frequency spectrum feature vector. It includes the main frequency components of the signal, the energy contribution degree of each component, the amplitude, and the phase information.
[0016] Step 200: Calculate the VSG parameter set based on the spectral feature vector, and input the VSG parameter set into the deep deterministic policy gradient network for parallel training to generate the VSG real-time control policy; Specifically, perform power angle - speed relationship analysis on the spectral feature vector to establish a second - order VSG state equation that includes the moment of inertia and damping coefficient. By analyzing the output voltage and current of the converter and the power fluctuation characteristics of the system, the motion equation of the VSG is derived, that is, a second - order state - space description is established based on the rotation equation of the synchronous machine. Among them, the moment of inertia determines the response speed of the system to frequency disturbances, while the damping coefficient affects the dynamic stability of the system. The establishment of the second - order VSG state equation enables the entire control system to operate in the virtual synchronous generator mode, and through dynamic adjustment of the inertia and damping coefficients, precise control of frequency and power is achieved. Based on the second - order VSG state equation, a Lyapunov function is constructed. Based on the kinetic energy and potential energy of the system, the stability of the system is analyzed. The Lyapunov function is used to judge the asymptotic stability of the system, and the stability constraint boundary is solved through matrix inequalities to determine the optimization interval of the parameters. In this process, using the generalized Lyapunov theory, by constructing a positive - definite matrix, the energy function of the VSG system satisfies the negative - definite condition within the entire operating range, thereby ensuring the stability of the system, and the feasible value ranges of the moment of inertia and damping coefficient are derived. Set the initial population of the genetic algorithm according to the parameter optimization interval, and perform binary encoding on the value ranges of the moment of inertia and the damping coefficient to obtain the chromosome encoding sequence. To ensure the diversity of the search, in the population initialization stage, the method of uniform random distribution is used to generate the initial population to cover a wider search space. A three - term weighted fitness function including the transient response time, overshoot, and steady - state error is established. Among them, the transient response time reflects the dynamic adaptability of the system to external disturbances, the overshoot determines the overshoot degree of the system, and the steady - state error measures the steady - state accuracy of the system. This fitness function is used as the optimization objective of the genetic algorithm, and by setting the crossover probability and mutation probability, an optimization iteration criterion is established to ensure that the algorithm converges to the optimal solution during a reasonable evolution process. During the optimization process of the genetic algorithm, roulette wheel selection is performed on the population to increase the survival probability of individuals with higher fitness, thereby accelerating the convergence speed. Through single - point crossover operation, gene exchange is performed on the selected individuals to increase the exploration ability of the search space. At the same time, uniform mutation operation is used to randomly mutate the genes of individuals with a certain probability to avoid the algorithm falling into a local optimal solution. In each generation of optimization process, individual screening is carried out through Lyapunov stability constraints, eliminating individuals that do not meet the stability conditions and retaining high - fitness individuals that meet the conditions, thereby gradually converging to the optimal parameter combination. After several generations of iterative optimization, the optimal solutions of the moment of inertia and damping coefficient that meet the stability requirements are obtained. Decode the optimal parameter combination and calculate the synchronous power coefficient and synchronous torque coefficient to further improve the calculation of the VSG parameter set. The synchronous power coefficient determines the dynamic response characteristics of the VSG in active power control, while the synchronous torque coefficient affects the regulation ability of the VSG to frequency changes.By reasonably calculating these parameters, ensure that the VSG operates stably under different working conditions and has good dynamic adaptability. Input the calculated VSG parameter group into the Deep Deterministic Policy Gradient (DDPG) network for parallel training to generate the real-time control strategy of the VSG. During the DDPG training process, use the experience replay mechanism to store historical training data and combine it with the target network to reduce gradient oscillation, thereby improving the training stability. At the same time, through the policy optimization of reinforcement learning, the VSG autonomously adjusts the control strategy under complex working conditions, improves the adaptability to external disturbances, and optimizes the operating efficiency of the converter.
[0017] Model the VSG parameter group and construct a state space based on the system frequency deviation, active power deviation, and reactive power deviation. Among them, the system frequency deviation is an important indicator to measure the synchronization of the VSG, while the active power deviation and reactive power deviation respectively determine the performance of the VSG in steady-state power regulation and dynamic voltage support. At the same time, set the proportional coefficient, integral coefficient, and differential coefficient of the DSP controller as the action space of the DDPG, so as to optimize the control strategy of the VSG by adjusting the controller parameters during the training process, and obtain the input-output mapping structure of the deep deterministic policy gradient network. This mapping structure ensures that the system state can be mapped to the optimal control parameters and can dynamically adjust the proportional, integral, and differential parameters of the controller to adapt to different operating conditions and external disturbances. Create a four-layer action network based on the input-output mapping structure. The first layer is the input layer, which receives the state variables of the VSG, such as frequency deviation, active power deviation, and reactive power deviation, and converts them into high-dimensional feature representations; the second layer is the hidden layer, which extracts features from the input signal through a non-linear activation function to improve the expression ability of the network and enhance the adaptability to complex working conditions; the third layer is the feature extraction layer, which uses an adaptive weighting mechanism to perform weighted summation on different input variables to highlight key features and reduce the interference of irrelevant information at the same time; the fourth layer is the action output layer, which outputs the adjusted DSP controller parameters, including the proportional coefficient, integral coefficient, and differential coefficient, so as to realize the optimization and adjustment of the VSG control strategy. At the same time, construct a corresponding four-layer evaluation network. The first layer is the state input layer, which receives the same input state information as the action network and provides basic data for subsequent calculations; the second layer is the action input layer, which receives the control output parameters from the action network and inputs them together with the state information into the evaluation network to calculate the performance of the current policy; the third layer is the evaluation hidden layer, which calculates the Q value using a non-linear regression model and extracts features through a neural network to improve the accuracy of policy evaluation; the fourth layer is the Q value output layer, which outputs the Q value of the current policy and is used for value update in reinforcement learning to guide the optimization of the policy network. Based on the four-layer action network and the four-layer evaluation network, construct a reward function that includes the system frequency stability, power tracking error, and controller output change rate to form a training optimization criterion. Among them, the system frequency stability is used to measure the stability of the VSG during the dynamic response process, the power tracking error reflects the adaptability of the controller to power demands, and the controller output change rate limits the drastic fluctuations of the control parameters, thereby improving the robustness of the system. The construction of the reward function uses the method of weighted summation to ensure the balance between different control objectives, and optimizes the reward function through the policy gradient method to make the training process effectively converge to the optimal policy.To achieve parallel training, the training optimization criterion is transmitted to the local server via the TCP / IP protocol, and on the server side, a multi-threaded parallel computing framework is used to perform parallel training on the four-layer action network and the four-layer evaluation network to accelerate the training process and improve the convergence speed of the model. During the training process, an experience replay mechanism is used to store historical data to reduce the impact of data correlation on the training results. At the same time, a target network is adopted to stabilize the training process to avoid the policy instability caused by gradient oscillation. After a large number of training iterations, the trained network parameters are obtained, and it is ensured that the model has good generalization ability under different working conditions. After the training is completed, the trained network parameters are downloaded to the DSP controller, and the policy network is updated online according to a preset period to adapt to the changes in different operating states and keep the real-time control strategy of the VSG always in the optimal state. During the actual operation process, the DSP controller calculates the control parameters in real time according to the collected frequency deviation, active power deviation, and reactive power deviation, and uses the trained deep policy network to perform online optimization and adjustment on the parameters to ensure that the VSG control performance of the PCS converter reaches the optimal.
[0018] Step 300: Apply a phase-locked loop compensation to the VSG real-time control strategy to obtain a synchronized compensated PWM modulation signal; It should be noted that based on the VSG real-time control strategy, Clark transformation and Park transformation are carried out to convert the three-phase stationary coordinate system voltage into the dq-axis voltage components in the synchronous rotating coordinate system. In traditional three-phase voltage control, the signal processing in the three-phase stationary coordinate system is affected by phase angle drift and unbalance factors. Therefore, the three-phase voltage signals are mapped to the αβ coordinate system through Clark transformation and then converted to the dq synchronous rotating coordinate system through Park transformation, so that the voltage signals can more clearly separate the DC component and the AC disturbance component. Through this conversion, the dq-axis voltage signal aligned with the rotating synchronous reference frame is obtained. The dq-axis voltage signal is input into an improved phase-locked loop (PLL) with a feed-forward link to extract the phase information and generate a phase compensation signal. The improved PLL with a feed-forward link speeds up the dynamic response speed by adding a feed-forward term and reduces the phase shift caused by transient disturbances. The input signal of the PLL is the dq-axis voltage component, and its core structure includes phase detection (PD), loop filtering (LF), and a voltage-controlled oscillator (VCO). The instantaneous phase deviation of the input voltage is calculated through the phase detection link, and combined with the prediction compensation mechanism of the feed-forward link, a phase compensation signal is output, thus reducing the phase shift problem of the system under dynamic conditions. Based on the phase compensation signal, an orthogonal integration link is constructed to generate a frequency correction amount, so that the system can maintain good synchronization when the grid frequency fluctuates. Voltage outer-loop regulation and current inner-loop regulation are performed on the frequency correction amount to obtain a compensated modulation wave. The voltage outer-loop regulation is used to ensure the stability of the system voltage and appropriately compensate the frequency correction amount to eliminate the frequency deviation caused by grid fluctuations, while the current inner-loop regulation is used to improve the current tracking accuracy and ensure that the system can quickly respond to external load changes. In the voltage outer-loop, the control objective is to input the corrected voltage error into a PI controller to generate a reference current signal, which is then input into the current inner-loop for fine adjustment. In the current inner-loop, the deviation between the actual output current and the reference current is compared, and a fast PI regulator is used for error compensation to ensure that the current can accurately track the set value and reduce grid harmonic interference. After the dual regulation of the outer-loop and the inner-loop, the final compensated modulation wave is obtained, and the stability of the system voltage and frequency is ensured. The compensated modulation wave is subjected to inverse Park transformation and inverse Clark transformation to restore the compensation signal from the dq-axis coordinate system to the three-phase stationary coordinate system, obtaining three-phase compensated voltages. Since the voltage is a DC component in the dq coordinate system and an AC quantity that changes with time in the three-phase stationary coordinate system, it is reconverted into a three-phase AC signal through the inverse transformation to meet the input requirements of PWM modulation. The inverse Park transformation converts the dq-axis signal back to the αβ coordinate system, and then it is restored to the ABC three-phase coordinate system through the inverse Clark transformation to ensure that the compensated voltage is correctly mapped to the physical grid signal. Space vector pulse width modulation (SVPWM) modulation is performed on the three-phase compensated voltages to generate the final synchronized and compensated PWM modulation signal.SVPWM effectively improves the DC-AC conversion efficiency and optimizes the output voltage waveform. By calculating the projection components of the three-phase voltage vectors in the spatial hexagonal region and selecting the appropriate switching sequence according to the sector position, it generates the PWM signal with the optimal duty cycle. During this process, SVPWM can reduce the switching losses, lower the harmonic content, and improve the output quality of the PCS converter.
[0019] Step 400: Perform real-time fault warning on the synchronized and compensated PWM modulation signal, and adopt voltage feedforward decoupling control to seamlessly switch between grid-connected and islanding modes to obtain a smooth transition control sequence.
[0020] Specifically, voltage, current, and power characteristic quantities are extracted from the synchronized and compensated PWM modulation signal to evaluate the system operation status. During the process of extracting characteristic quantities, the voltage and current signals are subjected to frequency-domain analysis through fast Fourier transform or wavelet transform, so as to extract the total harmonic distortion index, which reflects the harmonic content in the system and evaluates the power quality. At the same time, the grid voltage unbalance degree index is calculated to judge whether there is an inter-phase asymmetry problem in the system. And the power factor index is calculated to measure the matching degree between the active power and the apparent power of the system. These characteristic quantities together constitute the fault characteristic vector. The fault characteristic vector is input into a three-layer convolutional neural network for deep feature extraction to enhance the robustness of fault detection. The three-layer convolutional neural network structure includes an input layer, a feature extraction layer, and an output layer. Among them, the input layer receives the fault characteristic vector and extracts local patterns through one-dimensional convolution operations. The feature extraction layer uses multiple convolutional kernels to extract multi-scale fault features, and at the same time reduces the computational complexity through pooling operations to improve the generalization ability of the network. In the output layer, non-linear mapping is performed through a fully connected layer to obtain a high-dimensional deep feature vector, which characterizes the fault mode of the system and enhances the system's ability to identify different types of faults. A fuzzy rule set is constructed based on the deep feature vector, and a Mamdani inference engine is used for fuzzy inference. The fuzzy rule set is established based on expert experience and data-driven methods, mapping the deep feature vector to the fault confidence space. During the fuzzy inference process, the input variables are fuzzified, mapping the continuous variables to fuzzy sets, and rule matching is performed through the Mamdani inference mechanism. Finally, the centroid method is used for defuzzification operation to obtain the fault confidence, which is used to measure the severity of the current system fault. The fault confidence is compared with a preset threshold to judge whether there is a fault, and a label sequence including the fault type, fault degree, and fault location is generated to construct a real-time fault warning index. The fault type is classified through pattern matching methods, such as being classified into voltage sag, current harmonic over-standard, power factor abnormality, etc. The fault degree is graded based on the confidence value, such as mild, moderate, and severe, while the fault location is located through the time-frequency distribution characteristics of the feature vector, forming a complete fault warning system. On the basis of the fault warning system, in order to ensure that the system can maintain stable operation when a fault occurs, voltage feed-forward decoupling control is adopted to seamlessly switch the grid-connected and off-grid modes to achieve a smooth transition control sequence. The core of voltage feed-forward decoupling control lies in eliminating the impact during the mode switching process by dynamically compensating voltage disturbances. Its basic principle is to use the fault warning index to calculate the expected voltage waveform in advance and input it into the control system of the PCS converter through a feed-forward control strategy, so that when the mode is switched, the output voltage seamlessly docks with the set value of the new mode, avoiding transient overshoot or current mutation.In the grid-connected mode, the voltage feedforward control dynamically adjusts the VSG parameters according to the grid voltage fluctuations to ensure stable power output. In the off-grid mode, the feedforward control adapts to the load characteristics for voltage stability in the island mode. During the mode switching process, by adopting feedforward decoupling control, the sudden changes in voltage and current are effectively reduced, ensuring a smooth transition between different operating modes and ultimately obtaining a stable control sequence.
[0021] Set the switching conditions for the off-grid mode based on real-time fault warning indicators, and establish a power grid characteristic matrix including voltage amplitude, frequency, and phase. This characteristic matrix is used to describe the current operating state of the power grid, including the voltage fluctuation situation of the power grid, frequency stability, and phase synchronization degree. By setting reasonable switching thresholds, such as when the voltage drops exceed the set value, the frequency deviation exceeds the allowable range, or the power grid phase is out of synchronization, etc., as the switching trigger criterion. Through this trigger criterion, when the system detects grid anomalies, it can accurately judge whether a mode switch is required and determine the best timing for the switch to avoid unstable system operation caused by mis-switching or delayed switching. Construct a feed-forward compensator based on the switching trigger criterion, and decompose the system impedance matrix into a diagonal impedance matrix and a cross-coupling impedance matrix to obtain a decoupling compensation matrix. Since in the grid-connected mode, the PCS converter needs to work in coordination with the power grid, and in the off-grid mode, it needs to supply power independently, the output impedance characteristics of the converter will change. To ensure the stability of mode switching, accurately model the system impedance and decompose it into independent components, where the diagonal impedance matrix is used to describe the electrical characteristics of the converter itself, and the cross-coupling impedance matrix reflects the dynamic interaction between the converter and the power grid. By constructing a decoupling compensation matrix, effectively suppress the grid interference and reduce the transient impact during mode switching, enabling the system to smoothly transition to the new operating mode. Perform LU decomposition operation on the decoupling compensation matrix to calculate the feed-forward decoupling coefficients of the direct-axis (d-axis) and quadrature-axis (q-axis) voltages, and obtain the voltage compensation amount. In the dq synchronous rotating coordinate system of the converter, the dynamic response of voltage and current is affected by the cross-coupling effect. Through LU decomposition, the coupling relationship is separated, and the independent compensation amounts of the d-axis and q-axis are calculated respectively. The calculated voltage compensation amount can accurately compensate the power imbalance problem caused by voltage and current changes during the mode switching process, keep the output of the converter stable during the switching process, and avoid voltage dips or power fluctuations caused by grid disturbances. Superimpose the voltage compensation amount and the PWM modulation signal, and perform closed-loop regulation on the output power through a PI controller to obtain a power regulation sequence. The role of the PI controller is to dynamically adjust the compensation amount to ensure that the output power of the converter quickly follows the set value and reduce the impact of power mutations on system stability. By fusing the voltage compensation amount and the PWM modulation signal, accurately adjust the power output at the moment of mode switching and ensure the power balance of the converter in different modes, thereby improving the dynamic response ability of the system and enhancing the adaptability to grid disturbances. Apply a ramp control with a preset buffer time to the power regulation sequence to smoothly transition the control state quantity from the current mode to the target mode and achieve shockless switching. During the mode switching process, if the control state quantity is directly switched, it will cause sudden changes in voltage or current, thereby triggering system oscillations or overcurrent problems.To avoid this situation, the power adjustment sequence is slowly adjusted through ramp control, enabling the control parameters to gradually transition to the new set values within a certain period of time, so as to reduce the impact of mode switching on system stability. The core of ramp control is to adjust the control variable in a linear or non-linear manner within a preset buffer time, thereby ensuring that the converter smoothly transitions from the grid-connected mode to the off-grid mode, or from the off-grid mode back to the grid-connected mode, without significant voltage or power fluctuations. After completing the ramp control, the parameters of the second-order VSG state equation are reconfigured online based on the transition control sequence to complete the state migration between the grid-connected and off-grid modes, and finally obtain a smooth transition control sequence. In the VSG control strategy, the core parameters of the second-order state equation include moment of inertia, damping coefficient, synchronous power coefficient, etc. These parameters need to be dynamically adjusted in the grid-connected and off-grid modes to adapt to different operating environments. For example, in the grid-connected mode, the VSG is synchronized with the grid, so the moment of inertia and damping coefficient are appropriately reduced to improve the dynamic response speed, while in the off-grid mode, the inertia and damping are increased to enhance the anti-impact ability against load disturbances. Through the online reconfiguration of the VSG state equation parameters, it is ensured that the VSG can still maintain stable operation after mode switching and meet the requirements of the grid or load, thus achieving smooth transition control.
[0022] In the embodiments of this application, by introducing the multi-signal classification algorithm and the power signal decoupling method of adaptive virtual impedance, the accurate separation of interference components in different operating states is achieved, improving the transient response performance of the system. The genetic algorithm based on Lyapunov stability constraint is used to optimize the VSG parameters, combined with the parallel training mechanism of the deep deterministic policy gradient network, enhancing the stability of the system during bidirectional operation at rated power. An improved phase-locked loop compensation control strategy is designed, cooperating with the fuzzy adaptive fault detector, reducing the control period of the system under high-frequency switching conditions. The seamless grid-connected and off-grid switching scheme based on voltage feedforward decoupling control improves the power conversion efficiency and system reliability. The real-time data processing and TCP / IP parallel training architecture based on the double-buffer mechanism reduce the computational load of the DSP controller, ensuring the control accuracy under complex working conditions.
[0023] In a specific embodiment, the process of executing step 100 may specifically include the following steps: The output voltage, output current, DC bus voltage, and PWM modulation waveform of the PCS converter are digitally converted through a DSP chip to obtain a digital signal sequence; Based on the digital signal sequence, a spatial correlation matrix is constructed, and the noise subspace is calculated through eigenvalue decomposition to obtain the signal subspace projection matrix; Perform power spectrum estimation operations based on the signal subspace projection matrix to obtain the power spectral density function, and perform peak detection and adaptive threshold segmentation through the power spectral density function to obtain the energy contribution degrees of each frequency component; Classify and label the signal components according to the energy contribution degrees, and determine the amplitude and phase information of each component through maximum likelihood estimation to obtain the spectral feature vector.
[0024] Specifically, the DSP chip performs high-precision analog-to-digital conversion on the output voltage, output current, DC bus voltage, and PWM modulation waveform of the PCS converter, that is, discretizes the analog signal through a high-speed analog-to-digital converter (ADC) and generates a digital signal sequence. Assume that the output voltage signal of the PCS converter is and the output current signal is the DC bus voltage is and the PWM modulation waveform is In the discrete form after ADC sampling, it is expressed as: where is the sampling period, is the discrete time index. To ensure the quality of the sampled data, the sampling frequency should satisfy the Nyquist sampling theorem, that is: where is the highest frequency component of the signal to ensure that aliasing does not occur. Construct a spatial correlation matrix based on the digital signal sequence to extract the statistical characteristics of the signal. Assume that the length of the sampled signal sequence is , then construct a sliding window data set with a length of to form a matrix representation: Then calculate the spatial correlation matrix : where is a symmetric matrix that describes the statistical correlation between the signal channels of the PCS converter. Perform eigenvalue decomposition on the correlation matrix to obtain: where is the eigenvector matrix and is the diagonalized eigenvalue matrix. To distinguish the signal subspace and the noise subspace, sort according to the eigenvalue magnitude. Assume the first The larger eigenvalues correspond to the signal subspace, while the remaining eigenvalues correspond to the noise subspace. Then the signal subspace projection matrix is: where, are the eigenvectors corresponding to the larger eigenvalues. The power spectrum estimation operation is performed using the signal subspace projection matrix to obtain the spectral information of the signal. Among them, the multiple signal classification algorithm is a high-resolution spectral estimation method, and its power spectral density function is expressed as: where, is the direction vector related to the frequency and is used to characterize the projection of different frequency components in the signal subspace. By calculating the distribution of at different frequencies, the spectral characteristics of the PCS converter signal are obtained. Peak detection is performed on the power spectral density function to identify the main frequency components, and the energy contribution degree of each frequency component is calculated in combination with the adaptive threshold segmentation method. Let the power spectrum value at a certain frequency be , then the energy contribution degree of this frequency component is calculated as: By setting the dynamic threshold , the main signal components are screened out, that is: After determining the effective frequency components, the amplitude and phase information of these components are calculated by the maximum likelihood estimation method. Let the time-domain signal model of a certain effective frequency component be: where, is the amplitude, is the phase, is the Gaussian white noise. Then the optimal amplitude and phase can be calculated by the maximum likelihood estimation method: By calculating and for all the main frequency components, a complete spectral feature vector is obtained, that is: where, is the number of effective frequency components. This spectral feature vector is used for subsequent optimization of the VSG control strategy. For example, by analyzing the power distribution of the main frequency components, the inertia and damping parameters of the VSG are dynamically adjusted to improve the stability of the system.
[0025] In a specific embodiment, the process of executing step 200 may specifically include the following steps: Perform power angle - speed relationship analysis on the spectral feature vector to establish a second - order VSG state equation including the moment of inertia and damping coefficient; Construct a Lyapunov function based on the system kinetic energy and potential energy according to the second - order VSG state equation, solve the stability constraint boundary through matrix inequalities, and obtain the parameter optimization interval; Set the initial population of the genetic algorithm according to the parameter optimization interval, perform binary encoding on the value ranges of the moment of inertia and damping coefficient to obtain the chromosome encoding sequence; Establish a three - item weighted fitness function including transient response time, overshoot, and steady - state error for the chromosome encoding sequence, and set the crossover probability and mutation probability to obtain the optimization iteration criterion; Based on the optimization iteration criterion, perform roulette wheel selection, single - point crossover, and uniform mutation operations on the population, and perform individual screening through Lyapunov stability constraints to obtain the optimal parameter combination; Decode the optimal parameter combination and calculate the synchronous power coefficient and synchronous torque coefficient to obtain the VSG parameter group; Input the VSG parameter group into the deep deterministic policy gradient network for parallel training to generate the VSG real - time control strategy.
[0026] Specifically, extract the main oscillation mode of the system from the spectral feature vector of the PCS converter, and construct the mathematical model of the VSG based on the dynamic relationship between its power angle and synchronous speed The core control equation of the VSG is derived from the rotational motion equation of the synchronous generator, and its second - order form is expressed as: Among them, represents the virtual moment of inertia of the VSG, and its magnitude determines the inertial response ability of the system to external power fluctuations; is the damping coefficient, which is used to adjust the correction ability of the VSG to frequency deviation during the dynamic process; is the input mechanical power, corresponding to the power injected through the external power supply during the VSG control process; is the electromagnetic power, which is calculated from the power angle and the system voltage and its expression is as follows: Among them, and are the voltage amplitudes of the VSG and the grid side respectively; is the equivalent reactance, which is used to describe the power transmission ability between the VSG and the grid; is the power angle, which determines the magnitude of the VSG output power. Through the above state equations, the dynamic characteristics of the VSG under the change of the power angle are described. Based on the second-order VSG state equation, a Lyapunov function based on the system kinetic energy and potential energy is constructed to analyze the stability of the system. The construction of the Lyapunov function is based on the principle of system energy conservation, where the total energy of the system consists of a kinetic energy term and a potential energy term. The kinetic energy part is determined by the moment of inertia of the VSG, and its expression is: While the potential energy part is determined by the relationship between the power angle and the electromagnetic power of the VSG, and its expression is: Adding the two together gives the total Lyapunov function: To ensure the asymptotic stability of the system, the stability constraint boundary is solved through matrix inequalities to obtain the parameter optimization interval. According to the Lyapunov stability theory, it is required that: Thus, a linear matrix inequality is constructed: where is the state feedback gain matrix, and the moment of inertia and the damping coefficient are obtained by solving this matrix inequality. The feasible value ranges of and are used to ensure the stability of the VSG system. After obtaining the parameter optimization interval based on the stability constraints, the initial population of the genetic algorithm is set, and the moment of inertia and the damping coefficient are binary-coded to generate the chromosome coding sequence. Assuming that the value range of the moment of inertia is from to , and the value range of the damping coefficient is from to , then, in the binary-coding method, the parameters are mapped to binary strings of a fixed length. For example, and are respectively represented as 10-bit binary numbers to ensure sufficient search accuracy. After completing the binary coding, a weighted fitness function including the transient response time , the overshoot and the steady-state error is constructed as the optimization objective of the genetic algorithm, and its mathematical form is as follows: where is a weighting factor that determines the influence weight of different performance indicators on the optimization process. During the iterative process of the genetic algorithm, the roulette wheel selection strategy is adopted, and the fitness function value is used as the selection probability to select individuals from the population for reproduction; then a single-point crossover operation is performed to exchange part of the genes of the parent individuals at a random position to generate new chromosomes; a uniform mutation operation is performed to randomly flip certain bits in the chromosome with a small probability to increase the search diversity and prevent local optimal solutions. After each generation of iteration, the individuals in the population are screened through the Lyapunov stability constraint, and the parameter combinations that do not meet the stability conditions are eliminated, and finally the optimal parameter combination is obtained. The optimal parameter combination is decoded, and the synchronous power coefficient and the synchronous torque coefficient are calculated, where: The calculated VSG parameter group is input into the Deep Deterministic Policy Gradient (DDPG) network for parallel training to generate the VSG real-time control strategy. DDPG adopts the deep reinforcement learning method, stores historical training data based on the experience replay mechanism, and optimizes the VSG control strategy through the policy gradient method, enabling it to autonomously adjust the inertia and damping parameters under complex working conditions and improve the dynamic response ability.
[0027] In a specific embodiment, the process of performing the step of inputting the VSG parameter group into the deep deterministic policy gradient network for parallel training to generate the VSG real-time control strategy may specifically include the following steps: Construct a state space for the VSG parameter group according to the system frequency deviation, active power deviation, and reactive power deviation, and set the proportional coefficient, integral coefficient, and differential coefficient of the DSP controller as the action space to obtain the input-output mapping structure of the deep deterministic policy gradient network; Create a four-layer action network based on the input-output mapping structure. The first layer of the four-layer action network is the input layer, the second layer is the hidden layer, the third layer is the feature extraction layer, and the fourth layer is the action output layer; Create a corresponding four-layer evaluation network based on the input-output mapping structure. The first layer of the four-layer evaluation network is the state input layer, the second layer is the action input layer, the third layer is the evaluation hidden layer, and the fourth layer is the Q-value output layer; Based on the four-layer action network and the four-layer evaluation network, construct a reward function including the system frequency stability, power tracking error, and controller output change rate to obtain the training optimization criterion; Transmit the training optimization criterion to the local server through the TCP / IP protocol, and perform parallel training on the four-layer action network and the four-layer evaluation network to obtain the trained network parameters; Download the trained network parameters to the DSP controller, and update the policy network online according to a preset period to output the VSG real-time control strategy.
[0028] Specifically, construct a state space based on the frequency deviation, active power deviation, and reactive power deviation of the system, and set the proportional coefficient, integral coefficient, and differential coefficient of the DSP controller as the action space, so as to establish the input-output mapping structure of the deep deterministic policy gradient network. The state variables of the system are expressed as: Among them, is the system frequency deviation, representing the current frequency and the reference frequency The deviation between them; is the active power deviation, representing the active power issued by the VSG and the set reference power The error between them; is the reactive power deviation, describing the reactive power output of the VSG and the set value The difference. In order to ensure that the VSG can effectively regulate the system power balance, the proportional coefficient of the DSP controller, the integral coefficient and the differential coefficient are set as action variables to form the action space: Among them, is used to improve the fast response ability of the control system, eliminate the steady-state error, then helps to suppress oscillations and improve dynamic stability. By establishing a mapping between the state space and the action space, the DDPG network generates optimal control parameters according to the current state of the system to adjust the control strategy of the VSG in real time. On this basis, create a four-layer action network as the policy network of DDPG for mapping from the state space to the control parameters. The first layer of the four-layer action network is the input layer, which receives the state variable as input; the second layer is the hidden layer, which uses a fully connected neural network and performs non-linear mapping through the ReLU activation function to enhance the feature extraction ability of the network; the third layer is the feature extraction layer, which further optimizes the feature distribution of the input signal through convolution operations to reduce data redundancy and improve the robustness of the control parameters; the fourth layer is the action output layer, which generates the optimal , and Parameters are used to optimize the PID regulation performance of the DSP controller. Meanwhile, a corresponding four-layer evaluation network is created to evaluate the effectiveness of the current strategy and guide the optimization of the policy network. The first layer of the four-layer evaluation network is the state input layer, which receives the current state as input; the second layer is the action input layer, which receives the control parameters generated by the policy network ; the third layer is the evaluation hidden layer, which adopts a deep neural network structure to extract features from the combination of the state and the action and calculates its impact on the system stability; the fourth layer is the Q-value output layer, which calculates the value function of the current state-action pair: where is the reward function value, is the discount factor, and represent the state and action at the next moment respectively. The Q-value is used to measure the contribution of the given control parameters to the system operation, thereby guiding the policy optimization. To train the DDPG network, a reward function including the system frequency stability, power tracking error, and controller output change rate is constructed and used as the training optimization criterion. The mathematical expression of the reward function is defined as: where are the weight coefficients of the system frequency stability, power tracking error, and reactive power regulation error, is the weight coefficient of the controller output change rate, and is the exponential decay factor, which is used to control the influence of different error terms on the reward value. The design of this reward function ensures that the DDPG network preferentially optimizes the frequency stability and power tracking performance, and at the same time avoids large fluctuations in the control parameters to ensure the smooth operation of the VSG system. During the training process, the training optimization criterion is transmitted to the local server through the TCP / IP protocol, and a parallel computing framework based on GPU acceleration is deployed on the server side to train the four-layer action network and the four-layer evaluation network simultaneously. The training adopts an experience replay mechanism, that is, storing historical state-action pairs and randomly sampling during each training to reduce data correlation and improve training stability. The target network is used for soft update to avoid gradient oscillation and optimize the convergence speed. After the training is completed, the optimized policy network parameters are obtained and downloaded to the DSP controller for online control of the VSG. Meanwhile, in order to adapt to different operating conditions, the DSP controller updates the policy network online according to a preset period, that is, during the operation, the system state is collected in real time and the control parameters are continuously optimized to ensure that the VSG always maintains the optimal control performance.
[0029] In a specific embodiment, the process of executing step 300 may specifically include the following steps: Based on the VSG real-time control strategy, Clark transformation and Park transformation are performed to convert the three-phase stationary coordinate system voltage into dq synchronous rotating coordinate system voltage components, obtaining dq-axis voltage signals; The dq-axis voltage signals are input into an improved phase-locked loop with a feed-forward link to obtain phase compensation signals, and an orthogonal integration link is constructed based on the phase compensation signals to obtain frequency correction amounts; Voltage outer-loop regulation and current inner-loop regulation are performed on the frequency correction amounts to obtain compensated modulation waves; The compensated modulation waves are subjected to inverse Park transformation and inverse Clark transformation to restore the compensation signals to the three-phase stationary coordinate system, obtaining three-phase compensation voltages, and the three-phase compensation voltages are subjected to SVPWM modulation to obtain PWM modulation signals after synchronous compensation.
[0030] Specifically, Clark transformation and Park transformation are performed on the three-phase stationary coordinate system voltage to convert it into dq synchronous rotating coordinate system voltage components, obtaining dq-axis voltage signals. Assume that the voltage components in the three-phase stationary coordinate system are respectively and and , and they are converted into the αβ coordinate system through Clark transformation. The conversion formula is as follows: where, and are respectively the α-axis and β-axis voltage components after Clark transformation. In order to obtain the dq-axis voltage signals in the synchronous rotating coordinate system, Park transformation is performed. The transformation formula is as follows: where, is the phase angle between the current coordinate system and the rotating coordinate system, is the d-axis voltage component, representing the DC component in the synchronous rotating coordinate system, is the q-axis voltage component, representing the projection of the synthesis of the AC and DC components of the voltage. Through Clark-Park transformation, the three-phase voltage signals are mapped to the synchronous rotating coordinate system, enabling the control system to be analyzed and adjusted in the fixed dq coordinate system. The dq-axis voltage signals are input into an improved phase-locked loop (PLL) with a feed-forward link to calculate the phase compensation signals of the system. The basic structure of the PLL consists of a phase detector (PD), a loop filter (LF), and a voltage-controlled oscillator (VCO), and the PLL with a feed-forward link can improve the dynamic response performance and reduce the phase delay. The basic phase error calculation of the PLL is as follows: where, represents the current phase error, and is the voltage component after Park transformation. To enhance the response speed, a feedforward compensation link is introduced in the PLL, and its control equation is expressed as: where is the grid angular velocity estimated by the PLL, is the rated angular velocity, and are the proportional and integral gain parameters of the PLL respectively. Based on the phase compensation signal calculated by the PLL, an orthogonal integration link is constructed to obtain the frequency correction amount: where represents the frequency deviation of the system, and this deviation information is used to control the outer-loop voltage regulation and inner-loop current regulation of the VSG. Based on the frequency correction amount, the compensation modulation wave is optimized by using the voltage outer-loop regulation and current inner-loop regulation. The voltage outer-loop uses a PI controller to adjust the reference voltage according to the frequency correction amount, and the control equation is: where is the desired d-axis voltage, is the reference voltage, and are the PI control parameters of the voltage outer-loop. The inner-loop current regulation adopts a double closed-loop control, and its regulation equation is as follows: where is the desired q-axis current, is the reference current, and are the PI control parameters of the current inner-loop. Through the double-loop control, fast dynamic response is achieved and the compensation accuracy is improved. The compensation modulation wave is subjected to inverse Park transformation and inverse Clark transformation to restore the compensation signal to the three-phase stationary coordinate system. Perform inverse Park transformation: Perform inverse Clark transformation to convert the αβ coordinate system signal back to the three-phase coordinate system: The obtained three-phase compensation voltages , and are processed by space vector pulse width modulation (SVPWM) to generate the final PWM modulation signal. The calculation of SVPWM is based on the projection of the voltage vector in the sector, and its modulation strategy optimizes the switching sequence by calculating the action time of the basic voltage vector, so that the output voltage has lower harmonic distortion. The SVPWM calculation formula is as follows: Among them, and are the action times of two-phase space vectors, is the action time of the zero vector, is the PWM period. Through SVPWM modulation, the final PWM signal is obtained, and the PCS converter is driven by the DSP controller to achieve high-precision control of the VSG.
[0031] In a specific embodiment, the process of executing step 400 may specifically include the following steps: Extract the voltage, current, and power characteristic quantities of the synchronized and compensated PWM modulation signal, calculate the THD index, unbalance degree index, and power factor index, and generate a fault feature vector; Input the fault feature vector into a three-layer convolutional neural network for deep feature extraction to obtain a deep feature vector; Construct a fuzzy rule set based on the deep feature vector, and use the Mamdani inference engine and the centroid method for defuzzification operation to obtain the fault confidence level; Compare and judge the fault confidence level with a preset threshold, generate a label sequence including the fault type, fault degree, and fault location, and obtain a real-time fault warning index; Based on the real-time fault warning index, use voltage feedforward decoupling control to seamlessly switch the grid-connected and islanding modes to obtain a smooth transition control sequence.
[0032] Specifically, perform time-domain and frequency-domain analysis on the output signal of the PCS converter. Assume that the three-phase voltage signals are respectively , and , and the three-phase current signals are respectively , and . Use Fourier transform to perform harmonic analysis on them, calculate the total harmonic distortion (THD) index, which is defined as follows: Among them, represents the effective value of the th harmonic component, is the effective value of the fundamental wave component. THD is used to measure the harmonic content in the system output voltage or current. If the THD exceeds the allowable threshold, it means that there are faults such as nonlinear loads, grid interference, or modulation abnormalities in the system. Calculate the voltage unbalance degree index to measure the symmetry of the three-phase voltage. The unbalance degree can be defined as the ratio of the negative-sequence voltage to the positive-sequence voltage: Among them, and represent the positive-sequence voltage and negative-sequence voltage respectively. If is too high, it indicates that an asymmetric fault has occurred in the three-phase voltage, such as single-phase open phase, power grid short circuit, or inverter abnormality. The power factor is a key power quality index and is defined as follows: Among them, is the active power, is the reactive power. If the power factor deviates from the normal range, it means that the load characteristics have changed, the power grid voltage has fluctuated, or there is a reactive power compensation fault. After calculating the above characteristic quantities, they are composed into a fault characteristic vector: This vector is input into a three-layer convolutional neural network for deep feature extraction. The first layer of the convolutional neural network is the input layer, which receives the fault characteristic vector and performs normalization processing; the second layer is the convolutional layer, which uses multiple one-dimensional convolutional kernels to extract local features of the signal, and its convolution operation is defined as follows: Among them, is the convolutional kernel weight, is the bias term, is the convolutional output, is the convolutional kernel size. The third layer is the pooling layer, which uses the max pooling method to reduce the feature dimension to improve the calculation efficiency and anti-interference ability. A fuzzy rule set is constructed based on the deep feature vector, and a Mamdani inference engine is used for fault identification. The basic process of Mamdani fuzzy inference includes fuzzification, inference calculation, and defuzzification. Among them, the input variables include THD, voltage unbalance degree, and power factor. The fuzzy sets low, medium, high are set, and membership functions are used to represent different levels of fuzziness. For example: Among them, is the mean value, is the standard deviation. Fuzzy inference is performed based on the fuzzy rule set to obtain the fault confidence: Among them, is the fuzzy membership degree, is the weight coefficient. The fault confidence is obtained through defuzzification by the centroid method. If exceeds the preset threshold , it is considered that the system has a fault, and a tag sequence including the fault type, fault degree, and fault location is generated. After obtaining the real-time fault warning index, voltage feedforward decoupling control is used to seamlessly switch between grid-connected and off-grid modes. A voltage feedforward compensation model is established, and the voltage reference value in the grid-connected mode is set and as well as the expected voltage in the off-grid mode : Among them, and are the feedforward compensation coefficients. For the current control part, double-loop control is adopted, where the current outer loop adjusts the reference current: Among them, and are the current controller parameters. The PWM modulation signal is generated through SVPWM control to enable the system to achieve smooth transition between grid-connected and off-grid modes.
[0033] In a specific embodiment, the process of performing the step of seamlessly switching between grid-connected and off-grid modes based on the real-time fault warning index by using voltage feedforward decoupling control to obtain a smooth transition control sequence may specifically include the following steps: Set the grid-connected and off-grid mode switching conditions based on the real-time fault warning index, establish a grid feature matrix including voltage amplitude, frequency, and phase, and obtain the switching trigger criterion; Construct a feedforward compensator based on the switching trigger criterion, decompose the system impedance matrix into a diagonal impedance matrix and a cross-coupling impedance matrix, and obtain the decoupling compensation matrix; Perform LU decomposition operation on the decoupling compensation matrix, calculate the feedforward decoupling coefficients of the direct-axis and quadrature-axis voltages, and obtain the voltage compensation amount; Superimpose the voltage compensation amount and the PWM modulation signal, and perform closed-loop regulation on the output power through a PI controller to obtain a power regulation sequence; Apply ramp control with a preset buffer time to the power regulation sequence, smoothly transition the control state quantity from the current mode to the target mode, and obtain a transition control sequence; Based on the transition control sequence, perform online reconfiguration of the parameters of the second-order VSG state equation, complete the state migration between grid-connected and off-grid modes, and obtain a smooth transition control sequence.
[0034] Specifically, set the switching conditions of the grid-connected and off-grid modes based on the real-time fault warning index, establish a grid feature matrix including voltage amplitude, frequency, and phase, and calculate the switching trigger criterion through this matrix. Assume that the three-phase voltages of the grid are respectively , and the currents are respectively , which is converted into the components on the axis and axis through Clark transformation and Park transformation: wherein, is obtained through Clark transformation, while represents the instantaneous phase angle of the power grid. The power grid frequency is calculated through the phase change rate: The voltage amplitude , frequency and phase are combined to form the power grid feature matrix: This matrix is used to characterize the current power grid state, and the switching trigger criterion is set in combination with the real-time fault warning index. If the voltage amplitude is lower than the set threshold , the frequency deviation exceeds the allowable range or the phase synchronization error is too large, then the off-grid mode switching is triggered: wherein, is the rated frequency and phase of the system. After meeting the switching conditions, a feed-forward compensator is constructed, and the impedance matrix of the system is decomposed into a diagonal impedance matrix and a cross-coupling impedance matrix to obtain the decoupling compensation matrix. Assume that the system equivalent impedance matrix is composed of the self-impedance and the coupling impedance : wherein, respectively represent the impedances on the axis and axis, while reflects the coupling effect between the two axes. For decoupling, it is decomposed into a diagonal impedance matrix and a cross-coupling impedance matrix : Solve through LU decomposition to obtain the voltage feed-forward decoupling coefficient: wherein, is the parameter of the lower triangular matrix after LU decomposition, are respectively the axis and axis after feed-forward compensation,Axis voltage. The calculated voltage compensation amount is superimposed on the PWM modulation signal, and the output power is closed-loop regulated through a PI controller to obtain a power regulation sequence. Set the target voltage And perform PI control: Among them, Are the gain parameters of the PI controller respectively. The current command is dynamically adjusted through this controller to ensure the power balance of the system. After obtaining the power regulation sequence, ramp control with a preset buffer time is applied to smoothly transition the control state quantity from the current mode to the target mode and avoid system oscillation caused by mutations. The ramp function is set as follows: Among them, Are the voltage values before switching respectively, Is the target voltage after switching, Is the buffer time. This ramp control can effectively reduce the impact during mode switching. After completing the ramp control, based on the transition control sequence, the parameters of the second-order VSG state equation are reconfigured online to achieve the state migration between grid-connected and off-grid modes. The second-order state equation of VSG is: Among them, Is the virtual inertia, Is the damping coefficient, Is the instantaneous angular velocity, Is the reference angular velocity, Are the input and output powers respectively. During grid-connected and off-grid switching, reconfigure And To adapt to the new working mode. Assume that the off-grid mode inertia Needs to be increased to improve frequency stability, and the damping coefficient Needs to be readjusted. Then the configuration update equation is as follows: Among them, Is the adjustment coefficient to ensure smooth parameter changes, thus realizing the seamless migration of the VSG mode. By adjusting the VSG parameters, the converter realizes a smooth transition between grid-connected and off-grid modes and ensures the continuity and stability of system operation.
[0035] The VSG control method of the DSP numerical control high-frequency bidirectional PCS converter in the embodiments of the present application has been described above. Next, the VSG control device 10 of the DSP numerical control high-frequency bidirectional PCS converter in the embodiments of the present application will be described. Please refer to Figure 2 An embodiment of the VSG control device 10 of the DSP numerical control high-frequency bidirectional PCS converter in the embodiments of the present application includes: A multi-signal classification module 11, configured to perform multi-signal classification on the output voltage, output current, DC bus voltage, and PWM modulation waveform of the PCS converter through a DSP chip to obtain a spectral feature vector; A calculation module 12, configured to calculate a VSG parameter set based on the spectral feature vector, and input the VSG parameter set into a deep deterministic policy gradient network for parallel training to generate a VSG real-time control policy; A compensation module 13, configured to apply a phase-locked loop compensation to the VSG real-time control policy to obtain a synchronized and compensated PWM modulation signal; A switching module 14, configured to perform real-time fault warning on the synchronized and compensated PWM modulation signal, and perform seamless switching between grid-connected and off-grid modes by using voltage feedforward decoupling control to obtain a smooth transition control sequence.
[0036] Through the collaborative cooperation of the above-mentioned components, by introducing a multi-signal classification algorithm and a power signal decoupling method with adaptive virtual impedance, the accurate separation of interference components under different operating states is achieved, and the transient response performance of the system is improved. The genetic algorithm based on Lyapunov stability constraint is used to optimize the VSG parameters, combined with the parallel training mechanism of the deep deterministic policy gradient network, to enhance the stability of the system during bidirectional operation at rated power. An improved phase-locked loop compensation control strategy is designed, combined with a fuzzy adaptive fault detector, to reduce the control period of the system under high-frequency switching conditions. The grid-connected and off-grid seamless switching scheme based on voltage feedforward decoupling control improves the power conversion efficiency and system reliability. The real-time data processing and TCP / IP parallel training architecture based on the double-buffer mechanism reduce the computing load of the DSP controller and ensure the control accuracy under complex working conditions.
[0037] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.
[0038] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, the technical solution of this application, in essence, or the part that makes a contribution to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing an electronic device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.
[0039] As described above, the above embodiments are only used to illustrate the technical solution of this application, rather than to limit it; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of various embodiments of this application.
Claims
1. A VSG control method for a DSP numerically controlled high-frequency bidirectional PCS converter, characterized in that, The method includes: Performing multi-signal classification on the output voltage, output current, DC bus voltage, and PWM modulation waveform of the PCS converter through a DSP chip to obtain a spectral feature vector; Calculating a VSG parameter set based on the spectral feature vector and inputting the VSG parameter set into a deep deterministic policy gradient network for parallel training to generate a VSG real-time control strategy; Applying a phase-locked loop compensation to the VSG real-time control strategy to obtain a PWM modulation signal after synchronous compensation; Performing real-time fault warning on the PWM modulation signal after synchronous compensation and performing seamless switching between grid-connected and off-grid modes using voltage feedforward decoupling control to obtain a smooth transition control sequence.
2. The VSG control method of the DSP numerical control high-frequency bidirectional PCS converter according to claim 1, wherein The performing multi-signal classification on the output voltage, output current, DC bus voltage, and PWM modulation waveform of the PCS converter through a DSP chip to obtain a spectral feature vector includes: Performing digital conversion on the output voltage, output current, DC bus voltage, and PWM modulation waveform of the PCS converter through a DSP chip to obtain a digital signal sequence; Constructing a spatial correlation matrix based on the digital signal sequence and calculating a noise subspace through eigenvalue decomposition to obtain a signal subspace projection matrix; Performing a power spectrum estimation operation based on the signal subspace projection matrix to obtain a power spectral density function, and performing peak detection and adaptive threshold segmentation through the power spectral density function to obtain the energy contribution degree of each frequency component; Classifying and marking signal components according to the energy contribution degree and determining the amplitude and phase information of each component through maximum likelihood estimation to obtain a spectral feature vector.
3. The VSG control method of the DSP numerical control high-frequency bidirectional PCS converter according to claim 1, wherein The calculating a VSG parameter set based on the spectral feature vector and inputting the VSG parameter set into a deep deterministic policy gradient network for parallel training to generate a VSG real-time control strategy includes: Analyzing the power angle-speed relationship of the spectral feature vector to establish a second-order VSG state equation including moment of inertia and damping coefficient; Constructing a Lyapunov function based on the system kinetic energy and potential energy based on the second-order VSG state equation, and solving the stability constraint boundary through matrix inequality to obtain a parameter optimization interval; Setting the initial population of the genetic algorithm according to the parameter optimization interval, performing binary encoding on the value ranges of the moment of inertia and damping coefficient to obtain a chromosome encoding sequence; Establishing a three-term weighted fitness function including transient response time, overshoot, and steady-state error for the chromosome encoding sequence and setting the crossover probability and mutation probability to obtain an optimization iteration criterion; Based on the optimization iteration criterion, performing roulette wheel selection, single-point crossover, and uniform mutation operations on the population, and screening individuals through Lyapunov stability constraints to obtain an optimal parameter combination; Decoding the optimal parameter combination and calculating the synchronous power coefficient and synchronous torque coefficient to obtain a VSG parameter set; Inputting the VSG parameter set into a deep deterministic policy gradient network for parallel training to generate a VSG real-time control strategy.
4. The VSG control method of the DSP numerically controlled high-frequency bidirectional PCS converter according to claim 3, characterized in that, The inputting the VSG parameter set into a deep deterministic policy gradient network for parallel training to generate a VSG real-time control strategy includes: Construct a state space for the VSG parameter group according to the system frequency deviation, active power deviation, and reactive power deviation, and set the proportional coefficient, integral coefficient, and differential coefficient of the DSP controller as the action space to obtain the input-output mapping structure of the deep deterministic policy gradient network; Create a four-layer action network based on the input-output mapping structure. The first layer of the four-layer action network is the input layer, the second layer is the hidden layer, the third layer is the feature extraction layer, and the fourth layer is the action output layer; Create a corresponding four-layer evaluation network based on the input-output mapping structure. The first layer of the four-layer evaluation network is the state input layer, the second layer is the action input layer, the third layer is the evaluation hidden layer, and the fourth layer is the Q-value output layer; Based on the four-layer action network and the four-layer evaluation network, construct a reward function including the system frequency stability, power tracking error, and controller output change rate to obtain the training optimization criterion; Transmit the training optimization criterion to the local server through the TCP / IP protocol, and perform parallel training on the four-layer action network and the four-layer evaluation network to obtain the trained network parameters; Download the trained network parameters to the DSP controller, and update the policy network online according to a preset period to output the VSG real-time control strategy.
5. The VSG control method of the DSP numerical control high-frequency bidirectional PCS converter according to claim 1, wherein, Applying phase-locked loop compensation to the VSG real-time control strategy to obtain a synchronized compensated PWM modulation signal includes: Perform Clark transformation and Park transformation based on the VSG real-time control strategy to convert the three-phase stationary coordinate system voltage into dq synchronous rotating coordinate system voltage components to obtain dq-axis voltage signals; Input the dq-axis voltage signals into an improved phase-locked loop with a feedforward link to obtain a phase compensation signal, and construct an orthogonal integration link based on the phase compensation signal to obtain a frequency correction amount; Perform voltage outer loop regulation and current inner loop regulation on the frequency correction amount to obtain a compensated modulation wave; Perform inverse Park transformation and inverse Clark transformation on the compensated modulation wave to restore the compensation signal to the three-phase stationary coordinate system to obtain three-phase compensation voltages, and perform SVPWM modulation on the three-phase compensation voltages to obtain a synchronized compensated PWM modulation signal.
6. The VSG control method of the DSP numerically controlled high-frequency bidirectional PCS converter according to claim 1, wherein Performing real-time fault warning on the synchronized compensated PWM modulation signal and using voltage feedforward decoupling control to seamlessly switch between grid-connected and off-grid modes to obtain a smooth transition control sequence includes: Extract voltage, current, and power characteristic quantities from the synchronized compensated PWM modulation signal, calculate THD index, unbalance degree index, and power factor index, and generate a fault feature vector; Input the fault feature vector into a three-layer convolutional neural network for deep feature extraction to obtain a deep feature vector; Construct a fuzzy rule set based on the deep feature vector, and use the Mamdani inference engine and centroid method for defuzzification operation to obtain a fault confidence level; Compare and judge the fault confidence level with a preset threshold to generate a label sequence including fault type, fault degree, and fault location to obtain a real-time fault warning index; Based on the real-time fault warning index, seamless switching of the grid-connected and off-grid modes is performed by voltage feedforward decoupling control to obtain a smooth transition control sequence.
7. The VSG control method of the DSP numerically controlled high-frequency bidirectional PCS converter according to claim 6, characterized in that, The seamless switching of the grid-connected and off-grid modes by voltage feedforward decoupling control based on the real-time fault warning index to obtain a smooth transition control sequence includes: Setting the grid-connected and off-grid mode switching conditions based on the real-time fault warning index, establishing a grid feature matrix including voltage amplitude, frequency and phase, and obtaining a switching trigger criterion; Constructing a feedforward compensator based on the switching trigger criterion, decomposing the system impedance matrix into a diagonal impedance matrix and a cross-coupling impedance matrix, and obtaining a decoupling compensation matrix; Performing LU decomposition operation on the decoupling compensation matrix, calculating the feedforward decoupling coefficients of the direct-axis and quadrature-axis voltages, and obtaining a voltage compensation amount; Superimposing the voltage compensation amount and the PWM modulation signal, and performing closed-loop regulation on the output power through a PI controller to obtain a power regulation sequence; Applying ramp control with a preset buffer time to the power regulation sequence, smoothly transitioning the control state quantity from the current mode to the target mode, and obtaining a transition control sequence; Based on the transition control sequence, online reconfiguring the parameters of the second-order VSG state equation, completing the state migration of the grid-connected and off-grid modes, and obtaining a smooth transition control sequence.
8. A VSG control device for a DSP numerically controlled high-frequency bidirectional PCS converter, characterized in that, A device for implementing the VSG control method of the DSP numerically controlled high-frequency bidirectional PCS converter as claimed in claim 1, the device includes: A multi-signal classification module for performing multi-signal classification on the output voltage, output current, DC bus voltage and PWM modulation waveform of the PCS converter through a DSP chip to obtain a spectral feature vector; A calculation module for calculating a VSG parameter set based on the spectral feature vector, and inputting the VSG parameter set into a deep deterministic policy gradient network for parallel training to generate a VSG real-time control strategy; A compensation module for applying phase-locked loop compensation to the VSG real-time control strategy to obtain a PWM modulation signal after synchronous compensation; A switching module for performing real-time fault warning on the PWM modulation signal after synchronous compensation, and performing seamless switching of the grid-connected and off-grid modes by voltage feedforward decoupling control to obtain a smooth transition control sequence.
Citation Information
Cited By
Voltage stabilizer control method and system based on static decoupling and BP-PID
CN120891730A
Control method for switching off-grid to grid-connected, energy storage device and energy storage system
CN120914915A
Control method for off-grid and grid-connected, energy storage device and energy storage system
CN120914915B
Flexible voltage regulation control method and system based on power electronic conversion
CN121124254A
Flexible voltage regulation control method and system based on power electronic conversion
CN121124254B