Countercurrent detection method, inverter control method, device and system and storage medium

By performing fast Fourier transform processing on the grid voltage signal and the sampling resistor voltage signal, the problem of low reverse current detection efficiency is solved, and efficient reverse current detection and improved accuracy are achieved within half a cycle.

CN121208511APending Publication Date: 2025-12-26SUNGROW ICARBON TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511509668.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2025-12-26

AI Technical Summary

Technical Problem

In existing reverse current detection methods, zero-crossing detection requires waiting for the voltage/current to complete a full cycle before the zero-crossing position can be determined, resulting in low phase difference calculation efficiency and thus reducing the efficiency of reverse current detection.

Method used

Fast Fourier Transform is used to process the grid voltage signal and the sampling resistor voltage signal for half a sampling period to obtain the phase angle of the target grid voltage and the phase angle of the target sampling resistor current, and the phase difference is determined to realize reverse current detection.

Benefits of technology

Phase angle calculation and reverse current detection are completed within half a cycle, which improves detection efficiency, reduces misjudgments caused by harmonic interference, and improves detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121208511A_ABST
    Figure CN121208511A_ABST
Patent Text Reader

Abstract

The invention discloses a countercurrent detection method, an inverter control method, device and system and a storage medium, and relates to the technical field of photovoltaic power generation countercurrent prevention control, and the disclosed countercurrent detection method comprises the steps: obtaining a power grid voltage signal sequence and a sampling resistor voltage signal sequence of a half sampling period; respectively carrying out fast Fourier transform processing on the power grid voltage signal sequence and the sampling resistor voltage signal sequence to obtain a target power grid voltage phase angle and a target sampling resistor current phase angle; determining a phase difference between the target power grid voltage phase angle and the target sampling resistor current phase angle; determining a countercurrent detection result according to a preset phase difference interval of the phase difference; the technical problem of low countercurrent detection efficiency in the prior art is solved, and countercurrent detection efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of photovoltaic power generation anti-reverse current control technology, and in particular to reverse current detection methods, inverter control methods, devices, systems and storage media. Background Technology

[0002] Currently, reverse current detection plays an important role in the power grid. By monitoring and controlling the power output direction of the power source in real time, it prevents electrical energy from flowing back into the power grid, thereby ensuring the safe and stable operation of the power grid.

[0003] In related technologies, during the reverse current detection process, a zero-crossing detection method is used to capture the phase reference point of the alternating current, providing an accurate time reference for determining the power direction in the reverse current detection.

[0004] However, zero-crossing detection requires waiting for the voltage / current to complete a full cycle before the zero-crossing position can be determined, which reduces the efficiency of phase difference calculation and consequently reduces the efficiency of reverse current detection. Summary of the Invention

[0005] The main objective of this application is to provide a reverse current detection method, an inverter control method, a device, a system, and a storage medium, aiming to solve the technical problem of low efficiency in existing reverse current detection methods.

[0006] In a first aspect, embodiments of this application propose a backflow detection method, including: Acquire the grid voltage signal sequence and the sampling resistor voltage signal sequence for half a sampling period; Fast Fourier Transform is performed on the grid voltage signal sequence and the sampling resistor voltage signal sequence respectively to obtain the target grid voltage phase angle and the target sampling resistor current phase angle; Determine the phase difference between the target grid voltage phase angle and the target sampling resistor current phase angle; The reverse flow detection result is determined based on the preset phase difference range in which the phase difference is located.

[0007] Secondly, embodiments of this application also propose a control method for an inverter, including: The target sampling resistor current and the inverter output power direction are obtained by performing a fast Fourier transform on the grid voltage signal sequence and the sampling resistor voltage signal sequence for half a sampling period. The inverter is controlled based on the target sampling resistor current and the direction of output power.

[0008] Thirdly, embodiments of this application also propose a backflow detection device, comprising: The sampling resistor is used to convert the current signal in the circuit consisting of the power grid, load and inverter within half a sampling period into a sampling resistor voltage signal, thus obtaining a sampling resistor voltage signal sequence. The differential amplifier sampling circuit has its input terminal connected to the sampling resistor to amplify the sampling resistor voltage signal and obtain an amplified sampling resistor voltage signal sequence. Voltage sampling circuit, used to acquire the grid voltage signal sequence for half a sampling period; The microcontroller's input terminals are connected to the output terminals of the differential amplification sampling circuit and the voltage sampling circuit, respectively. The microcontroller is used to determine the reverse current detection result based on the amplified sampling resistor voltage signal sequence and the mains voltage signal sequence. The communication module is used to establish a communication connection between the microcontroller and the inverter's control device, and to send the reverse current detection results to the inverter's control device.

[0009] Fourthly, this application also proposes a reverse current detection system, including: an inverter, a load, a reverse current detection device, and a power grid, wherein the inverter, the reverse current detection device, and the power grid are connected in sequence, and the load is connected between the inverter and the reverse current detection device.

[0010] Fifthly, this application also proposes a control device for an inverter, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the inverter control method described above.

[0011] Sixthly, this application also proposes a storage medium, which is a computer-readable storage medium, storing a computer program. When the computer program is executed by a processor, it implements the steps of the reverse current detection method described above, or when the computer program is executed by a processor, it implements the steps of the inverter control method described above.

[0012] Compared to related technologies that require a full cycle to achieve reflux detection, this application acquires the grid voltage signal and the sampling resistor voltage signal for half a sampling cycle, and then performs Fast Fourier Transform (FFT) processing on the acquired grid voltage signal and sampling resistor voltage signal. Since FFT can complete the Discrete Fourier Transform operation in a short time, it can complete the phase angle calculation, phase difference determination, and reflux detection within half a cycle, thereby improving the efficiency of reflux detection. Attached Figure Description

[0013] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0014] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0015] Figure 1 This is a schematic diagram of the architecture of the reverse flow detection system; Figure 2 A circuit diagram showing how the load draws power from the grid. Figure 3 This diagram illustrates the changes in grid voltage and sampling resistor current during the process of a load drawing power from the grid. Figure 4 A circuit diagram showing the output power of the inverter being transmitted to the power grid; Figure 5 This diagram illustrates the changes in grid voltage and sampling resistor current during the process of the inverter's output power being transmitted to the grid. Figure 6 This is a schematic diagram of a reverse current detection device for a single-phase current sampling scenario. Figure 7 This is a schematic diagram of a reverse current detection device for a three-phase current sampling scenario. Figure 8 This is a flowchart illustrating an embodiment of the reverse current detection method of this application; Figure 9 This is a detailed flowchart of an embodiment of the backflow detection method of this application; Figure 10 This is a flowchart illustrating an embodiment of the inverter control method of this application; Figure 11 This is a detailed flowchart illustrating an embodiment of the control method for the inverter of this application.

[0016] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0017] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.

[0018] Currently, reverse current detection plays a crucial role in the power grid. By monitoring and controlling the power output direction of the source in real time, it prevents electrical energy from flowing back into the grid, thereby ensuring the safe and stable operation of the grid. In related technologies, zero-crossing detection is used to capture the phase reference point of the alternating current during reverse current detection, providing a precise time reference for determining the power direction. However, zero-crossing detection requires waiting for the voltage / current to complete a full cycle to determine the zero-crossing position, leading to reduced efficiency in phase difference calculation and consequently reducing the efficiency of reverse current detection.

