Grid-connected and off-grid switching control method and device for optical storage inverter system
By constructing a phase synchronization and amplitude synchronization control method for the photovoltaic-storage inverter system, the problem of insufficient synchronization accuracy during the switch from off-grid mode to grid-connected mode of the photovoltaic-storage inverter system is solved, realizing a smooth switch between the inverter and the grid, and ensuring the continuity and stability of power supply.
Patent Information
- Application Number
- CN202511005884.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-21
- Publication Date
- 2025-11-21
AI Technical Summary
Existing photovoltaic-storage inverter systems struggle to sense and respond to dynamic changes in grid voltage in real time and accurately during the transition from off-grid to grid-connected mode, leading to problems such as phase asynchrony, voltage amplitude mismatch, large inrush current, and discontinuous switching.
By acquiring the real-time grid voltage and inverter output voltage phase in the off-grid state, a target synchronization quantity is constructed, including the grid voltage phase and the effective value of the grid voltage. Phase synchronization control and amplitude synchronization control are then executed to ensure that the phase difference and amplitude difference are within the preset range before switching to the grid-connected state.
It achieves synchronous control of inverter output voltage and grid voltage in both phase and amplitude dimensions, effectively avoiding phase abrupt changes and amplitude mismatch during switching, improving the smoothness and safety of switching, and realizing seamless grid connection.
Smart Images