[0019] To address the aforementioned issues, this application proposes a reverse current detection method. The main technical solution includes acquiring a grid voltage signal sequence and a sampling resistor voltage signal sequence for half a sampling period; performing Fast Fourier Transform (FFT) processing on the grid voltage signal sequence and the sampling resistor voltage signal sequence respectively to obtain the target grid voltage phase angle and the target sampling resistor current phase angle; determining the phase difference between the target grid voltage phase angle and the target sampling resistor current phase angle; and determining the reverse current detection result based on the preset phase difference interval in which the phase difference is located.

[0020] Compared to related technologies that require a full cycle to achieve reflux detection, this application acquires the grid voltage signal and the sampling resistor voltage signal for half a sampling cycle, and then performs Fast Fourier Transform (FFT) processing on the acquired grid voltage signal and sampling resistor voltage signal. Since FFT can complete the Discrete Fourier Transform operation in a short time, it can complete the phase angle calculation, phase difference determination, and reflux detection within half a cycle, thereby improving the efficiency of reflux detection.

[0021] Furthermore, when harmonics are present in the power grid, high-frequency oscillation components are superimposed on the waveform. These harmonics may generate additional zero-crossings near the fundamental zero-crossing point, leading to misjudgments of the true zero-crossing time and incorrect phase difference calculations, thus reducing the accuracy of reverse current detection. This application completes phase angle calculation, phase difference determination, and reverse current detection within half a cycle. Since the interference effect of harmonics is proportional to time, the half-cycle decision halves the harmonic effect time, significantly reducing the probability of parasitic zero-crossings and phase jitter. The half-cycle decision avoids harmonics crossing the zero point multiple times within a complete cycle, reducing the chance of misjudgment and thus improving the accuracy of reverse current detection results.

[0022] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0023] Based on the same inventive concept, this application provides a reverse flow detection system, referring to... Figure 1The reverse current detection system of this application includes: an inverter, a load, a reverse current detection device, and a power grid, wherein the inverter, the reverse current detection device, and the power grid are connected in sequence, and the load is connected between the inverter and the reverse current detection device.

[0024] In this system, the inverter and the power grid work together to provide power to the load. The load demand determines the power distribution direction. Specifically, when the load's power consumption exceeds the inverter's output power, the difference is supplied by the power grid, meaning the grid transmits power to the load. The energy flow direction is from the inverter to the load, and from the grid to the load. No power flows back to the grid; there is no reverse flow. The energy flow direction is as follows: Figure 2 As shown in the diagram. In this case, both the grid voltage and the voltage change across the sampling resistor are sinusoidal waves and in phase. The current in the sampling resistor is also in phase with the grid voltage. Specific waveforms can be found in [reference needed]. Figure 3 .

[0025] When the load power consumption is less than the inverter's output power, the excess power generated by the inverter will be fed back to the grid, forming a reverse current. At this time, the energy flow direction can be as follows: Figure 4 As shown in the diagram. In this case, both the grid voltage and the voltage change across the sampling resistor are sinusoidal waves, but out of phase. The current in the sampling resistor is also out of phase with the grid voltage. For specific waveforms, please refer to [reference needed]. Figure 5 .

[0026] The backflow detection system provided in this application, employing the backflow detection method described in the above embodiments, can solve the technical problem of low efficiency in existing backflow detection methods. Compared with the prior art, the beneficial effects of the backflow detection system provided in this application are the same as those of the backflow detection method provided in the above embodiments, and other technical features of this backflow detection system are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0027] Based on the same inventive concept, this application provides a reverse current detection device, which can be the main body executing the reverse current detection method in this embodiment. The reverse current detection device includes at least a sampling resistor, a differential amplification sampling circuit, a voltage sampling circuit, a microcontroller, and a communication module including a wired communication module and a wired communication module. The various components of the reverse current detection device will be described in detail below: The sampling resistor is used to convert the current signal in the circuit consisting of the power grid, load and inverter within half a sampling period into a sampling resistor voltage signal, thus obtaining a sampling resistor voltage signal sequence. The differential amplifier sampling circuit has its input terminal connected to the sampling resistor to amplify the sampling resistor voltage signal and obtain an amplified sampling resistor voltage signal sequence. Voltage sampling circuit, used to acquire the grid voltage signal sequence for half a sampling period; The microcontroller's input terminals are connected to the output terminals of the differential amplification sampling circuit and the voltage sampling circuit, respectively. The microcontroller is used to determine the reverse current detection result based on the amplified sampling resistor voltage signal sequence and the mains voltage signal sequence. The communication module is used to establish a communication connection between the microcontroller and the inverter's control device, and to send the reverse current detection results to the inverter's control device.

[0028] The reverse current detection device can be used for both single-phase and three-phase current sampling scenarios. For single-phase current sampling scenarios, a schematic diagram of the reverse current detection device can be found here. Figure 6 For three-phase current sampling scenarios, the structural schematic diagram of the reverse current detection device can be found in [reference needed]. Figure 7 The difference between the reverse current detection device and the one corresponding to the single-phase current sampling scenario is that the reverse current detection device for the three-phase current sampling scenario has a corresponding sampling resistor, differential amplification sampling circuit and voltage sampling circuit for each phase current.

[0029] The aforementioned communication module includes both a wireless communication module and a wired communication module. The communication module feeds back the reverse current detection results determined by the microcontroller to the inverter's control device, which then controls the inverter. The microcontroller can choose between a wireless communication module and a wired communication module based on the specific requirements.

[0030] The microcontroller's determination of the reverse current detection result based on the amplified sampling resistor voltage signal sequence and the mains voltage signal sequence can be referred to in subsequent embodiments, and will not be described in detail here.

[0031] The backflow detection device provided in this application, employing the backflow detection method in the above embodiments, can solve the technical problem of low efficiency in existing backflow detection methods. Compared with the prior art, the beneficial effects of the backflow detection device provided in this application are the same as those of the backflow detection method provided in the above embodiments, and other technical features in this backflow detection device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0032] Based on the same inventive concept, this application provides a reverse current detection method, referring to... Figure 8 , Figure 8 This is a flowchart illustrating an embodiment of the reverse flow detection method of this application.

[0033] In this embodiment, the backflow detection method includes steps S10 to S40: Step S10: Obtain the grid voltage signal sequence and the sampling resistor voltage signal sequence for half a sampling period; In the signal sampling process, a complete sampling period includes sampling the complete waveform of the signal, while a half sampling period is the time interval corresponding to sampling only half of the waveform of the signal. For example, taking 50Hz AC as an example, every 10ms is a half sampling period.

[0034] Among them, the grid voltage signal sequence refers to a set of voltage values ​​obtained by sampling the grid voltage multiple times within half a sampling period at a certain sampling frequency. These values ​​are arranged in chronological order and reflect the changes in grid voltage during that time period.

[0035] The sampling resistor voltage signal sequence refers to a set of voltage values ​​obtained by setting a sampling resistor in the circuit and sampling the voltage across the sampling resistor multiple times within half a sampling period. This sequence reflects information related to the current flowing through the sampling resistor. The location of the sampling resistor is as follows: Figure 2 or Figure 4 As shown.

[0036] In one feasible approach, a dedicated sampling chip with high precision and a high sampling rate can be selected. The mains voltage signal and the sampling resistor voltage signal are connected to their respective input channels. By configuring the sampling frequency and sampling time of the chip, it can synchronously sample the two signals within half a sampling cycle, and store the sampling results in the chip's internal registers or external memory. Because the dedicated sampling chip has high sampling accuracy and stability, it can accurately acquire the mains voltage and sampling resistor voltage signals, reducing sampling errors. Simultaneously, its built-in sampling control logic can easily achieve synchronous sampling, ensuring the temporal correspondence between the two signals and providing an accurate data foundation for subsequent signal processing.

[0037] In another feasible approach, the mains voltage and sampling resistor voltage signals can be connected to the microcontroller's analog input pins after passing through appropriate signal conditioning circuits such as amplification and filtering. The microcontroller's high-speed timer is used to set the sampling interval, triggering the analog-to-digital converter to sample the two signals at set time intervals within half a sampling cycle. The sampled data is then stored in the microcontroller's internal or external memory. This microcontroller-based software sampling method offers high flexibility, allowing for easy adjustment of the sampling frequency and time according to actual needs. Furthermore, the microcontroller can integrate other functions, such as data processing and communication, reducing system hardware complexity and cost.

[0038] Step S20: Perform Fast Fourier Transform on the grid voltage signal sequence and the sampling resistor voltage signal sequence respectively to obtain the target grid voltage phase angle and the target sampling resistor current phase angle; Fast Fourier Transform (FFT) is an algorithm that converts time-domain signals into frequency-domain signals. It can quickly calculate the Discrete Fourier Transform, decompose the signal into components of different frequencies, and thus obtain information such as the signal's frequency, phase, and amplitude.

[0039] The target grid voltage phase angle refers to the specific frequency component extracted from the grid voltage signal sequence after fast Fourier transform processing. It is usually the phase angle corresponding to the fundamental frequency and is used to describe the phase characteristics of the grid voltage.

[0040] The target sampling resistor current phase angle is determined by processing the sampling resistor voltage signal sequence through a fast Fourier transform to obtain current-related information, thereby determining the target current value, which reflects the current situation through the sampling resistor.

[0041] In one feasible approach, the acquired grid voltage signal sequence and the sampled resistor voltage signal sequence can be transmitted to a microcontroller via a data interface. The microcontroller is then configured with FFT processing parameters, such as the number of FFT points and sampling frequency, and the FFT processing module is started to perform a Fast Fourier Transform on the two signal sequences. After the transform is complete, the phase angles of the target grid voltage and the target sampled resistor current are extracted from the processing results.

[0042] In another feasible approach, the FFT algorithm can be implemented using software programming on a microcontroller. Mature FFT library functions can be used, taking the acquired signal sequence as input data and calling the FFT function for transformation. After the transformation, the phase angles of the target grid voltage and the target sampling resistor current are calculated by analyzing the complex data in the transformation result. By adjusting the software code, the parameters of the FFT processing, such as the number of FFT points and the window function, can be easily modified to adapt to different signal processing needs.

[0043] Step S30: Determine the phase difference between the target grid voltage phase angle and the target sampling resistor current phase angle; The phase difference is the difference between the phase angle of the target grid voltage and the phase angle of the target sampling resistor current. It is used to measure the phase relationship between the grid voltage and the sampling resistor current and can reflect the direction and characteristics of energy flow in the circuit.

[0044] In one feasible approach, after obtaining the target grid voltage phase angle θv and the target sampling resistor current phase angle θi, the phase difference between them can be directly calculated using the formula Δθ=θv-θi. To ensure the accuracy of the calculation results, an appropriate range can be imposed on the results. This method of directly calculating the phase difference is simple, intuitive, computationally inexpensive, and allows for obtaining the phase difference result quickly.

[0045] In another feasible approach, the grid voltage signal sequence and the sampled resistor voltage signal sequence can be calculated using a cross-correlation function. The cross-correlation function, in signal analysis, represents the degree of correlation between two time series. The maximum value m0 of the cross-correlation function can be found, and the phase difference Δθ = 2πfm0 / fs can be calculated based on the sampling frequency fs, the signal frequency f, and the maximum value m0. Since the correlation function method has a certain ability to suppress noise, it can calculate the phase difference more accurately even in the presence of noise interference. Cross-correlation calculations can highlight the correlation between the two signals and reduce the impact of random noise on the phase difference calculation.

[0046] Step S40: Determine the reverse current detection result based on the preset phase difference range in which the phase difference is located.

[0047] The preset phase difference range is a pre-defined range of phase differences based on the requirements of reverse current detection and the actual circuit characteristics, used to determine whether reverse current exists. Different phase difference ranges correspond to different reverse current detection results.

[0048] The backflow detection result is a conclusion drawn from the comparison between the phase difference and the preset phase difference range, indicating whether a backflow phenomenon exists. Generally, it is divided into two results: backflow exists and backflow does not exist.

[0049] In one feasible approach, a preset phase difference interval can be pre-defined based on the presence or absence of backflow. For example, one preset phase difference interval can be defined for cases with backflow, and another preset phase difference interval can be defined for cases without backflow. In practical applications, the currently determined phase difference can be compared with each of the pre-defined preset phase difference intervals to determine the preset phase interval in which the phase difference belongs. The preset backflow detection result associated with the preset phase interval in which the phase difference belongs is then determined as the final backflow detection result.

[0050] In another feasible approach, the preset phase difference range can be dynamically adjusted during system operation based on factors such as grid voltage fluctuations and load changes. For example, by monitoring the effective value and frequency of the grid voltage in real time, when the effective value of the grid voltage changes beyond a certain range or the frequency deviation exceeds a set value, the phase difference threshold is adjusted according to certain rules. Then, the phase difference is judged based on the adjusted phase difference range to determine the reverse current detection result. This dynamic threshold range adjustment method can adapt to changes in grid voltage and load, improving the accuracy and reliability of reverse current detection. In practical applications, grid voltage and load may change at any time, and fixed thresholds may not accurately reflect reverse current conditions. By dynamically adjusting the threshold, the detection system can better adapt to different operating conditions, reduce false positives and false negatives, and improve system performance and stability.

[0051] In this embodiment, compared to related technologies that require a full cycle to achieve reflux detection, this application acquires the grid voltage signal and sampling resistor voltage signal for half a sampling cycle and performs Fast Fourier Transform (FFT) processing on the acquired grid voltage signal and sampling resistor voltage signal. Since FFT can complete Discrete Fourier Transform (DFT) operations in a short time, it can complete phase angle calculation, phase difference determination, and reflux detection within half a cycle, thereby improving reflux detection efficiency. Furthermore, when harmonics exist in the grid, the waveform will be superimposed with high-frequency oscillation components. These harmonics may generate additional zero-crossing points near the fundamental zero-crossing point, leading to misjudgment of the true zero-crossing time, resulting in incorrect phase difference calculation and reduced reflux detection accuracy. This application completes phase angle calculation, phase difference determination, and reflux detection within half a cycle. Since the interference effect of harmonics is proportional to time, half-cycle decision halves the harmonic effect time, significantly reducing the probability of parasitic zero-crossing points and phase jitter. Half-cycle decision avoids harmonics crossing zero points multiple times within a full cycle, reducing the chance of misjudgment and thus improving the accuracy of reflux detection results.

[0052] Based on the above, in one feasible implementation, step S20 may include steps S21 to S24: Step S21: Perform Fast Fourier Transform (FFT) processing on the grid voltage signal sequence and the sampling resistor voltage signal sequence respectively to obtain the FFT processing results of the grid voltage signal sequence and the sampling resistor voltage signal sequence. The Fast Fourier Transform (FFT) result of the grid voltage signal sequence refers to a set of complex data obtained by performing a FFT on the grid voltage signal sequence acquired within half a sampling period. This complex data contains the amplitude and phase information of the grid voltage signal at different frequency components, reflecting the characteristics of the grid voltage signal in the frequency domain.