Figure CN120999733A_ABST
Abstract
Description
[Technical Field] This application relates to the field of new energy technology, and in particular to a grid-connected / off-grid switching control method and device for photovoltaic-storage inverter systems. [Background Technology] A photovoltaic-storage inverter system is a type of power system that integrates photovoltaic power generation with energy storage units. It supports both grid-connected operation and off-grid independent power supply modes. In practical applications, to ensure continuous power supply to critical loads under various operating conditions, the system needs to enable the inverter to quickly switch between grid-connected and off-grid modes when the grid experiences an anomaly or returns to normal, ensuring uninterrupted power supply and stable system operation.
[0001] With the increasing penetration rate of renewable energy, integrated photovoltaic (PV) and energy storage (ESS) systems are being widely used in microgrids. These systems require frequent switching between off-grid and grid-connected modes. However, existing PV-ESS inverter systems mostly rely on fixed threshold judgments, preset delay logic, or hardware detection methods during the switch from off-grid to grid-connected mode. This makes it difficult to perceive and respond to dynamic changes in grid voltage in real time and accurately, leading to problems such as phase asynchrony, voltage amplitude mismatch, large inrush current, and discontinuous switching. Therefore, how to suppress inrush current and achieve smooth closure while ensuring synchronization accuracy is one of the key technical challenges that urgently needs to be overcome in the grid-connected control of current PV-ESS inverter systems. [Summary of the Invention] To address the problem that existing photovoltaic-storage inverter systems struggle to seamlessly switch from off-grid to grid-connected modes.
[0002] In a first aspect, the present invention provides a grid-connected / off-grid switching control method for a photovoltaic-storage inverter system, comprising: Obtain the real-time grid voltage and inverter output voltage phase under off-grid conditions; A target synchronization quantity is constructed based on the real-time grid voltage, and the target synchronization quantity includes the grid voltage phase and the effective value of the grid voltage. Phase synchronization control is performed based on the difference between the grid voltage phase and the inverter output voltage phase. Based on the real-time grid voltage and the effective value of the grid voltage, amplitude synchronization control is performed; When both the phase synchronization control and amplitude synchronization control meet the preset synchronization conditions, the off-grid state will be switched to the grid-connected state.
[0003] Optionally, the target synchronization quantity includes the grid voltage phase angle, and the step of constructing the target synchronization quantity based on the real-time grid voltage specifically includes: Obtain the grid angular frequency under off-grid conditions; The real-time grid voltage is delayed to generate a virtual voltage; The q-axis voltage component is obtained by calculating the real-time grid voltage and the virtual voltage. The q-axis voltage component is controlled by a PI controller to obtain the PI output. The PI output is superimposed with the grid angular frequency to calculate the grid phase angle; The grid voltage phase is determined based on the grid phase angle.
[0004] Optionally, the target synchronization quantity further includes the effective value of the grid voltage, and the step of constructing the target synchronization quantity based on the real-time grid voltage specifically includes: The power grid cycle is obtained based on the real-time power grid voltage; The effective value of the grid voltage is calculated based on the grid cycle.
[0005] Optionally, the step of performing phase synchronization control based on the difference between the grid voltage phase and the inverter output voltage phase specifically includes: Obtain the off-grid sine wave phase, and generate the inverter output voltage phase based on the off-grid sine wave phase; The off-grid sine wave phase is adjusted in a stepwise manner to gradually bring the inverter output voltage phase closer to the grid voltage phase, thus obtaining the phase difference value.
[0006] Optionally, the step of performing amplitude synchronization control based on the real-time grid voltage and the effective value of the grid voltage specifically includes: Effective value loop control is performed on the real-time grid voltage to make the off-grid voltage amplitude approximate the grid voltage amplitude; Based on the off-grid voltage amplitude and the grid voltage amplitude, the effective voltage difference and the instantaneous voltage difference are obtained.
[0007] Optionally, when both the phase synchronization control and amplitude synchronization control meet the preset synchronization conditions, the off-grid state is switched to the grid-connected state. Specific steps include: When the phase difference is within a first preset range, the off-grid phase is controlled using grid phase synchronization. When the effective voltage difference is within a second preset range and the instantaneous voltage difference is within a third preset range, the real-time grid voltage is sampled as a first given parameter. Obtain the grid current suppression loop, and obtain the second given parameter based on the grid current suppression loop; The first given parameter and the second given parameter are added together as the instantaneous loop given to the inverter voltage, so that the relay is fully closed, switching the off-grid state to the grid-connected state.
[0008] Optionally, a grid current suppression loop is obtained, and a second given parameter is obtained based on the grid current suppression loop. Specific steps include: Obtain the PI controller, and generate the grid current suppression loop based on the PI controller; The first given parameter is input into the grid current suppression loop to generate the second given parameter.
[0009] Secondly, this aspect provides a grid-connected / off-grid switching control device for a photovoltaic-storage inverter system, comprising: The acquisition module is used to acquire the real-time grid voltage and inverter output voltage phase in the off-grid state; The construction module is used to construct a target synchronization quantity based on the real-time grid voltage, wherein the target synchronization quantity includes the grid voltage phase and the effective value of the grid voltage; The first control module is used to perform phase synchronization control based on the difference between the grid voltage phase and the inverter output voltage phase; The second control module is used to perform amplitude synchronization control based on the real-time grid voltage and the effective value of the grid voltage; The switching module is used to switch the off-grid state to the grid-connected state when both the phase synchronization control and amplitude synchronization control meet the preset synchronization conditions.
[0010] Thirdly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a grid-connected / off-grid switching control device for a photovoltaic-storage inverter system, implements the grid-connected / off-grid switching control method for a photovoltaic-storage inverter system as described above.
[0011] Fourthly, the present invention provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the grid-connected / off-grid switching control method for a photovoltaic-storage inverter system as described above.
[0012] Fifthly, the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the on-grid / off-grid switching control method for a photovoltaic-storage inverter system as described above.
[0013] This invention acquires the real-time grid voltage and inverter output voltage phase in an off-grid state. Based on the real-time grid voltage, a target synchronization quantity is constructed, including the grid voltage phase and the effective value of the grid voltage. Phase synchronization control is performed based on the difference between the grid voltage phase and the inverter output voltage phase. Amplitude synchronization control is performed based on the real-time grid voltage and the effective value of the grid voltage. When both phase synchronization control and amplitude synchronization control meet preset synchronization conditions, the off-grid state is switched to a grid-connected state. This invention enables synchronized control of the inverter output voltage and grid voltage in both phase and amplitude dimensions, effectively avoiding phase abrupt changes and amplitude mismatches during switching, improving switching smoothness and safety, and achieving truly seamless grid connection. It is particularly suitable for photovoltaic-storage system applications with high requirements for power supply continuity and stability. [Attached Image Description] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 This is a flowchart of a grid-connected / off-grid switching control method for a photovoltaic-storage inverter system according to an embodiment of the present invention; Figure 2 This is an overall flowchart of another method for smooth switching from off-grid to on-grid in a photovoltaic-storage inverter system according to an embodiment of the present invention; Figure 3 This is a structural block diagram of a grid-connected / off-grid switching control device for a photovoltaic-storage inverter system according to an embodiment of the present invention; Figure 4 This is a block diagram illustrating the virtual voltage construction and q-axis component control principle of the photovoltaic-storage inverter system according to an embodiment of the present invention. Figure 5 This is a control diagram of the current suppression loop during relay closure in the photovoltaic-storage inverter system according to an embodiment of the present invention; Figure 6 This is a schematic diagram of the phase synchronization amplitude matching and current suppression relay closing control logic of the photovoltaic-storage inverter system according to an embodiment of the present invention; Figure 7 This is a structural block diagram of a computer device according to another embodiment of the present invention; Figure 8 This is a structural block diagram of an electronic device according to another embodiment of the present invention.
Detailed Implementation Methods
[0015] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0016] The definitions of various terms or methods used in the following embodiments are, except where logically impossible, generally defined as broad concepts that can be implemented under the premise of the content disclosed in the embodiments. Under this understanding, all specific subordinate limitations of the terms or methods should be considered as part of the invention, and should not be narrowly interpreted or biased simply because the specification does not disclose such a specific limitation. For example, when the present invention refers to a cloud platform, it includes not only virtual network servers but also real physical devices, which not only have data storage capabilities but also data processing, intelligent analysis, and reasoning capabilities. Similarly, provided logically feasible, the order of steps in the method is flexible and varied; all specific subordinate limitations within the broad concepts of various terms or methods fall within the scope of protection of the present invention.
[0017] In one embodiment, please refer to Figure 1 As shown in the figure, this embodiment proposes a grid-connected / off-grid switching control method for a photovoltaic-storage inverter system, including the following steps: S11, obtain the real-time grid voltage and inverter output voltage phase under off-grid conditions; In this embodiment of the invention, the off-grid state refers to the operating mode in which the photovoltaic-storage inverter system is not connected to the public power grid and independently supplies power to the load; the real-time grid voltage can be instantaneous AC voltage data obtained by sampling the grid-side voltage signal, which is used for the subsequent construction of synchronization quantities and state judgment; the inverter output voltage phase can be the internal reference phase angle used by the controller to drive the inverter output AC waveform during off-grid operation, which is usually generated by the control system in a fixed step or dynamic adjustment manner, and is used to reflect the phase state of the inverter's current output voltage.
[0018] In one possible embodiment, the control system samples the grid input terminal in real time under off-grid conditions using a voltage sampling circuit to obtain the instantaneous voltage signal on the grid side. This signal serves as the basis for subsequent synchronization quantity construction. Simultaneously, when the inverter is in off-grid operation mode, its output AC voltage is driven by a sinusoidal reference signal generated internally by the controller. The control system maintains and updates the phase reference angle of this sine wave in each sampling cycle; therefore, the phase of the inverter output voltage can be directly obtained from the phase variable recorded internally by the controller. Through this method, the system acquires the real-time grid voltage signal and the phase information of the inverter output voltage, providing basic input parameters for phase synchronization and amplitude synchronization control.
[0019] S12, construct the target synchronization quantity based on the real-time grid voltage; In this embodiment of the invention, the target synchronization quantity includes the grid voltage phase and the grid voltage RMS value. Specifically, the target synchronization quantity includes the grid voltage phase and the grid voltage RMS value. Specifically, the grid voltage phase can be based on the real-time sampled grid voltage signal, constructed by creating a virtual voltage orthogonal to the grid voltage and calculating the q-axis voltage component, then integrating the phase angle obtained by superimposing the grid angular frequency on the output of a PI controller, to describe the phase position of the current grid AC waveform in the time domain; the grid voltage RMS value can be based on the sampled values of the grid voltage signal within a complete cycle, obtained using the sliding window root mean square method, to measure the actual amplitude of the grid voltage, serving as a target reference for amplitude synchronization control.
[0020] S13, based on the difference between the grid voltage phase and the inverter output voltage phase, performs phase synchronization control; In this embodiment of the invention, phase synchronization control can be based on the difference between the grid voltage phase and the inverter output voltage phase, constructing a phase error control loop. By stepping and adjusting the sinusoidal phase setpoint of the inverter output, the inverter output voltage phase gradually approaches the grid phase. When the phase difference enters the set synchronization tolerance range (e.g., ±2.2°), the system switches to directly driving the inverter output with the grid phase, achieving phase-locked tracking. This control process can be based on a proportional-integral (PI) control strategy, adjusting the inverter angular frequency and integrating to obtain the real-time phase angle, ensuring high-precision phase synchronization between the inverter output and the grid.
[0021] Specifically, the implementation process of performing phase synchronization control based on the difference between the grid voltage phase and the inverter output voltage phase will be described in more detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0022] S14, based on the real-time grid voltage and the effective value of the grid voltage, performs amplitude synchronization control; In this embodiment of the invention, the aforementioned amplitude synchronization control can be based on real-time sampled grid voltage signals and their calculated effective grid voltage values to construct an off-grid voltage effective value control loop. By comparing the amplitude difference between the inverter output voltage effective value and the grid voltage effective value, a proportional-integral (PI) control algorithm is used to adjust the inverter output modulation signal, dynamically correcting its output amplitude so that the inverter output voltage gradually approaches the grid voltage in amplitude. To improve synchronization accuracy, the system can further introduce instantaneous voltage difference judgment to ensure that the effective voltage difference before grid connection is less than a preset range (e.g., <1V) and the instantaneous difference is less than a set threshold (e.g., <5V), thereby creating amplitude matching conditions for relay closing and impact-free grid connection.
[0023] Specifically, the implementation process of amplitude synchronization control based on real-time grid voltage and the effective value of grid voltage will be described in more detail in subsequent specific embodiments of this application, and will not be elaborated on here.
[0024] S15, when both phase synchronization control and amplitude synchronization control meet the preset synchronization conditions, switch the off-grid state to the grid-connected state; Specifically, the detailed implementation process of switching from off-grid to grid-connected state when both phase synchronization control and amplitude synchronization control meet the preset synchronization conditions will be further described in subsequent specific embodiments of this application, and will not be elaborated on here.
[0025] In this embodiment of the invention, by acquiring the real-time grid voltage and inverter output voltage phase in the off-grid state, a target synchronization quantity is constructed based on the real-time grid voltage. The target synchronization quantity includes the grid voltage phase and the effective value of the grid voltage. Based on the difference between the grid voltage phase and the inverter output voltage phase, phase synchronization control is performed. Based on the real-time grid voltage and the effective value of the grid voltage, amplitude synchronization control is performed. When both phase synchronization control and amplitude synchronization control meet the preset synchronization conditions, the off-grid state is switched to the grid-connected state. This invention can achieve synchronous control of the inverter output voltage and the grid voltage in both phase and amplitude dimensions, effectively avoiding phase abrupt changes and amplitude mismatch problems during the switching process, improving switching smoothness and safety, and achieving truly seamless grid connection. It is particularly suitable for photovoltaic and energy storage system application scenarios with high requirements for power supply continuity and stability.
[0026] As a preferred option and not a limitation, step S12 includes the following steps: Obtain the grid angular frequency under off-grid conditions; The real-time grid voltage is delayed to generate a virtual voltage. The q-axis voltage component is obtained by calculating the real-time grid voltage and the virtual voltage. The q-axis voltage component is controlled by a PI controller to obtain the PI output. The PI output is superimposed with the grid angular frequency to calculate the grid phase angle; The grid voltage phase is determined based on the grid phase angle.
[0027] In this embodiment, the grid angular frequency can be the angular velocity obtained by periodically measuring the real-time grid voltage signal, reflecting the rate at which the grid voltage phase changes with time, and the unit is radians per second (rad / s), which can dynamically change within the range of 35Hz to 65Hz; Virtual voltage can be an orthogonal voltage component obtained by delaying the grid voltage signal by 1 / 4 cycle. It is usually implemented by software buffering or hardware delay and has a 90-degree phase difference with the original voltage. The q-axis voltage component can be the projected value calculated based on the current grid voltage Va and the virtual voltage Vb using a rotating coordinate transformation, i.e., Vq = Va * cosθ + Vb * sinθ, which is used to reflect the component of the grid voltage vector in the q-axis direction; PI control can use Vq as the input error and employ a proportional-integral adjustment algorithm to output a correction value to approximate the synchronization state where the q-axis component is zero. This output value is the angular frequency correction value. The grid phase angle can be calculated by adding the grid angular frequency and the above-mentioned PI output correction amount and then integrating and accumulating the phase angle. It is used to accurately describe the current time phase position of the grid voltage and is ultimately used as the grid voltage phase for phase synchronization control reference.
[0028] In this embodiment, the control system first performs periodic characteristic analysis on the real-time grid voltage signal acquired in off-grid mode to obtain the current grid angular frequency. Then, the controller generates a virtual voltage signal orthogonal to the original voltage signal with a time delay of 1 / 4 of the grid cycle. Next, based on the original voltage and the virtual voltage, combined with the currently estimated phase angle, the q-axis voltage component Vq is calculated through a rotating coordinate transformation. The system inputs this Vq as an error signal to the PI controller to calculate the angular frequency correction. This correction is superimposed on the current grid angular frequency and then fed into the integration unit for integration and accumulation to generate the current phase angle of the grid voltage. Finally, the system determines the phase position of the grid voltage in the time domain based on this phase angle, which is used as the target reference value for phase synchronization control. This process achieves high-precision tracking of the grid voltage phase, providing fundamental support for subsequent inverter phase synchronization control.
[0029] As a preferred option and not a limitation, step S12 includes the following steps: The power grid cycle is obtained based on real-time power grid voltage. The effective value of the grid voltage is generated based on the grid cycle.
[0030] In this embodiment, the grid cycle can be determined by continuously sampling the real-time grid voltage signal and using the time interval between two adjacent rising or falling edges measured by a voltage zero-crossing detection method, thereby determining the duration of a complete sinusoidal cycle of the current grid voltage. This cycle reflects the dynamic changes in the current grid frequency and can be used for subsequent synchronous calculations and window adjustments to ensure that the effective value calculation process always covers a complete voltage cycle, thus achieving adaptive RMS calculation accuracy control within the grid frequency range (e.g., 35Hz~65Hz).
[0031] In this embodiment, the control system first continuously samples the real-time grid voltage signal under off-grid conditions and obtains the time interval between two adjacent zero-crossings in the same direction using a zero-crossing detection method, thereby calculating the actual period of the current grid. Based on this grid period, the system dynamically adjusts the calculation window length for the effective voltage value, ensuring that each effective value calculation covers a complete voltage period. Subsequently, the controller performs root mean square (RMS) calculation on the sampled grid voltage data within this period, specifically by summing the squares of all sampled points within the period, averaging, and taking the square root to obtain the current effective grid voltage value. This method ensures that even under grid frequency fluctuations, the effective value result reflecting the grid amplitude characteristics can still be obtained accurately and in real time, providing a reliable basis for amplitude synchronization control.
[0032] As a preferred option and not a limitation, step S13 includes the following steps: Obtain the off-grid sine wave phase and generate the inverter output voltage phase based on the off-grid sine wave phase; The off-grid sine wave phase is adjusted in a stepwise manner to gradually bring the inverter output voltage phase closer to the grid voltage phase, thus obtaining the phase difference value.
[0033] In this embodiment, the off-grid sine wave phase can be an internal reference phase angle set by the control system in the off-grid operation state to drive the inverter to output a sine wave. This phase angle is generated periodically by the controller in a fixed step manner to construct the modulation waveform of the inverter output voltage. The step manner can be set to an increment slightly faster than the grid angular frequency to achieve a control strategy that gradually approaches the grid phase.
[0034] The phase difference can be the real-time difference between the off-grid sinusoidal phase (i.e., the inverter output voltage phase) and the grid voltage phase. It is usually obtained by differential calculation between the off-grid phase generated by the controller and the grid phase calculated by phase-locked loop. It is used to determine the degree of synchronization and serves as a criterion for whether phase synchronization control is completed. When this phase difference continuously decreases and enters a preset threshold range (e.g., ±2.2°), it is considered that phase synchronization is completed.
[0035] In this embodiment, the control system internally maintains an off-grid sinusoidal phase variable during off-grid operation to drive the inverter to output a sinusoidal voltage. This phase is periodically updated in a fixed angular step manner, for example, by adding a small phase increment each sampling period to form a continuous modulation reference waveform. Simultaneously, the system obtains the phase angle of the current grid voltage through a phase-locked loop algorithm and compares it with the off-grid sinusoidal phase to calculate the current phase difference. By continuously adjusting the stepping rhythm of the off-grid phase, its output phase gradually approaches the grid phase until the phase difference converges within a preset tolerance range, achieving high-precision phase synchronization control.
[0036] As a preferred option and not a limitation, step S14 includes the following steps: Effective value loop control is performed on the real-time grid voltage to make the off-grid voltage amplitude approximate the grid voltage amplitude; Based on the off-grid voltage amplitude and the grid voltage amplitude, the effective voltage difference and the instantaneous voltage difference are obtained.
[0037] In this embodiment, the effective value loop control can take the effective value of the grid voltage as the target setpoint, collect the off-grid voltage amplitude of the inverter output as the feedback value, construct a voltage amplitude closed-loop control loop, and use a proportional-integral (PI) control algorithm to adjust the inverter output modulation signal so that the effective value of its output voltage gradually approaches the effective value of the grid voltage, thereby achieving amplitude synchronization control. The off-grid voltage amplitude can be obtained by periodically sampling the off-grid output voltage of the inverter and using the sliding window RMS calculation method within a complete voltage cycle. This effective value is used for feedback control and amplitude difference calculation. The grid voltage amplitude can be a target effective value obtained by performing RMS calculation on the real-time grid voltage signal within its actual period range, reflecting the magnitude of the current grid voltage amplitude; The voltage RMS difference can be the difference between the grid voltage RMS value and the off-grid voltage RMS value, used to determine whether the two have reached the amplitude synchronization condition; The instantaneous value difference can be the difference between the grid voltage and the off-grid voltage at a certain point in time. It is usually judged whether it is less than a set threshold within multiple consecutive points (such as 3 points) to help determine whether the relay can be safely closed and connected to the grid.
[0038] In this embodiment, the control system first performs periodic measurements on the real-time acquired grid voltage signal and calculates its current effective value as the target amplitude. Simultaneously, it samples the inverter's output voltage signal in off-grid mode in real time and calculates its effective output voltage value using a sliding window RMS algorithm. The system compares this effective value with the grid voltage effective value, constructing a voltage amplitude closed-loop control loop. The system dynamically adjusts the inverter's modulation waveform or PWM duty cycle through a PI controller, gradually bringing the off-grid voltage amplitude closer to the grid amplitude. During this process, based on the latest effective value calculation result, the system further calculates the voltage effective value difference between the two and performs instantaneous voltage difference judgment at multiple sampling points at the synchronization time point to obtain the instantaneous value difference. These two differences are used together to determine whether the current amplitude synchronization state meets preset conditions, thus serving as one of the criteria for switching to grid-connected mode.
[0039] As a preferred option and not a limitation, step S15 includes the following steps: When the phase difference is within the first preset range, the off-grid phase is controlled by grid phase synchronization. When the effective voltage difference is within the second preset range and the instantaneous voltage difference is within the third preset range, the real-time grid voltage is sampled as the first given parameter. Obtain the grid current suppression loop, and obtain the second given parameter based on the grid current suppression loop; The first given parameter and the second given parameter are added together as the instantaneous loop given to the inverter voltage, so that the relay is fully closed, switching the off-grid state to the grid-connected state.
[0040] The specific steps for obtaining the grid current suppression loop and obtaining the second given parameter based on the grid current suppression loop include: Obtain the PI controller, and generate a grid current suppression loop based on the PI controller; The first given parameter is input into the grid current suppression loop to generate the second given parameter.
[0041] In this embodiment, the first preset range can be the tolerance range between the grid phase and the inverter output voltage phase, for example, ±2.2 degrees, used to determine whether the phase synchronization requirement is met and to ensure phase consistency during switching; The second preset range can be a tolerance threshold for the difference in effective voltage values, for example, not greater than 1V (approximately 0.43% for a 230V system), used to determine the degree of matching between off-grid voltage and grid voltage in amplitude; The third preset range can be the maximum instantaneous voltage difference tolerance among multiple consecutive instantaneous sampling points, for example, less than 5V (corresponding to about 1.5% of the 325V peak value), to further ensure the continuity of instantaneous voltage during the relay closing process; The first given parameter can be a real-time grid voltage sample value, which serves as the main reference input for inverter voltage control during grid connection, and is used to maintain waveform consistency. The second given parameter can be an adjustment amount calculated by the grid current suppression loop based on the current grid current error, used to fine-tune the output waveform when the relay is closed, and suppress the instantaneous current surge of grid connection; The grid current suppression loop can be a closed-loop control structure with current error as input. It uses a PI controller to adjust the error between the grid current and the target current, and outputs a limited suppression amount as an additional reference signal, which is superimposed on the main voltage setpoint to control the instantaneous response of the inverter output voltage, thereby smoothing grid connection during the relay closing process.
[0042] In this embodiment, when the system detects that the phase difference between the inverter output voltage phase and the grid voltage phase enters a first preset range (e.g., ±2.2°), it determines that phase synchronization is complete. The controller switches the inverter's phase control to direct grid phase drive, achieving phase-locked operation. Subsequently, the system further determines whether the voltage amplitude is synchronized. When the difference between the effective value of the off-grid voltage and the effective value of the grid voltage does not exceed a second preset range (e.g., 1V), and the instantaneous difference between the off-grid voltage and the grid voltage does not exceed a third preset range (e.g., 5V) in multiple consecutive sampling points, the amplitude synchronization condition is considered to be met. At this time, the system samples the real-time grid voltage as the first given parameter and introduces a current suppression control loop based on the current grid current error, generating a second given parameter through a PI controller. The sum of the two parameters forms the instantaneous control command for the inverter voltage, driving the inverter to output a voltage waveform consistent with the grid near the voltage zero-crossing point, ensuring that the relay closes under low-impact conditions. After the relay is fully closed, the system smoothly switches from off-grid to grid-connected operation, achieving seamless power supply and current surge suppression.
[0043] like Figure 2 As shown, Figure 2 This is an overall flowchart of another method for smooth off-grid to grid-connected switching of a photovoltaic-storage inverter system according to an embodiment of the present invention. The entire system uses a DC power supply as input to power the inverter module (INV). The inverter receives control commands through a PWM control interface and outputs AC voltage to supply the load (LOAD). In off-grid mode, the inverter output voltage is transmitted to the control side via a sampling capture interface. The control side includes a software storage delay module to generate an orthogonal virtual voltage Vb, and a phase-locked loop (PLL) module to calculate the grid phase angle θ using the input grid voltages Va and Vb. This phase angle θ, along with the sampled data, is sent to the voltage phase and amplitude processing control loop (VPDA) to execute control logic such as phase synchronization, amplitude synchronization, and current suppression. The On Relay Power interface determines whether to close the relay, thereby achieving a smooth switch to grid-connected mode. The overall structure is compact and logically clear, covering key aspects such as signal acquisition, phase detection, control calculation, and power execution.
[0044] like Figure 3 As shown, the grid-connected / off-grid switching control device for a photovoltaic-storage inverter system includes: The acquisition module 301 is used to acquire the real-time grid voltage and inverter output voltage phase under off-grid conditions; The construction module 302 is used to construct a target synchronization quantity based on the real-time grid voltage, wherein the target synchronization quantity includes the grid voltage phase and the effective value of the grid voltage; The first control module 303 is used to perform phase synchronization control based on the difference between the grid voltage phase and the inverter output voltage phase; The second control module 304 is used to perform amplitude synchronization control based on the real-time grid voltage and the effective value of the grid voltage; The switching module 305 is used to switch the off-grid state to the grid-connected state when both the phase synchronization control and the amplitude synchronization control meet the preset synchronization conditions.
[0045] Optionally, building module 302 includes: The first acquisition submodule is used to acquire the grid angular frequency in the off-grid state; The delayed generation processing submodule is used to perform delayed generation processing on the real-time grid voltage to obtain a virtual voltage; The first calculation submodule is used to calculate the real-time grid voltage and the virtual voltage to obtain the q-axis voltage component; The output submodule is used to control the q-axis voltage component via a PI controller to obtain a PI output. The superposition calculation submodule is used to superimpose the PI output with the grid angular frequency to generate the grid phase angle; The determination submodule is used to determine the grid voltage phase based on the grid phase angle.
[0046] Optionally, building module 302 also includes: The second acquisition submodule is used to acquire the power grid cycle based on the real-time power grid voltage; The second calculation submodule is used to calculate and generate the effective value of the grid voltage based on the grid cycle.
[0047] Optionally, the first control module 303 includes: The third acquisition submodule is used to acquire the off-grid sine wave phase and generate the inverter output voltage phase based on the off-grid sine wave phase. The stepping submodule is used to adjust the off-grid sine wave phase setting in a stepping manner, so that the inverter output voltage phase gradually approaches the grid voltage phase, thus obtaining the phase difference value.
[0048] Optionally, the second control module 304 includes: The control submodule is used to perform effective value loop control on the real-time grid voltage, so that the off-grid voltage amplitude is close to the grid voltage amplitude. The third calculation submodule is used to obtain the effective voltage difference and instantaneous voltage difference based on the off-grid voltage amplitude and the grid voltage amplitude.
[0049] Optionally, the switching module 305 includes: The first comparison submodule is used to control the off-grid phase using grid phase synchronization when the phase difference value is within a first preset range. The second comparison submodule is used to sample the real-time grid voltage as a first given parameter when the effective voltage difference is within a second preset range and the instantaneous voltage difference is within a third preset range. A generation submodule is used to obtain the grid current suppression loop and obtain the second given parameter based on the grid current suppression loop; The switching submodule is used to add the first given parameter and the second given parameter as the instantaneous loop given voltage of the inverter, so that the relay is fully closed and the off-grid state is switched to the grid-connected state.
[0050] The generation submodule further includes: The acquisition unit is used to acquire the PI controller and generate the grid current suppression loop based on the PI controller; The input unit is used to input the first given parameter into the grid current suppression loop to generate the second given parameter.
[0051] In one embodiment, such as Figure 4 As shown, Figure 4 This is a block diagram illustrating the virtual voltage construction and q-axis component control principle according to an embodiment of the present invention. By extracting the orthogonal components of the grid voltage, performing q-axis transformation, and using a PI controller to eliminate voltage vector offset, precise phase locking is achieved, and the grid phase angle θ is generated in real time. This θ can be used as a target synchronization quantity to guide the inverter output phase adjustment, thereby achieving smooth grid-connected switching control. Those skilled in the art can implement the corresponding control logic based on this specification and the diagrams without any creative effort.
[0052] In one embodiment, such as Figure 5 As shown, Figure 5 This invention provides a current suppression loop control diagram during relay closing. To ensure no current surge during grid-connected switching when the relay closes, the system first constructs a current suppression PI control loop by sampling the grid voltage and the relay current, thereby obtaining a second given parameter for intervening in inverter voltage control. Simultaneously, the difference between the inverter voltage and the grid voltage is processed by a PI+PR+repetitive controller to form a highly responsive instantaneous voltage regulation command. Finally, the instantaneous voltage reference is converted into a PWM drive signal by the current PI controller, achieving zero-surge output at the moment of relay closing, ensuring uninterrupted power supply to the load, and improving the safety and stability of grid-connected switching. Those skilled in the art can implement the corresponding control logic based on this specification and the diagrams without any creative effort.
[0053] In one embodiment, such as Figure 6 As shown, Figure 6 This is a schematic diagram of the relay closing control logic for phase synchronization amplitude matching and current suppression provided in an embodiment of the present invention. It includes the following steps: Step 1: Determine if the inverter output voltage phase difference is within the tolerance range: The system determines whether the difference Δθ between the inverter output voltage phase and the grid voltage phase satisfies the range of -2.2° < Δθ < 2.2°. This condition is used to determine whether the inverter is currently basically synchronized with the grid.
[0054] Step 2: Perform inverter phase step adjustment: If Δθ does not meet the above conditions, the inverter output phase is adjusted in small steps, that is, the current phase angle is set to θ + 0.0074° (approximately corresponding to a 52μs sampling period), and the phase synchronization status is reassessed.
[0055] Step 3: Forced Synchronous Inverter Phase: If the phase difference meets the requirements, the inverter output voltage phase is forced to be the same as the grid voltage, i.e., Inverter Phase = θ, to ensure the basic alignment of subsequent synchronization control.
[0056] Step 4: Determine if the effective voltage value is close to: The system determines whether the difference ΔVrms between the effective value of the inverter output voltage and the effective value of the grid voltage is less than 0.43% of the grid voltage. This condition is used to assess whether the voltage amplitude meets the grid connection requirements.
[0057] Step 5: Perform voltage RMS adjustment: If ΔVrms exceeds the above threshold, the system triggers the adjustment process of the reference voltage Vrms_Ref, so that the off-grid voltage amplitude gradually approaches the grid amplitude.
[0058] Step 6: Force setting of target amplitude: If ΔVrms meets the amplitude matching condition, then the reference voltage Vrms_Ref is set to be the same as the grid voltage Vrms_Grid to ensure accurate amplitude matching.
[0059] Step 7: Determine the instantaneous voltage difference: Further determine whether the difference in instantaneous voltage values ΔV is less than 1.5% of the grid voltage. This determination is used to ensure that the voltage waveforms on both sides almost overlap at a specific point in time, reducing grid connection impact.
[0060] Step 8: Perform zero-point grid connection control: If the instantaneous voltage meets the conditions, the zero-crossing relay closing control logic is executed, and the current suppression function is enabled. By closing the relay at the zero-crossing point of the current waveform, the current surge can be significantly reduced.
[0061] Step 9: Determine the relay's closed state: The system checks whether the relay is closed; if it is not closed, it continues to maintain the zero-crossing control state; if it is successfully closed, it enters the grid-connected state.
[0062] Step 10: Grid connection status confirmation: Once the relay is closed, the system officially switches to "Ongrid State," completing the entire process of smoothly transitioning from off-grid to on-grid state.
[0063] Those skilled in the art can implement the corresponding control logic based on the content of this specification and the illustrations without any creative effort.
[0064] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0065] This invention also provides a computer storage medium storing a computer program that, when executed by a processor, implements the grid-connected / off-grid switching control method for a photovoltaic-storage inverter system as described in the above embodiments.
[0066] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of each of the above embodiments of the grid-connected / off-grid switching control method for a photovoltaic-storage inverter system. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0067] Alternatively, if the integrated units of the present invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present invention, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, terminal, or network device, etc.) to execute all or part of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, RAM, ROM, magnetic disks, or optical disks.
[0068] Corresponding to the computer storage medium described above, one embodiment also provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the grid-connected / off-grid switching control method for the optical-storage inverter system as described in the above embodiments.
[0069] The computer device can be a terminal, and its internal structure diagram can be as follows: Figure 7As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a grid-connected / off-grid switching control method for the optical storage inverter system. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0070] The electronic device in this application embodiment can be various types of electronic devices, such as a photovoltaic storage inverter system, or it can be a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, handheld computer, in-vehicle electronic device, mobile Internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM or self-service machine, etc. The embodiments of this application do not specifically limit it.
[0071] Optionally, such as Figure 8 As shown, this application embodiment also provides an electronic device 200, including a processor 201, a memory 202, and a program or instructions stored in the memory 202 and executable on the processor 201. When the program or instructions are executed by the processor 201, they implement the various processes of the above-described embodiments of the grid-connected and off-grid switching control method for a photovoltaic-storage inverter system and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0072] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0073] The above embodiments merely illustrate several implementation methods of the present invention, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.
Claims
1. A grid-connected / off-grid switching control method for a photovoltaic-storage inverter system, characterized in that, include: Obtain the real-time grid voltage and inverter output voltage phase under off-grid conditions; A target synchronization quantity is constructed based on the real-time grid voltage, and the target synchronization quantity includes the grid voltage phase and the effective value of the grid voltage. Phase synchronization control is performed based on the difference between the grid voltage phase and the inverter output voltage phase. Based on the real-time grid voltage and the effective value of the grid voltage, amplitude synchronization control is performed; When both the phase synchronization control and amplitude synchronization control meet the preset synchronization conditions, the off-grid state will be switched to the grid-connected state.
2. The grid-connected / off-grid switching control method for a photovoltaic-storage inverter system according to claim 1, characterized in that, The step of constructing the target synchronization quantity based on the real-time grid voltage specifically includes: Obtain the grid angular frequency under off-grid conditions; The real-time grid voltage is delayed to generate a virtual voltage; The q-axis voltage component is obtained by calculating the real-time grid voltage and the virtual voltage. The q-axis voltage component is controlled by a PI controller to obtain the PI output. The PI output is superimposed with the grid angular frequency to calculate the grid phase angle; The grid voltage phase is determined based on the grid phase angle.
3. The grid-connected / off-grid switching control method for a photovoltaic-storage inverter system according to claim 1, characterized in that, The step of constructing the target synchronization quantity based on the real-time grid voltage specifically includes: The power grid cycle is obtained based on the real-time power grid voltage; The effective value of the grid voltage is calculated based on the grid cycle.
4. The grid-connected / off-grid switching control method for a photovoltaic-storage inverter system according to claim 1, characterized in that, The step of performing phase synchronization control based on the difference between the grid voltage phase and the inverter output voltage phase specifically includes: Obtain the off-grid sine wave phase, and generate the inverter output voltage phase based on the off-grid sine wave phase; The off-grid sine wave phase is adjusted in a stepwise manner to gradually bring the inverter output voltage phase closer to the grid voltage phase, thus obtaining the phase difference value.
5. The grid-connected / off-grid switching control method for a photovoltaic-storage inverter system according to claim 4, characterized in that, The step of performing amplitude synchronization control based on the real-time grid voltage and the effective value of the grid voltage specifically includes: Effective value loop control is performed on the real-time grid voltage to make the off-grid voltage amplitude approximate the grid voltage amplitude; Based on the off-grid voltage amplitude and the grid voltage amplitude, the effective voltage difference and the instantaneous voltage difference are obtained.
6. The grid-connected / off-grid switching control method for a photovoltaic-storage inverter system according to claim 5, characterized in that, When both the phase synchronization control and amplitude synchronization control meet the preset synchronization conditions, the off-grid state is switched to the grid-connected state. The specific steps include: When the phase difference is within a first preset range, the off-grid phase is controlled using grid phase synchronization. When the effective voltage difference is within a second preset range and the instantaneous voltage difference is within a third preset range, the real-time grid voltage is sampled as a first given parameter. Obtain the grid current suppression loop, and obtain the second given parameter based on the grid current suppression loop; The first given parameter and the second given parameter are added together as the instantaneous loop given to the inverter voltage, so that the relay is fully closed, switching the off-grid state to the grid-connected state.
7. The grid-connected / off-grid switching control method for a photovoltaic-storage inverter system according to claim 6, characterized in that, Obtaining the grid current suppression loop and obtaining a second given parameter based on the grid current suppression loop, the specific steps include: Obtain the PI controller, and generate the grid current suppression loop based on the PI controller; The first given parameter is input into the grid current suppression loop to generate the second given parameter.
8. A grid-connected / off-grid switching control device for a photovoltaic-storage inverter system, characterized in that, include: The acquisition module is used to acquire the real-time grid voltage and inverter output voltage phase in the off-grid state; The construction module is used to construct a target synchronization quantity based on the real-time grid voltage, wherein the target synchronization quantity includes the grid voltage phase and the effective value of the grid voltage; The first control module is used to perform phase synchronization control based on the difference between the grid voltage phase and the inverter output voltage phase; The second control module is used to perform amplitude synchronization control based on the real-time grid voltage and the effective value of the grid voltage; The switching module is used to switch the off-grid state to the grid-connected state when both the phase synchronization control and amplitude synchronization control meet the preset synchronization conditions.
9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by the grid-connected / off-grid switching control device of the photovoltaic-storage inverter system, implements the grid-connected / off-grid switching control method for the photovoltaic-storage inverter system as described in any one of claims 1 to 7.
10. A computer device, characterized in that, The computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the grid-connected / off-grid switching control method for a photovoltaic-storage inverter system as described in any one of claims 1 to 7.
11. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the on-grid / off-grid switching control method for a photovoltaic-storage inverter system as described in any one of claims 1 to 7.