[0053] The Fast Fourier Transform (FFT) result of the sampled resistor voltage signal sequence refers to a set of complex data obtained after performing an FFT on the sampled resistor voltage signal sequence within half a sampling period. It reflects the frequency domain distribution of the sampled resistor voltage signal. Since the sampled resistor voltage is proportional to the current passing through it, this result also indirectly reflects the frequency domain characteristics of the current signal.

[0054] The Fast Fourier Transform (FFT) processing in this application can employ one of the following algorithms: The radix-2 FFT algorithm is the most basic and widely used FFT algorithm. It requires the length N of the input sequence to be a power of 2, i.e., N = 2^m, where m is a positive integer. This algorithm is based on a divide-and-conquer strategy, decomposing the N-length DFT into two DFTs of length N / 2, corresponding to the even and odd indices of the input sequence, respectively. Then, it recursively performs the same decomposition on these two subsequences until the subsequence length is 1. Finally, it uses a butterfly operation to merge the DFT results of the subsequences, obtaining the Fast Fourier Transform result of the original sequence.

[0055] The radix-4 FFT algorithm is an extension of the radix-2 FFT algorithm. It decomposes a DFT of length N into four DFTs of length N / 4. During each decomposition, the input sequence is divided into four groups based on the remainder of the index modulo 4, and recursive decomposition and butterfly operations are performed on each group. Compared to the radix-2 FFT algorithm, the butterfly operation of the radix-4 algorithm is more complex, but each decomposition reduces the computational cost significantly.

[0056] The mixed-radix FFT algorithm combines the advantages of FFT algorithms with different bases such as radix-2 and radix-4. It flexibly selects different bases for decomposition based on the factorization of the length N of the input sequence. For example, if N = 2m × 3n, the sequence can first be decomposed into subsequences of length 2m, and then each subsequence can be further decomposed using the radix-3 FFT algorithm or other suitable bases.

[0057] Step S22: Extract the first fundamental component from the fast Fourier transform processing result of the grid voltage signal sequence, and extract the second fundamental component from the fast Fourier transform processing result of the sampling resistor voltage signal sequence. The first fundamental component refers to the complex component corresponding to the fundamental frequency of the power grid, extracted from the fast Fourier transform processing result of the power grid voltage signal sequence. The fundamental frequency is usually the standard frequency of the power grid, such as 50Hz. The first fundamental component contains the amplitude and phase information of the fundamental voltage of the power grid and is an important part of analyzing the characteristics of the power grid voltage.

[0058] The second fundamental component refers to the complex component corresponding to the fundamental frequency of the power grid, extracted from the fast Fourier transform processing result of the sampling resistor voltage signal sequence. It reflects the amplitude and phase information of the fundamental current flowing through the sampling resistor.

[0059] In one feasible approach, spectral analysis can be performed on the FFT processing results of the grid voltage signal sequence and the sampled resistor voltage signal sequence. First, the fundamental frequency f0 of the grid is determined, for example, 50Hz. Then, the frequency resolution Δf = fs / N is calculated based on the sampling frequency fs and the number of FFT points N. The complex component corresponding to the frequency point closest to f0 in the spectrum is found and designated as the first and second fundamental components. The spectral analysis positioning method is intuitive and easy to understand; by observing the spectrum, the distribution of each frequency component can be clearly seen, facilitating accurate extraction of the fundamental component. This method is unaffected by the initial phase of the signal and can stably extract fundamental information, making it suitable for applications requiring high-level signal characteristic analysis.

[0060] In another feasible approach, given the fundamental frequency f0 of the power grid, the sampling frequency fs, and the number of FFT points N, the index position of the fundamental component in the FFT result array is calculated using the formula k = (f0 * N) / fs. The complex component with index k is directly extracted from the FFT processing result arrays of the power grid voltage signal sequence and the sampled resistor voltage signal sequence, serving as the first and second fundamental components. This index-based calculation method has low computational complexity, fast processing speed, and can accurately locate the fundamental component in a short time. This method does not require complex operations such as spectrum analysis, making it suitable for use in embedded systems with high real-time requirements and limited resources.

[0061] Step S23: The first fundamental component and the second fundamental component are calculated using the arctangent function to obtain the fundamental grid voltage phase angle and the fundamental current phase angle. The arctangent function, denoted as arctan(x), is a trigonometric function defined on the set of all real numbers. When calculating the phase angle, for a complex signal component a+jb, its phase angle θ = arctan(b / a) can be converted from the ratio of the imaginary to the real part of the complex number into a phase angle using the arctangent function.

[0062] The fundamental grid voltage phase angle is the phase angle of the fundamental grid voltage calculated using the arctangent function based on the first fundamental component. It describes the phase position of the fundamental grid voltage on the time axis and is fundamental for analyzing parameters such as the phase relationship between grid voltage and current, and the power factor.

[0063] The fundamental current phase angle is calculated using the arctangent function based on the second fundamental component, representing the phase angle of the fundamental current passing through the sampling resistor. It reflects the phase characteristics of the fundamental current and, together with the fundamental grid voltage phase angle, determines the power transfer in the circuit.

[0064] In one feasible approach, a lookup table for the arctangent function can be pre-established, storing the values ​​of the arctangent function discretized within a certain range. For the first and second fundamental components, the ratios of their imaginary to real parts, x1=b1 / a1 and x2=b2 / a2, are first calculated. Then, the angles corresponding to the closest values ​​of x1 and x2 are searched in the lookup table. If the discrete values ​​in the lookup table do not meet the accuracy requirements, linear interpolation can be used to further refine the lookup results, yielding more accurate fundamental grid voltage phase angles and fundamental current phase angles. Combining the lookup table method with linear interpolation can significantly improve calculation speed while maintaining a certain level of accuracy. Compared to directly calling mathematical library functions, the lookup table method avoids complex function calculations, making it particularly suitable for situations with extremely high real-time requirements and limited computational resources. Furthermore, by appropriately setting the precision and range of the lookup table, a good balance can be achieved between calculation speed and accuracy.

[0065] In another feasible approach, the arctangent function provided in the math library can be directly called within the programming environment. For the first fundamental component a1+jb1 and the second fundamental component a2+jb2, atan2(b1, a1) and atan2(b2, a2) are used to calculate the fundamental grid voltage phase angle θ1 and the fundamental current phase angle θ2, respectively. The atan2 function can correctly handle angles in all quadrants, avoiding the quadrant determination issues that need to be considered when directly using the atan function. Directly calling math library functions is simple and convenient, the code implementation is concise, and the workload of developers is reduced.

[0066] Step S24: Determine the fundamental grid voltage phase angle as the target grid voltage phase angle, and determine the fundamental current phase angle as the target sampling resistor current phase angle.

[0067] In this embodiment, the Fast Fourier Transform (FFT) can convert a time-domain signal into a frequency-domain signal. By performing FFT processing on the grid voltage signal sequence and the sampled resistor voltage signal sequence respectively, the complex time-domain waveform can be decomposed into components of different frequencies. The fundamental component is the lowest frequency component of the signal, typically with the largest amplitude; it contains the main energy and basic characteristics of the signal. By extracting the first and second fundamental components from the FFT processing results, the core frequency information of the signal can be accurately obtained, avoiding interference from other harmonic components, thereby improving the accuracy of subsequent phase angle calculations.

[0068] Furthermore, the grid voltage signal sequence is processed by Fast Fourier Transform (FFT), and the FFT result of the grid voltage signal sequence includes: Step S211: Divide the grid voltage signal sequence into two subsequences according to the parity of the time index, to obtain the first even-indexed subsequence and the first odd-indexed subsequence; In this context, the time index refers to the unique identifier and location of each sampling point in a power grid voltage signal sequence. Each point is assigned a sequence number according to the sampling order; this number is the time index. For example, if the power grid voltage is sampled at equal intervals, the time index of the first sampling point is 0, the second is 1, and so on. The time index helps us accurately manipulate and analyze each sampling point in the signal.

[0069] The first even-indexed subsequence refers to the subsequence composed of sampling points with even time indices after the power grid voltage signal sequence is divided according to the parity of the time index. For example, if the original sequence is x[0], x[1], x[2], x[3], x[4], x[5], then the first even-indexed subsequence is x[0], x[2], x[4].

[0070] The first odd-indexed subsequence is also based on the parity of the time index, and is a subsequence composed of sampling points with odd time indices. For the original sequence above, the first odd-indexed subsequence is x[1], x[3], x[5].

[0071] In one feasible approach, a loop structure can be created to iterate through each sampling point in the grid voltage signal sequence. During the iteration, it checks whether the time index of the current sampling point is odd or even. If it is even, the sampling point is added to the first even-indexed subsequence; if it is odd, it is added to the first odd-indexed subsequence.

[0072] In another feasible approach, the slicing function can be directly used to divide the sequence into subsequences. Assuming the grid voltage signal sequence is stored in an array, starting from the beginning of the array, every other element is taken to obtain the first even-indexed subsequence; starting from the second element, every other element is taken to obtain the first odd-indexed subsequence. Array slicing is typically a low-level language optimization, resulting in fast execution and quick subsequence division, thus improving the overall program efficiency.

[0073] Step S212: Recursively perform Fast Fourier Transform on the first even-indexed subsequence and the first odd-indexed subsequence respectively to obtain the Fast Fourier Transform processing result of the first even-indexed subsequence and the Fast Fourier Transform processing result of the first odd-indexed subsequence. In one feasible implementation, the input sequence is checked to see if it satisfies the recursion termination condition. If not, the input sequence is divided into a first even-indexed subsequence and a first odd-indexed subsequence as described in step S211. Then, the function is recursively called to perform a Fast Fourier Transform on each of these subsequences, and finally, the transform results are combined. This implementation follows the divide-and-conquer algorithm principle of Fast Fourier Transform, making it easy to understand and verify the correctness of the algorithm.

[0074] In another feasible approach, to avoid the stack overflow risk associated with recursive calls and to improve execution efficiency, an iterative approach can be used to simulate the recursive process. By using loop structures and auxiliary arrays, the decomposition and transformation of subsequences are performed step by step. Specifically, it can start with the smallest subsequence, gradually merging and transforming it until the Fast Fourier Transform result of the entire sequence is obtained. Since the iterative approach does not use a function call stack like recursion, it avoids stack overflow issues, can handle longer sequences, and improves the algorithm's applicability and stability.

[0075] Step S213: Perform a butterfly operation to merge the Fast Fourier Transform (FFT) results of the first even-indexed subsequence and the first odd-indexed subsequence to obtain the FFT result of the grid voltage signal sequence.

[0076] In one feasible approach, butterfly operations involve addition, subtraction, and multiplication of complex numbers. According to the butterfly operation formula for the Fast Fourier Transform (FFT), for each merge point, the sum and difference of the products of the FFT results of the first even-indexed subsequence and the FFT results of the first odd-indexed subsequence with the twitch factor are calculated. Specifically, let the FFT result of the first even-indexed subsequence be E. k The result of the Fast Fourier Transform of the first odd-indexed subsequence is O. k If the rotation factor is W, then the merged result is X. k =E k +W*O k and X k+N / 2 =E k -W*O k Using complex number operations directly can ensure the accuracy of the calculation and avoid the accumulation of errors caused by step-by-step or approximate calculations, thus obtaining more accurate Fast Fourier Transform results.

[0077] In another feasible approach, butterfly operations can be viewed as matrix-vector multiplication. The transformed results of the first even-indexed subsequence and the first odd-indexed subsequence can be combined into a vector. Then, a butterfly operation matrix can be constructed, and the merging of all butterfly operations can be performed in one step through matrix-vector multiplication. Matrix operations can significantly improve the computational speed of butterfly operations.

[0078] In this embodiment, the Cooley-Tukey Fast Fourier Transform (FFT) algorithm is used to dynamically analyze the grid voltage signal, completing the Discrete Fourier Transform (DFT) operation in an extremely short time and accurately capturing the millisecond-level phase difference between the two signals. This algorithm significantly improves computational efficiency, enabling the system to complete phase angle calculation within a single half-cycle window and determine the energy flow direction accordingly, thereby improving the accuracy and efficiency of the FFT processing results for the grid voltage signal sequence.

[0079] Furthermore, a Fast Fourier Transform (FFT) is performed on the sampled resistor voltage signal sequence to obtain the FFT result of the sampled resistor voltage signal sequence, including: Step S214: Divide the sampling resistor voltage signal sequence into two subsequences according to the parity of the time index, to obtain the second even-indexed subsequence and the second odd-indexed subsequence. Step S215: Recursively perform Fast Fourier Transform on the second even-indexed subsequence and the second odd-indexed subsequence respectively to obtain the Fast Fourier Transform processing result of the second even-indexed subsequence and the Fast Fourier Transform processing result of the second odd-indexed subsequence. Step S216: Perform a butterfly operation to merge the Fast Fourier Transform (FFT) results of the second even-indexed subsequence and the second odd-indexed subsequence to obtain the FFT result of the sampled resistor voltage signal sequence.

[0080] The method for determining the Fast Fourier Transform (FFT) result of the sampled resistor voltage signal sequence is the same as the method for determining the FFT result of the grid voltage signal sequence described above. For details, please refer to the method for determining the FFT result of the grid voltage signal sequence described above.

[0081] In this embodiment, the Cooley-Tukey Fast Fourier Transform algorithm is used to dynamically analyze the sampled resistor current signal, completing the Discrete Fourier Transform operation in a very short time and accurately capturing the millisecond-level phase difference between the two signals. This algorithm significantly improves computational efficiency, enabling the system to complete the phase angle calculation within a single half-cycle window and determine the energy flow direction accordingly, thereby improving the accuracy and efficiency of the Fast Fourier Transform processing results for the sampled resistor voltage signal sequence.

[0082] Based on the above, in one feasible implementation, step S40 includes: Step S41: If the phase difference is within the first preset phase angle range, it is determined that a backflow has occurred; Step S42: If the phase difference is within the second preset phase angle range, it is determined that no backflow has occurred; Wherein, the phase angle in the first preset phase angle interval is greater than the phase angle in the second preset phase angle interval. The first preset phase angle interval can be set to 90° < θ < 270°, and the second preset phase angle interval can be set to -90° < θ < 270°. θ <90°. For purely resistive loads, it is only necessary to determine if the phase difference is 180° to identify reverse current, and the current magnitude within half a cycle can be calculated to provide accurate feedback to the inverter to adjust the output power. However, in actual power consumption, due to the capacitive and inductive properties of the load, the phase difference between the grid voltage and current is -90° < θ < 90° when power is drawn from the grid. This phase difference is within a limited range. When reverse current occurs and the grid is connected, the power flow is towards the grid, and the phase difference is affected by the grid load. The phase difference limit is 90° < θ < 270°.

[0083] In this embodiment, by setting a preset phase angle range, the phase difference is compared with the preset phase angle range to determine whether backflow occurs, thereby achieving the effect of backflow detection.

[0084] Based on the above embodiments of this application, in another embodiment of this application, the same or similar content as the above embodiments can be referred to the above description, and will not be repeated hereafter. Based on this, the following steps can be performed after step S40: Step S50: Perform root mean square calculation on the sampling resistor voltage signal sequence to obtain the target sampling resistor current; The root mean square (RMS) is a mathematical method for measuring the effective value of an AC signal. For a discrete voltage signal sequence U1, U2, ..., Un, the formula for calculating its RMS value Urms is: In power systems, the root mean square value of AC voltage or current reflects its work capacity, corresponding to the equivalent work done by DC current, and can more accurately describe the actual effect of AC signals.

[0085] The target sampling resistor current refers to the sampling resistor connected in series in the circuit, used to indirectly measure the current in the circuit. According to Ohm's law I=RU, where I is the current, U is the voltage across the sampling resistor, and R is the resistance of the sampling resistor, the effective value Urms of the voltage is obtained by performing root mean square calculation on the sampling resistor voltage signal sequence. Combined with the known resistance value R, the target sampling resistor current Itarget=RUrms, which represents the actual current situation of the circuit, can be calculated.

[0086] In one feasible approach, a loop structure can be written to first initialize a variable to store the sum of squared voltages. Then, each voltage value in the sampled resistor voltage signal sequence is read sequentially, squared, and accumulated into the same variable. After the loop ends, the sum of squared voltages is divided by the length n of the signal sequence, and the square root of the result is taken to obtain the root mean square value Urms of the voltage. Finally, the target sampled resistor current is calculated using Ohm's law Itarget = RUrms.

[0087] By synchronously performing real-time root mean square calculation on the current signal within a complete half-cycle, the effects of waveform distortion and harmonic interference are eliminated, and the effective value parameters of the current are accurately output.

[0088] Step S60: Determine the output power direction of the inverter based on the reverse current detection results; In an inverter system, the output power direction refers to the direction of power flow between the inverter and the external power grid or load. When the inverter delivers active power to the outside, the power direction is positive, meaning the inverter is supplying power to the outside. When the inverter absorbs active power from the outside, the power direction is negative, indicating that the inverter may be charging or in another state requiring energy from the outside. Accurately determining the output power direction is crucial for the stable operation of the inverter, power balance of the power grid, and the implementation of various control strategies.

[0089] In one feasible approach, the inverter's output power P = Ugrid * Itarget * cosθ can be calculated based on the target sampling resistor current Itarget obtained in the previous steps and the real-time measured grid voltage Ugrid, where θ is the phase difference between voltage and current, which can be obtained through a phase detection circuit or algorithm. Then, a reverse current detection threshold is preset, which can be determined based on factors such as the inverter's rated power and grid requirements. When P > 0 and P < the reverse current detection threshold, the inverter is considered to be normally outputting power to the outside, and the output power direction is positive; when P < 0 or P > Pthreshold, reverse current is detected, and the output power direction is reverse. This method is based on the basic power calculation formula, directly determining the output power direction based on the sign and magnitude of the power. The principle is clear and easy to understand, facilitating engineering personnel's comprehension and implementation.

[0090] In another feasible approach, the direction of the current in the sampling resistor can be monitored in real time using a current sensor, while the phase of the grid voltage is measured using a phase detection circuit or algorithm. When the current direction is consistent with the current direction during normal output power, and the current phase lags behind or is in phase with the voltage phase, the inverter's output power direction is determined to be positive. When the current direction is opposite to the current direction during normal output power, or the current phase leads the voltage phase, a reverse current situation is identified, and the output power direction is reversed. This method does not require complex power calculations; it only needs to monitor the current direction and voltage phase in real time, enabling rapid response to changes in power direction. It is suitable for inverter control systems with extremely high real-time requirements.

[0091] Step S70: Feedback the target sampling resistor current and the output power direction to the inverter so that the inverter can control the inverter based on the target sampling resistor current and the output power direction.

[0092] In one feasible approach, a CAN bus communication module is configured in the inverter's control unit. The target sampling resistor current and output power direction information are encoded and encapsulated according to the CAN bus communication protocol to form a data frame. This data frame is then sent to the inverter's control unit via the CAN bus. Upon receiving the data frame, the inverter's control unit decodes it according to the protocol to obtain the target sampling resistor current and output power direction information, and performs corresponding control operations based on this information, such as adjusting the inverter's output power and implementing protection strategies. Because the CAN bus uses differential signal transmission, it has good electromagnetic interference resistance and can reliably transmit data in complex electromagnetic environments, ensuring the accuracy of feedback information.

[0093] In this embodiment, by determining the target sampling resistor current and the inverter's output power direction, and feeding the target sampling resistor current and the output power direction back to the inverter, data support is provided for the subsequent control of the inverter.

[0094] To facilitate understanding of the overall process of the reverse flow detection method in this application, please refer to... Figure 9 .

[0095] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the reverse flow detection method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0096] Based on the above, after performing reverse current detection, the inverter is controlled. This application provides an inverter control method, which is described below. Figure 10 , Figure 10 This is a flowchart illustrating an embodiment of the control method for the inverter of this application.

[0097] Step S110: Obtain the target sampling resistor current and the inverter output power direction, wherein the target sampling resistor current and the output power direction are obtained by performing a fast Fourier transform on the grid voltage signal sequence and the sampling resistor voltage signal sequence for half a sampling period. The target sampling resistor current and the direction of the inverter's output power can be determined using the above embodiments, and will not be elaborated here.

[0098] In one feasible approach, the target sampling resistor current and the inverter's output power direction can be obtained based on the CAN bus by acquiring the target sampling resistor current and the inverter's output power direction fed back by the reverse current detection device.

[0099] In another possible approach, the target sampling resistor current and the inverter's output power direction fed back by the reverse current detection device can be cached in a storage space, and the target sampling resistor current and the inverter's output power direction can be retrieved from that storage space when needed.

[0100] Step S120: Control the inverter according to the target sampling resistor current and the output power direction.

[0101] In one feasible approach, the proportional (P), integral (I), and derivative (D) parameters of the PID controller can be determined experimentally or through simulation based on the inverter system characteristics. For example, in a photovoltaic inverter, the P parameter can be set to 0.5-2 times the output current, the I parameter is used to eliminate steady-state error, and the D parameter suppresses dynamic overshoot. The target sampling resistor current is used as a feedback signal and compared with the set value to generate an error signal. The PID controller dynamically adjusts the duty cycle of the inverter's switching transistors based on the error signal to achieve precise tracking of the output current. For example, when the output power direction is forward, the PID controller increases the duty cycle to increase the output current; when it is reverse, it decreases the duty cycle. (The PID control mode is switched during reverse power flow, taking into account the output power direction signal, to avoid system instability caused by energy backflow.) Because the PID algorithm, through the synergistic effect of the proportional, integral, and derivative components, meets the high power quality requirements of grid-connected inverters.

[0102] In this embodiment, the inverter control device acquires the target sampling resistor current and the inverter's output power direction, and controls the inverter based on these parameters. Since the target sampling resistor current and output power direction are obtained by performing a Fast Fourier Transform on the grid voltage signal sequence and the sampling resistor voltage signal sequence for half a sampling period, the efficiency of determining the target sampling resistor current and output power direction is improved, thereby increasing the inverter's control response speed.

[0103] In a feasible implementation manner, step S120 includes: when it is determined according to the output power direction that there is no reverse current and the target sampling resistor current is greater than the set current, obtaining the current output power of the inverter; when the current output power of the inverter reaches the maximum output power, keeping the current output power of the inverter unchanged; when the current output power of the inverter does not reach the maximum output power, adjusting the output power of the inverter.

[0104] Wherein, the set current can be set according to the actual situation.

[0105] In an achievable manner, it is determined by a reverse current detection circuit that there is no reverse current in the output power direction. The target sampling resistor current and the set current are compared by a comparator. When the target sampling resistor current is greater than the set current, the subsequent power acquisition and adjustment process is triggered. The output voltage Uout of the inverter is measured in real time by a voltage sensor. Combining the obtained target sampling resistor current Itarget, the current output power Pcurrent of the inverter is calculated according to the power calculation formula P = Uout * Itarget. The maximum output power Pmax of the inverter is preset, and Pcurrent is compared with Pmax. If Pcurrent = Pmax, the current switching state, duty cycle and other parameters of the inverter are kept unchanged through a control signal, so that the inverter maintains the current output power. If Pcurrent < Pmax, a power closed-loop regulation method is adopted. Pmax is used as the target power, and the difference between the target power and the current power is calculated as ΔP = Pmax - Pcurrent. According to this difference, the control parameters of the inverter such as the duty cycle of the switching tube are adjusted through a proportional-integral-derivative controller, so that the output power of the inverter gradually approaches Pmax. The output of the PID controller is used to control the pulse width modulation signal of the inverter, thereby adjusting the output power. By adopting power closed-loop regulation, the PID controller can adjust the control parameters in real time according to the power difference, so that the output power of the inverter quickly and accurately reaches the maximum output power.

[0106] In another implementable manner, in addition to calculating the current power Pcurrent by measuring the output voltage and current in real time, feedforward information can also be introduced. For example, based on the input power of the inverter and the efficiency characteristics of the inverter, the current output power is estimated. The measured and calculated Pcurrent and the estimated power are weighted and averaged to obtain a more accurate current output power value Pacc. The maximum output power Pmax is set, and Pacc is compared with Pmax. If Pacc = Pmax, the current state of the inverter remains unchanged. If Pacc < Pmax, a segmented regulation strategy is adopted. The power regulation range is divided into multiple intervals. Different regulation methods and speeds are used in different intervals. In the low-power interval, a faster regulation speed is adopted to quickly increase the power and shorten the time to reach the target power. In the medium-power interval, a moderate regulation speed is adopted to ensure the smoothness of power regulation. In the high-power interval, a slower regulation speed is adopted, and combined with feedback control, the power is accurately regulated to Pmax. At the same time, feedforward control is introduced to adjust the control parameters of the inverter in advance according to the change of the input power, improving the response speed of the system.

[0107] In this embodiment, it is determined that there is no reverse current by judging the output power direction, which is a key prerequisite for ensuring the safety of the inverter and the entire power system. If reverse current occurs, that is, electrical energy flows reversely from the load end to the power grid, it may cause the grid voltage to rise abnormally, affect the normal operation of other devices in the grid, and even damage the devices. This application effectively avoids the occurrence of this situation and ensures the stability and safety of the grid. When the target sampling resistor current is greater than the set current, the current output power is further obtained and compared with the maximum output power. If the current output power has reached the maximum output power, the current state remains unchanged to prevent the inverter from being overloaded due to excessive output power. Overloading will cause the electronic components inside the inverter to heat up more severely, reduce the component life, and even cause component damage, resulting in the inverter malfunctioning and shutting down. Under the condition that it is determined that there is no reverse current and the target sampling resistor current meets the conditions, the output power of the inverter is adjusted to make it as close as possible to the maximum output power, which means that the inverter can fully utilize its rated capacity and output more electrical energy to the load or the power grid, avoiding the idle and waste of the inverter capacity.

[0108] In a feasible implementation manner, after step S110, it further includes: when it is determined that there is reverse current according to the output power direction and the output power of the inverter reaches the minimum output power, controlling the inverter to shut down; when it is determined that there is reverse current according to the output power direction and the output power of the inverter does not reach the minimum output power, adjusting the output power of the inverter.

[0109] In one feasible implementation, when the reverse current detection circuit outputs a reverse current signal and the minimum output power detection circuit outputs a minimum output power signal, the control circuit immediately issues a shutdown command, cutting off the inverter's switching transistors and stopping the inverter from operating. When the reverse current detection circuit outputs a reverse current signal but the minimum output power detection circuit outputs a signal indicating that the minimum output power has not been reached, the control circuit initiates a power regulation algorithm. For example, a PID control algorithm can be used to adjust the duty cycle of the inverter's switching transistors based on the difference between the current output power and the minimum output power, thereby regulating the output power to gradually reduce it and prevent increased reverse current.

[0110] In another feasible approach, when the reverse current detection algorithm determines the presence of reverse current and the minimum output power detection algorithm determines that the output power has reached the minimum output power, the control unit issues a shutdown command, cutting off the inverter's switching transistors via the drive circuit, thus stopping the inverter from operating. When the reverse current detection algorithm determines the presence of reverse current but the minimum output power detection algorithm determines that the output power has not reached the minimum output power, the control unit employs an adaptive control algorithm. Based on real-time power data and reverse current conditions, it dynamically adjusts control parameters, such as adjustment speed and adjustment range, to achieve precise regulation of the inverter's output power, gradually reducing it to a safe range.

[0111] In this embodiment, when reverse current occurs in the inverter's output power direction—that is, electrical energy flows backward from the load to the grid—it may cause problems such as abnormal rises or falls in grid voltage and frequency fluctuations if not handled promptly. For example, in a distributed photovoltaic power generation system, if a large number of inverters experience reverse current simultaneously, it can severely impact the stability of the local power grid. When reverse current still exists even after the output power has reached its minimum, it indicates that the current operating state of the inverter cannot eliminate the adverse effects of the reverse current on the grid through adjustment. At this time, shutting down the inverter can quickly cut off the reverse current source, prevent the fault from escalating further, and ensure the safe and stable operation of the entire power system. When the inverter's output power has not reached its minimum and reverse current exists, adjusting the output power can better match the inverter's output power with the actual load demand. This dynamic adjustment can improve energy utilization efficiency, reduce energy waste, and make the entire power system operate more economically and efficiently.

[0112] To facilitate understanding of the overall process of the inverter control method of this application, please refer to... Figure 11 .

[0113] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the control method of the inverter of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0114] Based on the same inventive concept, this application provides a control device for an inverter, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the inverter control method in the above embodiments.

[0115] The inverter control device provided in this application, employing the inverter control method described in the above embodiments, can solve the technical problem of low efficiency in existing anti-reverse current control. Compared with the prior art, the beneficial effects of the inverter control device provided in this application are the same as those of the inverter control method provided in the above embodiments, and other technical features in the inverter control device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0116] Based on the same inventive concept, this application provides a computer-readable storage medium having computer-readable program instructions stored thereon, which are used to execute the reverse current detection method in the above embodiments or to execute the inverter control method in the above embodiments.

[0117] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory (EPROM), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.

[0118] The aforementioned computer-readable storage medium may be included in the reverse current detection device; or it may exist independently and not assembled into the reverse current detection device. The aforementioned computer-readable storage medium carries one or more programs that, when executed by the reverse current detection device, enable the reverse current detection device to improve the reverse current detection efficiency.

[0119] Alternatively, the aforementioned computer-readable storage medium may be included in the inverter's control unit; or it may exist independently and not be assembled into the inverter's control unit. The aforementioned computer-readable storage medium carries one or more programs that, when executed by the inverter's control unit, enable the inverter's control unit to improve its backflow prevention control efficiency.

[0120] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0121] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0122] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0123] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions for executing the above-described reverse current detection method, thereby solving the technical problem of low efficiency in existing reverse current detection methods. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the reverse current detection method provided in the above embodiments, and will not be elaborated further here. Alternatively, the readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions for executing the above-described inverter control method, thereby solving the technical problem of low efficiency in existing anti-reverse current control methods. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the inverter control method provided in the above embodiments, and will not be elaborated further here.

[0124] The above are only some embodiments of this application and do not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A method for detecting backflow, characterized in that, The backflow detection method includes: Acquire the grid voltage signal sequence and the sampling resistor voltage signal sequence for half a sampling period; The grid voltage signal sequence and the sampling resistor voltage signal sequence are processed by Fast Fourier Transform to obtain the target grid voltage phase angle and the target sampling resistor current phase angle. Determine the phase difference between the target grid voltage phase angle and the target sampling resistor current phase angle; The reverse flow detection result is determined based on the preset phase difference interval in which the phase difference is located.

2. The countercurrent detection method as described in claim 1, characterized in that, The step of performing Fast Fourier Transform processing on the grid voltage signal sequence and the sampling resistor voltage signal sequence to obtain the target grid voltage phase angle and the target sampling resistor current phase angle includes: The grid voltage signal sequence and the sampling resistor voltage signal sequence are processed by Fast Fourier Transform (FFT) to obtain the FFT results of the grid voltage signal sequence and the sampling resistor voltage signal sequence. Extract the first fundamental component from the fast Fourier transform processing result of the power grid voltage signal sequence, and extract the second fundamental component from the fast Fourier transform processing result of the sampling resistor voltage signal sequence. The fundamental grid voltage phase angle and the fundamental current phase angle are obtained by calculating the first fundamental component and the second fundamental component using the arctangent function, respectively. The fundamental grid voltage phase angle is determined as the target grid voltage phase angle, and the fundamental current phase angle is determined as the target sampling resistor current phase angle.

3. The countercurrent detection method as described in claim 2, characterized in that, Performing a Fast Fourier Transform (FFT) on the power grid voltage signal sequence yields the following FFT results: The power grid voltage signal sequence is divided into two subsequences according to the parity of the time index, resulting in a first even-indexed subsequence and a first odd-indexed subsequence. The fast Fourier transform is recursively performed on the first even-indexed subsequence and the first odd-indexed subsequence respectively to obtain the fast Fourier transform processing result of the first even-indexed subsequence and the fast Fourier transform processing result of the first odd-indexed subsequence. The fast Fourier transform results of the first even-indexed subsequence and the fast Fourier transform results of the first odd-indexed subsequence are combined using a butterfly operation to obtain the fast Fourier transform result of the power grid voltage signal sequence.

4. The countercurrent detection method as described in claim 2, characterized in that, Performing a Fast Fourier Transform (FFT) on the sampled resistor voltage signal sequence yields the following FFT results: The sampling resistor voltage signal sequence is divided into two subsequences according to the parity of the time index, resulting in a second even-indexed subsequence and a second odd-indexed subsequence. The fast Fourier transform is recursively performed on the second even-indexed subsequence and the second odd-indexed subsequence respectively to obtain the fast Fourier transform processing results of the second even-indexed subsequence and the fast Fourier transform processing results of the second odd-indexed subsequence. The fast Fourier transform results of the second even-indexed subsequence and the fast Fourier transform results of the second odd-indexed subsequence are combined using a butterfly operation to obtain the fast Fourier transform result of the sampled resistor voltage signal sequence.

5. The backflow detection method according to any one of claims 1 to 4, characterized in that, The step of determining the reverse current detection result based on the preset phase difference interval in which the phase difference is located includes: If the phase difference is within the first preset phase angle range, it is determined that a backflow has occurred; If the phase difference is within the second preset phase angle range, it is determined that no backflow has occurred; Wherein, the phase angle in the first preset phase angle interval is greater than the phase angle in the second preset phase angle interval.

6. The backflow detection method as described in claim 1, characterized in that, The reverse flow detection method further includes: The root mean square (RMS) calculation is performed on the sampling resistor voltage signal sequence to obtain the target sampling resistor current; And, based on the reverse current detection results, the output power direction of the inverter is determined; The target sampling resistor current and the output power direction are fed back to the inverter so that the inverter can control itself based on the target sampling resistor current and the output power direction.

7. A control method for an inverter, characterized in that, The control method for the inverter includes: The target sampling resistor current and the inverter output power direction are obtained by performing a fast Fourier transform on the grid voltage signal sequence and the sampling resistor voltage signal sequence for half a sampling period. The inverter is controlled based on the target sampling resistor current and the output power direction.

8. The inverter control method as described in claim 7, characterized in that, The step of controlling the inverter based on the target sampling resistor current and the output power direction includes: Based on the output power direction, if it is determined that there is no reverse current and the target sampling resistor current is greater than the set current, the current output power of the inverter is obtained; If the current output power of the inverter reaches the maximum output power, the current output power of the inverter shall remain unchanged. If the current output power of the inverter does not reach the maximum output power, the output power of the inverter is adjusted.

9. The inverter control method as described in claim 7, characterized in that, After obtaining the target sampling resistor current and the output power direction, the method further includes: If, based on the output power direction, it is determined that there is reverse current and the inverter's output power reaches its minimum output power, the inverter is controlled to shut down. If, based on the output power direction, it is determined that there is reverse current and the output power of the inverter has not reached the minimum output power, the output power of the inverter is adjusted.

10. A countercurrent detection device, characterized in that, The backflow detection device includes: The sampling resistor is used to convert the current signal in the circuit consisting of the power grid, load and inverter within half a sampling period into a sampling resistor voltage signal, thus obtaining a sampling resistor voltage signal sequence. A differential amplification sampling circuit, wherein the input terminal of the differential amplification sampling circuit is connected to the sampling resistor, and is used to amplify the sampling resistor voltage signal to obtain an amplified sampling resistor voltage signal sequence; Voltage sampling circuit, used to acquire the grid voltage signal sequence for half a sampling period; A microcontroller, the input terminals of which are connected to the output terminals of the differential amplification sampling circuit and the voltage sampling circuit respectively, is used to determine the reverse current detection result based on the amplified sampling resistor voltage signal sequence and the grid voltage signal sequence; The communication module is used to establish a communication connection between the microcontroller and the inverter's control device, and to send the reverse current detection result to the inverter's control device.

11. A countercurrent detection system, characterized in that, The reverse current detection system includes: an inverter, a load, a reverse current detection device as described in claim 10, and a power grid, wherein the inverter, the reverse current detection device, and the power grid are connected in sequence, and the load is connected between the inverter and the reverse current detection device.

12. A control device for an inverter, characterized in that, The control device for the inverter includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the control method for the inverter as claimed in any one of claims 7 to 9.

13. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the reverse current detection method as claimed in any one of claims 1 to 6, or, when the computer program is executed by a processor, it implements the steps of the inverter control method as claimed in any one of claims 7 to 9.