Commercial power phase monitoring device and method
By sampling the digital quantity of the mains voltage in real time, calculating the difference in the number of sampling points in the positive and negative half-period periods, accurately judging the phase jump of the mains voltage, solving the problem of misjudgment in the existing technology, improving the accuracy of detection, and extending the equipment life.
Patent Information
- Application Number
- CN202411167988.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-06
AI Technical Summary
The prior art is difficult to accurately detect the phase jump of mains voltage, which is prone to misjudgment due to inaccurate current threshold or confusion of the frequency protection area and the mains frequency range corresponding to the phase jump, which affects the service life of the energy storage converter.
By sampling the mains voltage digital quantity in real time, calculate the difference in the mains voltage sampling points in the positive and negative half cycles, and judge whether there is a phase jump based on the absolute value of the difference, avoiding misjudgment of the current threshold and frequency protection area, and improving Accuracy of detection.
It realizes accurate detection of the phase jump of mains voltage, reduces misjudgment, and extends the service life of equipment such as energy storage converters.
Smart Images

Figure CN119087039A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of energy storage converters, and in particular, relates to a mains phase monitoring device and method. Background Art
[0002] Mains power refers to the electricity provided by the power grid. The Power Conversion System (PCS) is a key device in the energy storage system, which is used to realize energy conversion and two-way flow between the energy storage battery and the power grid. During the operation of the power grid, factors such as power grid failure, wiring failure, and electromagnetic interference may cause the mains voltage phase jump. The mains voltage phase jump refers to the phenomenon that the mains voltage phase changes suddenly in a short period of time. The mains voltage phase jump will cause an impact on the energy storage converter and the electrical equipment connected to the energy storage converter, thereby affecting the service life of the energy storage converter and the electrical equipment connected to the energy storage converter. Therefore, the detection of the mains voltage phase jump becomes particularly important. Summary of the invention
[0003] In the related art, the main method for detecting whether the mains voltage has a phase jump is to use current or mains frequency. Among them, the detection through current mainly involves comparing the mains current with the current threshold, and then judging whether there is an impact current caused by the phase jump. Since the impact current caused by the phase jump is not fixed, it is difficult to accurately set the current threshold, so there is a possibility of misjudgment. The detection through mains frequency mainly involves comparing the mains frequency with the preset frequency interval when the phase jump occurs, so as to judge whether the mains voltage has a phase jump. Since the mains frequency interval where the phase jump occurs overlaps with the mains frequency protection interval of the regulations, when the mains frequency is detected, it is easy to misjudge the phase jump as frequency protection, and thus the phase jump cannot be accurately identified.
[0004] The embodiments of the present application provide a mains phase monitoring device and method, which can improve the accuracy of mains voltage phase jump detection.
[0005] In the first aspect, an embodiment of the present application provides a mains phase monitoring device, including: a control board, including a digital signal processor; the digital signal processor includes an IO pin, and the IO pin is configured to collect the mains voltage and / or the mains frequency; the digital signal processor includes an analog-to-digital converter and a program processing unit, and the analog-to-digital converter is configured to convert the mains voltage into a digital quantity of the mains voltage; the program processing unit is configured to perform the following operations: calculate a first quantity and a second quantity, defining the first quantity as the number of digital quantities of the mains voltage in the positive half-cycle waveform of the current mains voltage, and the second quantity as the number of digital quantities of the mains voltage in the negative half-cycle waveform of the current mains voltage; the program processing unit is used to determine that a phase jump has occurred in the mains voltage based on the absolute value of the difference between the first quantity and the second quantity being greater than a difference threshold.
[0006] Through the above technical solution, based on the characteristic that the waveform of the mains voltage will change significantly when the mains voltage undergoes a phase jump, the mains voltage digital quantity is sampled in real time, and the number of sampling points and the difference of the mains voltage digital quantity in the positive and negative half cycles of the current mains voltage are calculated and compared based on the mains voltage digital quantity, so as to judge whether the waveform of the mains voltage has changed significantly, and then determine whether the mains voltage has undergone a phase jump. In this way, there is no need to determine the current threshold, nor to compare the mains frequency, which can reduce the misjudgment caused by inaccurate current threshold or confusion between the frequency protection area and the mains frequency interval corresponding to the phase jump, improve the accuracy of the mains voltage phase jump detection, and facilitate the timely formulation of response plans when the mains voltage undergoes a phase jump, thereby extending the service life of equipment such as energy storage inverters.
[0007] In one or more embodiments of the present application, calculating the first quantity and the second quantity includes: in response to the grid connection of the energy storage inverter, in each mains voltage cycle, calculating the number of mains voltage sampling points in the current mains voltage cycle; obtaining a mains voltage digital quantity corresponding to the number of mains voltage sampling points to form a mains voltage digital quantity set; in the process of forming the mains voltage digital quantity set, determining the first quantity and the second quantity based on the obtained mains voltage digital quantity.
[0008] Through the above technical solution, the corresponding first quantity and second quantity can be determined in each mains voltage cycle, so as to realize the real-time detection of voltage phase jump in each mains voltage cycle.
[0009] In one or more embodiments of the present application, the digital signal processor includes a program interrupt timing unit; the program interrupt timing unit is used to control the execution cycle of the program processing unit, and the execution cycle is the interval time of the program loop execution; the number of AC voltage sampling points in the current AC voltage cycle is calculated, including: calculating the AC frequency corresponding to the current AC voltage cycle, and taking the ratio of the inverse of the AC frequency to the execution cycle as the number of AC voltage sampling points in the current AC voltage cycle.
[0010] Through the above-mentioned technical scheme, in each mains voltage cycle, the number of mains voltage sampling points in the mains voltage cycle is determined according to the mains frequency of the mains voltage cycle and the program execution cycle, so that the number of mains voltage sampling points can change with the change of the mains frequency. In this way, when the mains frequency fluctuates, the number of mains voltage sampling points in the mains voltage cycle can be accurately determined, so as to accurately obtain the mains voltage digital quantity set corresponding to the mains voltage cycle, improve the accuracy of the first number and the second number, and then improve the accuracy of the mains voltage phase jump detection.
[0011] In one or more embodiments of the present application, the digital signal processor includes a buffer register, which is configured to store the digital value of the mains voltage in the current mains voltage cycle; the length of the buffer register is greater than or equal to the number of mains voltage sampling points in the current mains voltage cycle.
[0012] In one or more embodiments of the present application, a mains voltage digital quantity corresponding to the number of mains voltage sampling points is obtained to form a mains voltage digital quantity set, including: in the first mains voltage cycle, the first mains voltage digital quantity is obtained, starting from the first address of the buffer register, the first mains voltage digital quantity is stored in the buffer register in sequence, until all the first mains voltage digital quantities are stored in the buffer register, the first mains voltage cycle is determined to be over, and the set consisting of all the mains voltage digital quantities stored in the buffer register is used as the first mains voltage digital quantity set corresponding to the first mains voltage cycle; for each other mains voltage cycle after the first mains voltage cycle, the second mains voltage digital quantity corresponding to the current mains voltage cycle is obtained, starting from the first address of the buffer register, the second mains voltage digital quantity replaces the mains voltage digital quantity of the previous mains voltage cycle stored in the buffer register with the second mains voltage digital quantity, until all the second mains voltage digital quantities are stored in the buffer register, the current mains voltage cycle is determined to be over, and the set consisting of the mains voltage digital quantities obtained by replacement in the buffer register is used as the current mains voltage digital quantity set corresponding to the current mains voltage cycle.
[0013] In this way, the number of mains voltage sampling points in each mains voltage cycle can be stored, which is convenient for further calculating the difference between the number of sampling points in the positive and negative half cycles of each mains voltage cycle, and then judging whether the mains voltage has a phase jump.
[0014] In one or more embodiments of the present application, the digital signal processor includes a first counting unit and a second counting unit; the program processing unit is configured to: before obtaining the first mains voltage digital quantity set, initialize the count values of the first counting unit and the second counting unit to 0; the first counting unit and the second counting unit are configured to perform the following operations: in the first mains voltage cycle, determine whether the mains voltage values represented by all the first mains voltage digital quantities are positive or negative, when the mains voltage value represented by the first mains voltage digital quantity is positive, add one to the count value of the first counting unit, when the mains voltage value represented by the first mains voltage digital quantity is negative, add one to the count value of the second counting unit, after determining that the mains voltage values represented by all the first mains voltage digital quantities are positive or negative, use the count value of the first counting unit as the first number of the first mains voltage cycle, and use the count value of the second counting unit as the second number of the first mains voltage cycle; in each other mains voltage cycle after the first mains voltage cycle, after adding the count value of the second mains voltage Before the voltage digital quantity replaces the mains voltage digital quantity of the previous mains voltage cycle stored in the buffer register, when the mains voltage value represented by the second mains voltage digital quantity has the same sign as the mains voltage value represented by the digital quantity of the mains voltage of the previous mains voltage cycle, the count value of the first counting unit or the count value of the second counting unit remains unchanged; when the mains voltage value represented by the second mains voltage digital quantity has different signs from the mains voltage value represented by the digital quantity of the mains voltage of the previous mains voltage cycle, if the mains voltage value represented by the second mains voltage digital quantity is a positive number, the count value of the first counting unit is increased by one, and the count value of the second counting unit is reduced by one; if the mains voltage value represented by the second mains voltage digital quantity is a negative number, the count value of the second counting unit is increased by one, and the count value of the first counting unit is reduced by one; in each other mains voltage cycle after the first mains voltage cycle, after each acquisition of the second mains voltage digital quantity, the count value of the first counting unit is used as the first number of the current mains voltage cycle, and the count value of the second counting unit is used as the second number of the current mains voltage cycle.
[0015] Through the above technical solution, in each other mains voltage cycle after the first mains voltage cycle, the first quantity and the second quantity are determined once each time a second mains voltage digital quantity is obtained, and whether there is a phase jump is determined based on the determined first quantity and second quantity, so that it is possible to timely discover whether a phase jump occurs in the mains voltage.
[0016] In one or more embodiments of the present application, the digital signal processor includes a capture unit; the capture unit is configured to capture the zero-crossing point of the mains voltage, and the zero-crossing point of the mains voltage is defined as the point where the phase angle of the mains voltage is zero degrees; the program processing unit is configured to perform the following operations: based on the zero-crossing point of the mains voltage, calculate the current mains frequency; based on the current mains frequency and the execution cycle, calculate the number of mains voltage sampling points for the next mains voltage cycle; after the end of the current mains voltage cycle, if it is determined that the mains has not undergone a phase jump, before obtaining the digital quantity of the mains voltage corresponding to the next mains voltage cycle, update the first number and the second number to half of the number of mains voltage sampling points for the next mains voltage cycle.
[0017] By calibrating the first quantity and the second quantity cycle by cycle through the above technical solution, the cumulative difference caused by the sampling deviation of the energy storage converter can be improved. In addition, the waveform of the mains voltage is not an absolutely standard sinusoidal waveform, so compared with the existing technical solution, the cycle-by-cycle calibration method is more accurate than direct sampling calculation and judgment.
[0018] In one or more embodiments of the present application, the difference threshold is set in the following manner: calculate the ratio of the set phase jump identification angle to the cycle angle; determine the difference threshold based on the product of the ratio and twice the number of AC power voltage sampling points, and the difference threshold is greater than the product.
[0019] By using the above method, the difference threshold is set based on the phase jump identification angle, so that the phase jump can be accurately identified when the phase jump angle of the mains voltage reaches the phase jump identification angle.
[0020] In one or more embodiments of the present application, the difference threshold is set in the following manner: calculating the number of first AC power voltage sampling points corresponding to the maximum frequency and the number of second AC power voltage sampling points corresponding to the minimum frequency in a preset AC power frequency protection interval; calculating the difference in number between the first number of AC power voltage sampling points and the second number of AC power voltage sampling points; determining the difference threshold based on the difference in number, and the difference threshold is greater than the difference in number.
[0021] By setting the difference threshold according to the mains frequency protection range in the above manner, the possibility of misjudging the phase jump as frequency protection can be reduced, thereby improving the accuracy of phase jump detection.
[0022] In the second aspect, an embodiment of the present application provides a method for monitoring the phase of the mains power, including: collecting the mains voltage and / or the mains frequency; converting the mains voltage into a digital quantity of the mains voltage through an analog-to-digital converter; calculating a first quantity and a second quantity through a program processing unit, defining the first quantity as the number of digital quantities of the mains voltage in the positive half-cycle waveform of the current mains voltage, and the second quantity as the number of digital quantities of the mains voltage in the negative half-cycle waveform of the current mains voltage; and determining through the program processing unit that a phase jump has occurred in the mains power based on the absolute value of the difference between the first quantity and the second quantity being greater than a difference threshold.
[0023] In one or more embodiments of the present application, calculating a first quantity and a second quantity includes: in response to the grid connection of an energy storage converter, in each mains voltage cycle, calculating the number of mains voltage sampling points in the current mains voltage cycle; obtaining a mains voltage digital quantity corresponding to the number of mains voltage sampling points to form a mains voltage digital quantity set; in the process of forming the mains voltage digital quantity set, determining the absolute value of the difference between the first quantity and the second quantity based on the obtained mains voltage digital quantity.
[0024] In one or more embodiments of the present application, the number of AC power voltage sampling points in the current AC power voltage cycle is calculated, including: calculating the AC power frequency corresponding to the current AC power voltage cycle, and taking the ratio of the inverse of the AC power frequency to the execution cycle as the number of AC power voltage sampling points in the current AC power voltage cycle, and the execution cycle is the interval time of the program loop execution in the program processing unit.
[0025] In one or more embodiments of the present application, a mains voltage digital quantity corresponding to the number of mains voltage sampling points is obtained to form a mains voltage digital quantity set, including: in the first mains voltage cycle, the first mains voltage digital quantity is obtained, starting from the first address of the buffer register, the first mains voltage digital quantity is stored in the buffer register in sequence, until all the first mains voltage digital quantities are stored in the buffer register, and the first mains voltage cycle is determined to be over, and the set consisting of all the mains voltage digital quantities stored in the buffer register is used as the first mains voltage digital quantity set corresponding to the first mains voltage cycle; in each other mains voltage cycle after the first mains voltage cycle, the second mains voltage digital quantity corresponding to the current mains voltage cycle is obtained, starting from the first address of the buffer register, the second mains voltage digital quantity is replaced with the mains voltage digital quantity of the previous mains voltage cycle stored in the buffer register, until all the second mains voltage digital quantities are stored in the buffer register, and the current mains voltage cycle is determined to be over, and the set consisting of the mains voltage digital quantities obtained by replacement in the buffer register is used as the current mains voltage digital quantity set corresponding to the current mains voltage cycle.
[0026] In one or more embodiments of the present application, based on a set of mains voltage digital quantities, determining a first quantity and a second quantity includes: before obtaining the first mains voltage digital quantity set, initializing the count values of the first counting unit and the second counting unit to 0; in the first mains voltage cycle, determining whether the mains voltage values represented by all the first mains voltage digital quantities are positive or negative, and when the mains voltage values represented by the first mains voltage digital quantities are positive, the count value of the first counting unit is increased by one, and when the mains voltage values represented by the first mains voltage digital quantities are negative, the count value of the second counting unit is increased by one, and after determining that the mains voltage values represented by all the first mains voltage digital quantities are positive or negative, the count value of the first counting unit is used as the first quantity of the first mains voltage cycle, and the count value of the second counting unit is used as the second quantity of the first mains voltage cycle; in each other mains voltage cycle after the first mains voltage cycle, replacing the second mains voltage digital quantity stored in the buffer register Before the mains voltage digital quantity of the previous mains voltage cycle, when the mains voltage value represented by the second mains voltage digital quantity has the same sign as the mains voltage value represented by the digital quantity of the mains voltage in the previous mains voltage cycle, the count value of the first counting unit or the count value of the second counting unit remains unchanged; when the mains voltage value represented by the second mains voltage digital quantity has different signs from the mains voltage value represented by the digital quantity of the mains voltage in the previous mains voltage cycle, if the mains voltage value represented by the second mains voltage digital quantity is a positive number, the count value of the first counting unit is increased by one, and the count value of the second counting unit is reduced by one; if the mains voltage value represented by the second mains voltage digital quantity is a negative number, the count value of the second counting unit is increased by one, and the count value of the first counting unit is reduced by one; for each other mains voltage cycle after the first mains voltage cycle, after each acquisition of the second mains voltage digital quantity, the count value of the first counting unit is used as the first number of the current mains voltage cycle, and the count value of the second counting unit is used as the second number of the current mains voltage cycle.
[0027] In one or more embodiments of the present application, the method also includes: capturing the zero-crossing point of the mains voltage through a capture unit, and defining the zero-crossing point of the mains voltage as a point where the phase angle of the mains voltage is zero degrees; calculating the current mains frequency based on the zero-crossing point of the mains voltage through a program processing unit; calculating the number of mains voltage sampling points for the next mains voltage cycle based on the current mains frequency and the execution cycle; after the current mains voltage cycle ends, if it is determined that no phase jump has occurred in the mains, before obtaining the digital quantity of the mains voltage corresponding to the next mains voltage cycle, updating both the first number and the second number to half of the number of mains voltage sampling points for the next mains voltage cycle.
[0028] In one or more embodiments of the present application, the difference threshold is set in the following manner: calculate the ratio of the set phase jump identification angle to the cycle angle; determine the difference threshold based on the product of the ratio and twice the number of AC power voltage sampling points, and the difference threshold is greater than the product.
[0029] In one or more embodiments of the present application, the difference threshold is set in the following manner: calculating the number of first AC power voltage sampling points corresponding to the maximum frequency and the number of second AC power voltage sampling points corresponding to the minimum frequency in a preset AC power frequency protection interval; calculating the difference in number between the first number of AC power voltage sampling points and the second number of AC power voltage sampling points; determining the difference threshold based on the difference in number, and the difference threshold is greater than the difference in number. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application.
[0031] Figure 1 is a schematic diagram of a mains voltage waveform provided in some embodiments of the present application;
[0032] Figure 2 is a schematic diagram of a mains voltage waveform provided by other embodiments of the present application;
[0033] Figure 3 is a schematic diagram of a mains phase monitoring device provided in some embodiments of the present application;
[0034] Figure 4 is a schematic diagram of a mains voltage waveform provided by other embodiments of the present application;
[0035] Figure 5 is a schematic diagram of a mains phase monitoring device provided in some other embodiments of the present application;
[0036] Figure 6 is a schematic diagram of a mains phase monitoring device provided in some other embodiments of the present application;
[0037] Figure 7 is a schematic diagram of a mains phase monitoring device provided in some other embodiments of the present application;
[0038] Figure 8 is a schematic diagram of a mains voltage waveform provided by other embodiments of the present application;
[0039] Fig. 9 is a schematic diagram of a mains phase monitoring device provided in some other embodiments of the present application;
[0040] Fig.10 It is a flowchart of a mains phase monitoring method provided in some embodiments of the present application;
[0041] Fig.11It is a schematic diagram of an electronic device provided in some embodiments of the present application. DETAILED DESCRIPTION
[0042] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the examples of the present application are provided to provide a better understanding of the present application, and the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application.
[0043] It will be understood that, herein, relational terms such as first and second, etc., are merely used to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0044] Since the impact current caused by the mains voltage phase jump is not fixed, and since the corresponding jump range of the mains frequency overlaps with the frequency protection range specified by regulatory standards, it is difficult to accurately detect the mains voltage phase jump based on the current threshold or the mains frequency range.
[0045] In order to improve the accuracy of the detection of the phase jump of the mains voltage, it is found through research that the mains is alternating current, and the waveform of the mains voltage generally has the positive and negative half-cycle characteristics of alternating current, that is, the mains voltage includes a positive half-cycle and a negative half-cycle in one voltage cycle. When the mains voltage is stable and there is no abnormality, the voltage waveform of the positive half-cycle is symmetrical with the voltage waveform of the negative half-cycle, such as Figure 1 As shown, t represents time and U represents the mains voltage. When the mains voltage has a phase jump, the waveform of the mains voltage will change, and the waveform of the positive half cycle and the waveform of the negative half cycle will no longer be symmetrical, and there will be obvious deviations. Figure 2 As shown in the figure, there is no voltage phase jump in a mains voltage cycle composed of 0-D, and the waveform of the positive half cycle is symmetrical with the waveform of the negative half cycle. In a mains voltage cycle composed of BF, it can be seen that the mains voltage has a phase jump at position E. Figure 2 It can be seen that in the voltage cycle composed of BF, the waveform of the positive half cycle and the waveform of the negative half cycle are no longer symmetrical, and the waveform of the negative half cycle is significantly more than the waveform of the positive half cycle. Based on this, the embodiment of the present application provides a mains phase monitoring device and method, which monitors the phase of the mains voltage based on the waveform of the mains voltage to determine whether there is a mains voltage phase jump.
[0046] The following first describes the mains phase monitoring device provided in the embodiment of the present application.
[0047] See also Figure 3, is a schematic diagram of a mains phase monitoring device provided in some embodiments of the present application, such as Figure 3 As shown, the mains phase monitoring device includes a control board 30, the control board 30 includes a digital signal processor 31, and the digital signal processor 31 includes an IO pin 311, an analog-to-digital converter 312, and a program processing unit 313. Among them, the IO pin 311 is connected to the mains, and is used to introduce the mains into the digital signal processor 31, so that the digital signal processor 31 can collect the mains voltage and / or the mains frequency of the mains, and the analog-to-digital converter 312 is connected to the IO pin 311, and is used to convert the collected mains voltage into an ADC value, that is, a digital quantity of the mains voltage, because the waveform of the mains voltage is drawn according to a certain digital quantity of the mains voltage, for example Figure 4 As shown, according to multiple mains voltage digital quantities, the following Figure 4 The mains voltage waveform diagram shown, based on this, in the present embodiment, the mains voltage is converted into a mains voltage digital quantity to facilitate determining the waveform of the mains voltage. The program processing unit 313 is connected to the analog-to-digital converter 312, for determining whether the waveform of the current mains voltage changes significantly based on the mains voltage digital quantity, such as whether the difference between the positive half-cycle waveform and the negative half-cycle waveform of the current mains voltage is large, thereby determining whether the mains voltage has a phase jump. As an example of the present application, the digital signal processor 31 is a DSP (Digital Signal Processing) chip.
[0048] The mains phase monitoring device provided in the embodiment of the present application is integrated in an energy storage converter for use. For the convenience of description, the following description is made by taking the mains phase monitoring device provided in the embodiment of the present application as an example of being integrated in an energy storage converter for use.
[0049] In some embodiments of the present application, the control board 30 is an embedded control circuit board in the energy storage inverter. For example, the control board 30 is a circuit board embedded in the energy storage inverter for performing control and data processing.
[0050] In some embodiments of the present application, the IO pin 311 is connected to the mains through a power circuit board in the energy storage converter, and the power circuit board integrates power devices, such as insulated gate bipolar transistors IGBT and silicon carbide devices, etc. These devices can efficiently perform power conversion to ensure the efficiency and stability of energy conversion. In this way, the digital signal processor 31 obtains the mains voltage and mains frequency from the power circuit board through the IO pin 311.
[0051] In some embodiments of the present application, the program processing unit 313 includes program codes set using the TI coding tool CCS (Code Composer Studio, code debugger).
[0052] During the AC power phase monitoring process, the digital signal processor 31 is connected to the AC power through the I0 pin 311, and the AC power voltage obtained through the I0 pin 311 is converted into a digital quantity of the AC power voltage through the analog-to-digital converter 312. Then, the program processing unit 313 runs the program code configured therein to detect whether the AC power voltage has a phase jump based on the digital quantity of the AC power voltage.
[0053] In this embodiment, based on the characteristic that when the mains voltage undergoes a phase jump, the waveform of the mains voltage will change, and the waveform of the positive half-cycle and the waveform of the negative half-cycle will no longer be symmetrical, in the mains phase monitoring process, the program processing unit 313 calculates the first quantity and the second quantity according to the mains voltage digital quantity, wherein the first quantity is the number of the mains voltage digital quantity in the positive half-cycle waveform diagram of the current mains voltage, and the second quantity is the number of the mains voltage digital quantity in the negative half-cycle waveform diagram of the current mains voltage, and the first quantity and the second quantity are compared. If the absolute value of the difference between the first quantity and the second quantity is greater than the difference threshold, it means that there is a large difference between the positive half-cycle and waveform of the current mains voltage and the waveform of the negative half-cycle, and then it is determined that the mains voltage undergoes a phase jump. Wherein, the difference threshold is a positive integer set according to actual conditions or artificially, for example, the difference threshold is set based on the phase change recognition angle.
[0054] Through the above technical solution, based on the characteristic that the waveform of the mains voltage will change significantly when the mains voltage undergoes a phase jump, the mains voltage digital quantity is sampled in real time, and the number of sampling points and the difference of the mains voltage digital quantity in the positive and negative half cycles of the current mains voltage are calculated and compared based on the mains voltage digital quantity, to determine whether the waveform of the mains voltage has changed significantly, and then determine whether the mains voltage has undergone a phase jump. In this way, there is no need to determine the current threshold, nor to compare the mains frequency, thereby reducing the misjudgment caused by inaccurate current threshold or confusion between the frequency protection area and the mains frequency interval corresponding to the phase jump, improving the accuracy of the detection of the mains voltage phase jump, and facilitating the timely formulation of accurate and effective response plans when the mains voltage phase jump occurs, thereby extending the service life of equipment such as energy storage inverters.
[0055] In some embodiments of the present application, the program processing unit 313 collects the mains voltage digital quantity to detect the mains voltage phase jump in each mains voltage cycle after the energy storage converter is connected to the grid. Based on this, the program processing unit 313 responds to the energy storage converter being connected to the grid, and in each mains voltage cycle, calculates the number of mains voltage sampling points in the current mains voltage cycle, obtains the mains voltage digital quantity corresponding to the number of mains voltage sampling points, thereby forming a mains voltage digital quantity set corresponding to the current mains voltage cycle; in the process of forming the mains voltage digital quantity set, the first quantity and the second quantity corresponding to the current mains voltage cycle are determined based on the obtained mains voltage quantity. Among them, the number of mains voltage sampling points in the mains voltage cycle is the number of mains voltage digital quantities required to draw the voltage waveform corresponding to the mains voltage cycle.
[0056] Through the above technical solution, the corresponding first quantity and second quantity can be determined in each mains voltage cycle, so as to realize the real-time detection of voltage phase jump in each mains voltage cycle.
[0057] In some embodiments of the present application, Figure 5 As shown, the digital signal processor 31 includes a program interrupt timing unit 314. For each mains voltage cycle, the ratio of the time length corresponding to the current mains voltage cycle and the time required to collect a digital quantity of the mains voltage is used as the number of mains voltage sampling points in the current mains voltage cycle. Among them, the time length corresponding to the current mains voltage cycle is the inverse of the mains frequency corresponding to the current mains voltage cycle, and the time required to collect a digital quantity of the mains voltage is set by the program interrupt timing unit 314. The program interrupt timing unit 314 is used to control the execution cycle of the program processing unit 313. The execution cycle is the interval time of the program loop execution. The program collects a digital quantity of the mains voltage every time it is executed in a loop. Therefore, the execution cycle also represents the time required to collect a digital quantity of the mains voltage. Based on this, the time length corresponding to the mains voltage cycle is recorded as F represents the mains frequency corresponding to the current mains voltage cycle, and the execution cycle is G. Then the number of mains voltage sampling points C in the current mains voltage cycle is calculated by the following formula (1):
[0058]
[0059] In some embodiments of the present application, the program interrupt timing unit 314 is set using the TI coding tool CCS.
[0060] Through the above-mentioned technical scheme, in each mains voltage cycle, the number of mains voltage sampling points in the mains voltage cycle is determined according to the mains frequency of the mains voltage cycle and the program execution cycle, so that the number of mains voltage sampling points can change with the change of the mains frequency. In this way, when the mains frequency fluctuates, the number of mains voltage sampling points in the mains voltage cycle can be accurately determined, so as to accurately obtain the mains voltage digital quantity set corresponding to the mains voltage cycle, improve the accuracy of the first number and the second number, and then improve the accuracy of the mains voltage phase jump detection.
[0061] In some embodiments of the present application, in order to accurately determine the mains voltage digital quantity set corresponding to each mains voltage cycle, such as Figure 6 As shown, the digital signal processor 31 includes a buffer register 315, and the buffer register 315 is used to store the mains voltage digital quantity corresponding to the current mains voltage cycle in each mains voltage cycle. Wherein, in order to make the storage space of the buffer register 315 sufficient to store the mains voltage digital quantity corresponding to each mains voltage cycle, the length of the buffer register 315 is greater than or equal to the number of mains voltage sampling points in each mains voltage cycle.
[0062] In some embodiments of the present application, considering that when the AC power frequency is not within the AC power frequency protection interval specified by the regulatory standards, the energy storage inverter will trigger frequency protection and perform off-grid protection. Therefore, when detecting the phase jump, it is sufficient to detect the AC power voltage cycle within the AC power frequency protection interval. According to the above formula (1), the larger the AC power frequency F, the smaller the number of AC power voltage sampling points C, and the smaller the AC power frequency F, the larger the number of AC power voltage sampling points C. Therefore, in order to make the length of the buffer register 315 greater than or equal to the number of AC power voltage sampling points in each AC power voltage cycle, the number of AC power voltage sampling points calculated based on the minimum frequency in the AC power frequency protection interval is used as the length of the buffer register 315.
[0063] For example, the mains frequency protection interval specified by relevant regulations and standards is [47.5Hz, 51.5Hz]. If the mains frequency exceeds this interval, an alarm signal will be output, triggering frequency protection and disconnecting the energy storage converter from the grid. Therefore, when detecting phase jumps, it is sufficient to detect the mains voltage cycle with a mains frequency within [47.5Hz, 51.5Hz]. Based on this, the minimum frequency value of 47.5Hz in [47.5Hz, 51.5Hz] is substituted into formula (1) as the value of F, thereby obtaining the number of mains voltage sampling points corresponding to 47.5Hz. The number of sampling points of the mains voltage As the length of the buffer register 315.
[0064] Through the above technical solution, in each mains voltage cycle, the buffer register 315 is used to store the mains voltage digital quantity corresponding to the current mains voltage cycle, thereby reducing confusion with the mains voltage digital quantities corresponding to other mains voltage cycles, and improving the accuracy of the mains voltage digital quantity set corresponding to the current mains voltage cycle, thereby improving the accuracy of detecting whether the mains voltage jumps within the current mains voltage cycle.
[0065] In some embodiments of the present application, when the digital signal processor 31 includes a buffer register 315, when the energy storage inverter is connected to the grid for the first time, the buffer register 315 is initialized so that there is no data in the buffer register 315, and the index value of the buffer register 315 is pointed to the first address of the buffer register 315.
[0066] Based on this, after the energy storage converter is connected to the grid, when obtaining the mains voltage digital quantity set corresponding to the first mains voltage cycle, the first mains voltage digital quantity in the first mains voltage cycle is obtained, and each time a first mains voltage digital quantity is obtained, the first mains voltage digital quantity obtained is stored once. When storing, starting from the first address of the buffer register 315, the first mains voltage digital quantity obtained each time is sequentially stored in the buffer register 315, and each time a first mains voltage digital quantity is stored, the index value of the buffer register 315 is increased by 1 until all the first mains voltage digital quantities are stored in the buffer register 315, and the first mains voltage cycle is determined to be over. At this time, the set composed of all the mains voltage digital quantities stored in the buffer register 315 is used as the first mains voltage digital quantity set corresponding to the first mains voltage cycle. It can be understood that in the first mains voltage cycle, the buffer register stores the last first mains voltage digital quantity at the first last address of the buffer register, that is, the number of mains voltage digital quantities stored between the first address and the first last address of the buffer register is consistent with the number of mains voltage sampling points corresponding to the first mains voltage cycle.
[0067] When obtaining the mains voltage digital quantity set corresponding to each other mains voltage cycle after the first mains voltage cycle, obtain the second mains voltage digital quantity corresponding to the current mains voltage cycle, and replace the mains voltage digital quantity of the previous mains voltage cycle stored in the buffer register with the second mains voltage digital quantity starting from the first address of the buffer register, until all the second mains voltage digital quantities are stored in the buffer register, and determine that the current mains voltage cycle ends. At this time, the set of mains voltage digital quantities obtained by replacement in the buffer register is used as the current mains voltage digital quantity set corresponding to the current mains voltage cycle. It can be understood that in the current mains voltage cycle outside the first mains voltage cycle, the first second mains voltage digital quantity replaces the mains voltage digital quantity of the previous mains voltage cycle stored at the first address of the buffer register, until the last second mains voltage digital quantity replaces the mains voltage digital quantity of the previous mains voltage cycle stored at the second last address of the buffer register, at which time the number of mains voltage digital quantities stored between the first address and the second last address of the buffer register is consistent with the number of mains voltage sampling points corresponding to the current mains voltage cycle.
[0068] In this way, the number of mains voltage sampling points in each mains voltage cycle can be stored, which is convenient for further calculating the difference between the number of sampling points in the positive and negative half cycles of each mains voltage cycle, and then judging whether the mains voltage has a phase jump.
[0069] In some embodiments of the present application, in order to facilitate determination of the first quantity and the second quantity, such as Figure 7 As shown, the digital signal processor 31 also includes a first counting unit 316 and a second counting unit 317. The first counting unit 316 is used to calculate the first quantity, and the second counting unit 317 is used to calculate the second quantity. Before obtaining the first mains voltage digital quantity set, the count values of the first counting unit 316 and the second counting unit 317 are initialized to 0 by the program processing unit 313.
[0070] In each mains voltage cycle, in the process of forming the corresponding mains voltage digital quantity set, the first counting unit 316 and the second counting unit 317 calculate the first quantity and the second quantity according to the positive and negative of the mains voltage value represented by the mains voltage sampling value obtained in the current mains voltage cycle.
[0071] Specifically, in the first mains voltage cycle, each time a first mains voltage digital quantity is obtained, before the obtained first mains voltage digital quantity is stored in the buffer register 315, it is determined whether the mains voltage value represented by the first mains voltage digital quantity is positive or negative. When the mains voltage value represented by the first mains voltage digital quantity is a positive number, the count value of the first counting unit 316 is increased by one; when the mains voltage value represented by the first mains voltage digital quantity is a negative number, the count value of the second counting unit is increased by one, and so on, until all the first mains voltages are stored in the buffer register, that is, it is determined whether the mains voltage value represented by the first mains voltage digital quantity is positive or negative, and the count value of the first counting unit is used as the first quantity of the first mains voltage cycle, and the count value of the second counting unit is used as the second quantity of the first mains voltage cycle.
[0072] In each other mains voltage cycle after the first mains voltage cycle, each time a second mains voltage digital quantity is obtained, before the second mains voltage digital quantity replaces the mains voltage digital quantity of the previous mains voltage cycle stored in the buffer register 315, it is determined whether the mains voltage value represented by the second mains voltage digital quantity is of the same sign as the mains voltage value represented by the mains voltage digital quantity of the previous mains voltage cycle to be replaced, and the mains voltage value represented by the second mains voltage digital quantity is the same as the mains voltage value represented by the mains voltage digital quantity of the previous mains voltage cycle to be replaced. When the voltage values have the same sign, the count value of the first counting unit or the count value of the second counting unit remains unchanged; when the mains voltage value represented by the second mains voltage digital quantity and the mains voltage value represented by the digital quantity of the mains voltage of the previous mains voltage cycle to be replaced have different signs, if the mains voltage value represented by the second mains voltage digital quantity is a positive number, the count value of the first counting unit is increased by one, and the count value of the second counting unit is reduced by one; if the mains voltage value represented by the second mains voltage digital quantity is a negative number, the count value of the second counting unit is increased by one, and the count value of the first counting unit is reduced by one.
[0073] Because the phase jump may occur at any position of the mains voltage cycle, in order to promptly detect the phase jump, in each other mains voltage cycle after the first mains voltage cycle, a sliding detection method is used to detect whether there is a phase jump. Specifically, after obtaining a second mains voltage digital quantity each time, the count value of the first counting unit updated based on the obtained second mains voltage digital quantity is used as the first quantity of the current mains voltage cycle, and the count value of the second counting unit is used as the second quantity of the current mains voltage cycle. In this way, in each other mains voltage cycle after the first mains voltage cycle, a group of first quantity and second quantity are determined every other execution cycle, and whether the mains voltage has a phase jump is detected based on the determined first quantity and second quantity, thereby realizing a sliding detection that detects once every execution cycle, which is conducive to timely detection of phase jumps.
[0074] As an example of the present application, it is assumed that the mains frequency corresponding to each mains voltage cycle is consistent, and the number of mains voltage sampling points in each mains voltage cycle is M. Figure 2 As shown, the time interval 0-D represents the first mains voltage cycle, and the second mains voltage cycle is carried out after D. During the mains voltage cycle 0-D, M mains voltage digital quantities are obtained and stored in the buffer register 315. After the first mains voltage cycle, M mains voltage digital quantities have been stored in the buffer register 315. Therefore, after time D, each time a mains voltage digital quantity is obtained, the obtained mains voltage digital quantity and the other M-1 mains voltage digital quantities in the buffer register 315 except the mains voltage digital quantity that needs to be replaced are combined to form M mains voltage digital quantities. These M mains voltage digital quantities are regarded as a mains voltage set corresponding to a virtual mains voltage cycle. Based on the mains voltage set corresponding to the virtual mains voltage cycle, a set of first quantity and second quantity are determined, and whether there is a phase jump is determined based on the first quantity and the second quantity. For example, as Figure 2 As shown, through the above method, a set of first quantity and second quantity are determined at moments D, E, and F respectively, and at moment F, the time interval BF is regarded as a virtual mains voltage cycle. As shown in the figure, the mains voltage undergoes a phase jump at moment E, so that at moment F, it is determined that the absolute value of the difference between the first quantity and the second quantity is greater than the difference threshold, thereby determining that the mains voltage undergoes a phase jump at moment F. If the judgment is made after the mains voltage set corresponding to the second mains voltage cycle is obtained, it will take some time after moment F to identify the mains voltage phase jump, and the time for discovering the phase jump will be later than moment F. Therefore, the phase jump can be discovered in time through the above sliding detection method.
[0075] It is understandable that the above is only explained by taking the case where the mains frequency corresponding to each mains voltage cycle is consistent as an example. If the mains frequency corresponding to each mains voltage cycle has a small fluctuation, the above solution is also applicable.
[0076] Through the above technical solution, in each other mains voltage cycle after the first mains voltage cycle, the first quantity and the second quantity are determined once each time a second mains voltage digital quantity is obtained, and whether there is a phase jump is determined based on the determined first quantity and second quantity, so that it is possible to timely discover whether a phase jump occurs in the mains voltage.
[0077] In some embodiments of the present application, in actual working conditions, due to the zero drift of the hardware sampling of the energy storage converter, the sampling of the mains voltage may be biased, such as inaccurate sampling of the zero crossing point at the junction of the positive and negative half cycles, such as Figure 8 As shown in the figure, in the absence of zero drift, the zero crossing point of the mains voltage is on the zero axis, that is, on the t axis. However, due to the existence of zero drift, the zero crossing point of the mains voltage actually collected is on Figure 8 On the dotted axis in Figure 8 It can be seen that the voltage zero-crossing point gradually shifts from the zero axis. In view of this, in order to improve the accuracy of the detection, for each mains voltage cycle, after the mains voltage cycle ends, the first quantity and the second quantity are corrected based on the corresponding mains voltage set, so that the judgment of each mains voltage cycle is accumulated from the same baseline, that is, the zero axis. In order to achieve the correction of the first quantity and the second quantity, as shown in FIG. Fig. 9 As shown, the digital signal processor 31 includes a capture unit 318. The capture unit 318 is connected to the IO pin 311, and is used to capture the zero crossing point of the mains voltage based on the frequency of the mains voltage, and the zero crossing point of the mains voltage refers to the point where the phase angle of the mains voltage is zero degrees. Wherein, the capture unit 318 includes but is not limited to ECAP (Enhanced Capture, adding a capture module).
[0078] Based on this, for each mains voltage cycle, the program processing unit 313 calculates the current mains frequency based on the zero-crossing point of the mains voltage captured by the capture unit 318; calculates the number of mains voltage sampling points of the next mains voltage cycle based on the current mains frequency and the execution cycle; after the current mains voltage cycle ends, when it is determined that the mains power has not undergone a phase jump, before obtaining the digital quantity of the mains voltage corresponding to the next mains voltage cycle, the first number and the second number are both updated to half of the number of mains voltage sampling points of the next mains voltage cycle.
[0079] Through the above technical solution, the first quantity and the second quantity are calibrated periodically, which can improve the cumulative difference effect caused by the sampling deviation of the energy storage converter. In addition, the real mains power is not an absolutely standard sine waveform, so compared with the existing technical solution, the cycle-by-cycle calibration method is more accurate than direct sampling calculation and judgment.
[0080] In some embodiments of the present application, since the phase jump of the mains voltage may occur at any angle, but not all phase jumps at all angles need to be protected. If the angle of the phase jump is small, the impact on the operation of the equipment is small, and no protection is required. Therefore, in practical applications, the phase jump angle that needs to be protected can be set according to actual needs, and the angle is used as the phase jump identification angle. When the angle of the phase jump of the mains voltage reaches or exceeds the phase jump identification angle, it is determined that the mains voltage phase jump occurs. In this way, the frequent detection of phase jump protection caused by the frequent triggering of phase jumps can be reduced, thereby ensuring the smooth operation of equipment such as energy storage converters. Based on this, the difference threshold is set according to the phase jump identification angle. Specifically, the ratio of the set phase jump identification angle to the circumference is calculated, and the difference threshold is determined according to the product of the ratio and 2 times the number of mains voltage sampling points, and the difference threshold is greater than the product. Wherein, the circumference is 360°.
[0081] For example, take the case where it is necessary to perform off-grid protection when the phase of the mains voltage changes by 180°. Figure 2 As shown, the mains frequency is 50Hz, the program running speed is 20kHz, and at the mains frequency of 50Hz, the number of mains voltage sampling points required is C = (1 / 50)ms / (1 / 20000)ms = 400. In theory, there are 200 sampling points in the positive and negative half cycles, that is, when the mains is normal, the first number of the positive half cycle of the mains voltage and the second number of the negative half cycle of the mains voltage are both 200. If the mains voltage jumps at the peak of the positive half cycle, that is, at the 90° position, 0-D The AC power is normal during the time interval. According to the sliding detection, the AC power is also normal during the time interval AE. When moving to the right from moment E, when moving close to moment F but not reaching moment F, the program still saves and records the number of AC power voltage sampling points of 50Hz. At this time, the difference between the positive and negative half-cycle sampling points, that is, the absolute value of the difference between the first number and the second number, is approximately |(200+(200 / 2)-(200 / 2)|=200. Therefore, the difference threshold needs to be set to be greater than about 200 so that a phase jump can be detected at this angle.
[0082] By using the above method, the difference threshold is set based on the phase jump identification angle, so that the phase jump can be accurately identified when the phase jump angle of the mains voltage reaches the phase jump identification angle.
[0083] In some embodiments of the present application, the reasonable setting difference threshold value can also reduce the misjudgment of phase jump as frequency protection, and improve the accuracy of phase jump detection. In view of this, in addition to setting the difference threshold value based on the phase jump identification angle, the difference threshold value can be set in combination with the running speed set by the program and the mains frequency protection interval required by the regulatory standards. The running speed specified by the program is the inverse of the program execution cycle. Specifically, after setting the running speed of the program, considering the frequency protection range, according to formula (1), the first mains voltage sampling point number corresponding to the maximum frequency in the mains frequency protection interval and the second mains voltage sampling point number corresponding to the minimum frequency are calculated, and the number difference between the first mains voltage sampling point number and the second mains voltage sampling point number is calculated. The number difference is used as the misjudgment lower limit. If the difference threshold value is greater than the number difference, it can be avoided that the energy storage converter is misjudged as the mains voltage jump due to the normal fluctuation of the mains frequency, so the difference threshold value is set according to the number difference to ensure that the difference threshold value is greater than the number difference.
[0084] For example, if the program running speed is set to 20kHz, at the nominal mains frequency of 50Hz, (1 / 50)ms / (1 / 20000)ms = 400 mains voltage sampling points are required. Theoretically, when the mains is normal, the number of mains voltage sampling points in the positive and negative half cycles is 200 each. Considering that the Italian grid-connected regulation standard CEI 0-21 2022 sets the mains frequency protection interval for energy storage inverters to [47.5Hz, 51.5Hz], if the mains frequency exceeds this interval, an alarm signal will be output to trigger frequency protection. Among them, 47.5Hz is the minimum frequency for triggering frequency protection, and the corresponding number of sampling points of the second mains voltage is 421. 51.5Hz is the maximum frequency for triggering frequency protection, and the corresponding number of sampling points of the first mains voltage is 388. The difference between the two is (421-388)=33. Taking 33 as the lower limit of misjudgment, considering the actual sampling deviation, the lower limit of misjudgment can be appropriately increased, thereby reducing the possibility of misjudging phase jump as frequency protection.
[0085] Through the above technical solution, the difference threshold is set according to the mains frequency protection range, which can reduce the possibility of misjudging the phase jump as frequency protection and improve the accuracy of phase jump detection.
[0086] Based on the mains phase monitoring device provided in the above embodiment, the present application also provides a specific implementation of the mains phase monitoring method. Please refer to the following embodiments.
[0087] See also Fig.10 , is a flow chart of a method for monitoring the mains phase provided in an embodiment of the present application, such as Fig.10 As shown, the method includes the following steps S101-S104.
[0088] S101. Collecting the mains voltage and / or mains frequency;
[0089] S102. Convert the mains voltage into a digital quantity of the mains voltage through an analog-to-digital converter;
[0090] S103. By means of a program processing unit, a first quantity and a second quantity are calculated, and the first quantity is defined as the quantity of the digital quantity of the mains voltage in the positive half-cycle waveform of the current mains voltage, and the second quantity is the quantity of the digital quantity of the mains voltage in the negative half-cycle waveform of the current mains voltage;
[0091] S104. Determine, through the program processing unit, that a phase jump occurs in the mains power based on the absolute value of the difference between the first quantity and the second quantity being greater than a difference threshold.
[0092] Through the above technical solution, based on the characteristic that the waveform of the mains voltage changes significantly when the mains voltage undergoes a phase jump, the mains voltage digital quantity is sampled in real time, and the number of sampling points and the difference of the mains voltage digital quantity in the positive and negative half cycles of the current mains voltage are calculated and compared based on the mains voltage digital quantity, so as to judge whether the waveform of the mains voltage has changed significantly, and then determine whether the mains voltage has undergone a phase jump. In this way, there is no need to determine the current threshold, nor to compare the mains frequency, which can reduce the misjudgment caused by inaccurate current threshold or confusion between the frequency protection area and the mains frequency interval corresponding to the phase jump, improve the accuracy of the mains voltage phase jump detection, and facilitate the timely formulation of response plans when the mains voltage undergoes a phase jump, thereby extending the service life of equipment such as energy storage inverters.
[0093] In some embodiments of the present application, calculating the first quantity and the second quantity includes:
[0094] In response to the energy storage converter being connected to the grid, in each mains voltage cycle, the number of mains voltage sampling points in the current mains voltage cycle is calculated;
[0095] Obtaining a mains voltage digital quantity corresponding to the number of mains voltage sampling points to form a mains voltage digital quantity set;
[0096] In the process of forming the mains voltage digital quantity set, the absolute value of the difference between the first quantity and the second quantity is determined based on the acquired mains voltage digital quantity.
[0097] Through the above technical solution, the corresponding first quantity and second quantity can be determined in each mains voltage cycle, so as to realize the real-time detection of voltage phase jump in each mains voltage cycle.
[0098] In some embodiments of the present application, calculating the number of mains voltage sampling points in the current mains voltage cycle includes:
[0099] The mains frequency corresponding to the current mains voltage cycle is calculated, and the ratio of the inverse of the mains frequency to the execution cycle is used as the number of mains voltage sampling points in the current mains voltage cycle. The execution cycle is the interval time of program loop execution in the program processing unit.
[0100] Through the above-mentioned technical scheme, in each mains voltage cycle, the number of mains voltage sampling points in the mains voltage cycle is determined according to the mains frequency of the mains voltage cycle and the program execution cycle, so that the number of mains voltage sampling points can change with the change of the mains frequency. In this way, when the mains frequency fluctuates, the number of mains voltage sampling points in the mains voltage cycle can also be accurately determined, so as to accurately obtain the mains voltage digital quantity set corresponding to the mains voltage cycle, improve the accuracy of the first number and the second number, and then improve the accuracy of phase jump detection.
[0101] In some embodiments of the present application, obtaining a mains voltage digital quantity corresponding to the number of mains voltage sampling points to form a mains voltage digital quantity set includes:
[0102] In the first mains voltage cycle, obtain the first mains voltage digital quantity, and start from the first address of the buffer register, store the first mains voltage digital quantity into the buffer register in sequence until all the first mains voltage digital quantities are stored in the buffer register, determine that the first mains voltage cycle is over, and use the set composed of all the mains voltage digital quantities stored in the buffer register as the first mains voltage digital quantity set corresponding to the first mains voltage cycle;
[0103] In each other mains voltage cycle after the first mains voltage cycle, obtain a second mains voltage digital quantity corresponding to the current mains voltage cycle, and starting from the first address of the buffer register, replace the mains voltage digital quantity of the previous mains voltage cycle stored in the buffer register with the second mains voltage digital quantity until all the second mains voltage digital quantities are stored in the buffer register, determine that the current mains voltage cycle ends, and use the set of mains voltage digital quantities obtained by replacement in the buffer register as the current mains voltage digital quantity set corresponding to the current mains voltage cycle.
[0104] In this way, the number of mains voltage sampling points in each mains voltage cycle can be stored, which is convenient for further calculating the difference between the number of sampling points in the positive and negative half cycles of each mains voltage cycle, and then judging whether the mains voltage has a phase jump.
[0105] In some embodiments of the present application, determining the first quantity and the second quantity based on the mains voltage digital quantity set includes:
[0106] Before acquiring the first mains voltage digital quantity set, initializing the count values of the first counting unit and the second counting unit to 0;
[0107] In the first mains voltage cycle, determine whether all the first mains voltage digital quantities representing the mains voltage values are positive or negative, and when the first mains voltage digital quantity representing the mains voltage value is positive, add one to the count value of the first counting unit, and when the first mains voltage digital quantity representing the mains voltage value is negative, add one to the count value of the second counting unit, and after determining that all the first mains voltage digital quantities representing the mains voltage values are positive or negative, use the count value of the first counting unit as the first quantity of the first mains voltage cycle, and use the count value of the second counting unit as the second quantity of the first mains voltage cycle;
[0108] In each other mains voltage cycle after the first mains voltage cycle, before replacing the mains voltage digital quantity of the previous mains voltage cycle stored in the buffer register with the second mains voltage digital quantity, when the mains voltage value represented by the second mains voltage digital quantity and the mains voltage value represented by the mains voltage digital quantity of the previous mains voltage cycle have the same sign, the count value of the first counting unit or the count value of the second counting unit remains unchanged; when the mains voltage value represented by the second mains voltage digital quantity and the mains voltage value represented by the mains voltage digital quantity of the previous mains voltage cycle have different signs, if the mains voltage value represented by the second mains voltage digital quantity is a positive number, the count value of the first counting unit is increased by one, and the count value of the second counting unit is reduced by one; if the mains voltage value represented by the second mains voltage digital quantity is a negative number, the count value of the second counting unit is increased by one, and the count value of the first counting unit is reduced by one;
[0109] In each other mains voltage cycle after the first mains voltage cycle, after each acquisition of the second mains voltage digital quantity, the count value of the first counting unit is used as the first number of the current mains voltage cycle, and the count value of the second counting unit is used as the second number of the current mains voltage cycle.
[0110] Through the above technical solution, in each other mains voltage cycle after the first mains voltage cycle, the first quantity and the second quantity are determined once each time a second mains voltage digital quantity is obtained, and whether there is a phase jump is determined based on the determined first quantity and second quantity, so that it is possible to timely discover whether a phase jump occurs in the mains voltage.
[0111] In some embodiments of the present application, the mains phase monitoring method further includes:
[0112] The zero-crossing point of the mains voltage is captured by the capture unit, and the zero-crossing point of the mains voltage is defined as a point where the phase angle of the mains voltage is zero degree;
[0113] Calculate the current mains frequency based on the zero-crossing point of the mains voltage through the program processing unit;
[0114] Based on the current mains frequency and execution cycle, the number of mains voltage sampling points of the next mains voltage cycle is calculated;
[0115] After the current mains voltage cycle ends, if it is determined that the mains power has no phase jump, before obtaining the mains voltage digital quantity corresponding to the next mains voltage cycle, the first number and the second number are both updated to half of the number of mains voltage sampling points of the next mains voltage cycle.
[0116] By calibrating the first quantity and the second quantity cycle by cycle through the above technical solution, the cumulative difference caused by the sampling deviation of the energy storage converter can be improved. In addition, the waveform of the mains voltage is not an absolutely standard sinusoidal waveform, so compared with the existing technical solution, the cycle-by-cycle calibration method is more accurate than direct sampling calculation and judgment.
[0117] In some embodiments of the present application, the difference threshold is set in the following manner:
[0118] Calculate the ratio of the set phase jump recognition angle to the circumference angle;
[0119] The difference threshold is determined according to the product of the ratio and twice the number of mains voltage sampling points, and the difference threshold is greater than the product.
[0120] By using the above method, the difference threshold is set based on the phase jump identification angle, so that the phase jump can be accurately identified when the phase jump angle of the mains voltage reaches the phase jump identification angle.
[0121] In some embodiments of the present application, the difference threshold is set in the following manner:
[0122] Calculate the number of first mains voltage sampling points corresponding to the maximum frequency and the number of second mains voltage sampling points corresponding to the minimum frequency in the preset mains frequency protection interval;
[0123] Calculate the difference between the number of first mains voltage sampling points and the number of second mains voltage sampling points;
[0124] A difference threshold is determined according to the quantity difference, and the difference threshold is greater than the quantity difference.
[0125] By setting the difference threshold according to the mains frequency protection range in the above manner, the possibility of misjudging the phase jump as frequency protection can be reduced, thereby improving the accuracy of phase jump detection.
[0126] The implementation principle of each step in the mains phase monitoring method provided in the embodiment of the present application is shown in Figures 3 to 9 To avoid repetition, the relevant description of the device embodiment will not be repeated here.
[0127] Fig.11A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application is shown.
[0128] The electronic device 1100 includes a processor 1101 and a memory 1102 storing computer program instructions.
[0129] Specifically, the processor 1101 includes a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or is configured to implement one or more integrated circuits of the embodiments of the present application.
[0130] The memory 1102 includes a large capacity memory for data or instructions. By way of example and not limitation, the memory 1102 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 1102 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 1102 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 1102 is a non-volatile solid-state memory. The memory 1102 may include a read-only memory (ROM), a random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Therefore, typically, the memory 1102 includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it can perform the operations described in any one of the mains phase monitoring methods in the above-mentioned embodiments.
[0131] The processor 1101 implements any one of the mains phase monitoring methods in the above embodiments by reading and executing computer program instructions stored in the memory 1102 .
[0132] In one example, the electronic device may further include a communication interface 1103 and a bus 910. Fig.11 As shown, the processor 1101, the memory 1102, and the communication interface 1103 are connected via a bus 1110 and communicate with each other.
[0133] The communication interface 1103 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0134] Bus 1110 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 1110 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0135] In addition, in combination with the mains phase monitoring method in the above embodiment, the embodiment of the present application can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the mains phase monitoring methods in the above embodiment is implemented.
[0136] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0137] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0138] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0139] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0140] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
Claims
1. A mains phase monitoring device, characterized in that: include: a control board including a digital signal processor; The digital signal processor comprises an IO pin, and the IO pin is configured to collect a mains voltage and / or a mains frequency; The digital signal processor comprises an analog-to-digital converter and a program processing unit, wherein the analog-to-digital converter is configured to convert the mains voltage into a mains voltage digital quantity; The program processing unit is configured to perform the following operations: Calculate a first quantity and a second quantity, define the first quantity as the quantity of the digital quantity of the mains voltage in the positive half-cycle waveform of the current mains voltage, and define the second quantity as the quantity of the digital quantity of the mains voltage in the negative half-cycle waveform of the current mains voltage; Based on the absolute value of the difference between the first number and the second number being greater than a difference threshold, it is determined that a phase jump occurs in the mains voltage.
2. The device according to claim 1, characterized in that The calculating the first quantity and the second quantity comprises: In response to the energy storage converter being connected to the grid, in each mains voltage cycle, the number of mains voltage sampling points in the current mains voltage cycle is calculated; Acquire a mains voltage digital quantity corresponding to the number of mains voltage sampling points to form a mains voltage digital quantity set; In the process of forming the mains voltage digital quantity set, the first quantity and the second quantity are determined based on the acquired mains voltage digital quantity.
3. The device according to claim 2, characterized in that The digital signal processor includes a program interrupt timing unit; The program interrupt timing unit is used to control the execution cycle of the program processing unit, and the execution cycle is the interval time of the program cyclic execution; The calculating the number of mains voltage sampling points in the current mains voltage cycle includes: The mains frequency corresponding to the current mains voltage cycle is calculated, and the ratio of the inverse of the mains frequency to the execution cycle is used as the number of mains voltage sampling points in the current mains voltage cycle.
4. The device according to claim 2 or 3, characterized in that The digital signal processor comprises a buffer register, and the buffer register is configured to store the digital quantity of the mains voltage in the current mains voltage cycle; The length of the buffer register is greater than or equal to the number of mains voltage sampling points in the current mains voltage cycle.
5. The device according to claim 4, characterized in that The step of acquiring a mains voltage digital quantity corresponding to the number of mains voltage sampling points to form a mains voltage digital quantity set includes: In the first mains voltage cycle, obtaining the first mains voltage digital quantity, starting from the first address of the buffer register, storing the first mains voltage digital quantity into the buffer register in sequence until all the first mains voltage digital quantities are stored in the buffer register, determining that the first mains voltage cycle is over, and taking the set consisting of all the mains voltage digital quantities stored in the buffer register as the first mains voltage digital quantity set corresponding to the first mains voltage cycle; In each other mains voltage cycle after the first mains voltage cycle, a second mains voltage digital quantity corresponding to the current mains voltage cycle is obtained, and starting from the first address of the buffer register, the second mains voltage digital quantity is used to replace the mains voltage digital quantity of the previous mains voltage cycle stored in the buffer register until all the second mains voltage digital quantities are stored in the buffer register, and the end of the current mains voltage cycle is determined, and the set of mains voltage digital quantities obtained by replacement in the buffer register storage is used as the current mains voltage digital quantity set corresponding to the current mains voltage cycle.
6. The device according to claim 5, characterized in that The digital signal processor comprises a first counting unit and a second counting unit; The program processing unit is configured to: Before acquiring the first mains voltage digital quantity set, initializing the count values of the first counting unit and the second counting unit to 0; The first counting unit and the second counting unit are configured to perform the following operations: In the first mains voltage cycle, determine whether all the mains voltage values represented by the first mains voltage digital quantity are positive or negative, and when the mains voltage value represented by the first mains voltage digital quantity is positive, add one to the count value of the first counting unit, and when the mains voltage value represented by the first mains voltage digital quantity is negative, add one to the count value of the second counting unit, and after determining whether all the mains voltage values represented by the first mains voltage digital quantity are positive or negative, use the count value of the first counting unit as the first quantity of the first mains voltage cycle, and use the count value of the second counting unit as the second quantity of the first mains voltage cycle; In each other mains voltage cycle after the first mains voltage cycle, before replacing the mains voltage digital quantity of the previous mains voltage cycle stored in the buffer register with the second mains voltage digital quantity, when the mains voltage value represented by the second mains voltage digital quantity and the mains voltage value represented by the mains voltage digital quantity of the previous mains voltage cycle have the same sign, the count value of the first counting unit or the count value of the second counting unit remains unchanged; when the mains voltage value represented by the second mains voltage digital quantity and the mains voltage value represented by the mains voltage digital quantity of the previous mains voltage cycle have different signs, if the mains voltage value represented by the second mains voltage digital quantity is a positive number, the count value of the first counting unit is increased by one, and the count value of the second counting unit is reduced by one; if the mains voltage value represented by the second mains voltage digital quantity is a negative number, the count value of the second counting unit is increased by one, and the count value of the first counting unit is reduced by one; In each other mains voltage cycle after the first mains voltage cycle, after each acquisition of the second mains voltage digital quantity, the count value of the first counting unit is used as the first number of the current mains voltage cycle, and the count value of the second counting unit is used as the second number of the current mains voltage cycle.
7. The device according to claim 3, characterized in that The digital signal processor comprises a capture unit; The capture unit is configured to capture a zero-crossing point of the mains voltage, and the zero-crossing point of the mains voltage is defined as a point where the phase angle of the mains voltage is zero degrees; The program processing unit is configured to perform the following operations: Calculating the current mains frequency based on the zero-crossing point of the mains voltage; Based on the current mains frequency and the execution cycle, calculating the number of mains voltage sampling points of the next mains voltage cycle; After the current mains voltage cycle ends, if it is determined that the mains power has not undergone a phase jump, before obtaining the mains voltage digital quantity corresponding to the next mains voltage cycle, the first quantity and the second quantity are both updated to half of the number of mains voltage sampling points of the next mains voltage cycle.
8. The device according to claim 2, characterized in that The difference threshold is set as follows: Calculate the ratio of the set phase jump recognition angle to the circumference angle; The difference threshold is determined according to the product of the ratio and twice the number of the mains voltage sampling points, and the difference threshold is greater than the product.
9. The device according to claim 2 or 8, characterized in that The difference threshold is set as follows: Calculate the number of first mains voltage sampling points corresponding to the maximum frequency and the number of second mains voltage sampling points corresponding to the minimum frequency in the preset mains frequency protection interval; Calculating the difference between the number of the first mains voltage sampling points and the number of the second mains voltage sampling points; The difference threshold is determined according to the quantity difference, and the difference threshold is greater than the quantity difference.
10. A method for monitoring the phase of a mains power supply, characterized in that: include: Collecting mains voltage and / or mains frequency; Converting the mains voltage into a digital value of the mains voltage by means of an analog-to-digital converter; Calculate a first quantity and a second quantity by means of a program processing unit, define the first quantity as the quantity of the digital quantity of the mains voltage in the positive half-cycle waveform of the current mains voltage, and define the second quantity as the quantity of the digital quantity of the mains voltage in the negative half-cycle waveform of the current mains voltage; By means of the program processing unit, it is determined that a phase jump occurs in the mains power based on the absolute value of the difference between the first number and the second number being greater than a difference threshold.
11. The method according to claim 10, characterized in that The calculating the first quantity and the second quantity comprises: In response to the energy storage converter being connected to the grid, in each mains voltage cycle, the number of mains voltage sampling points in the current mains voltage cycle is calculated; Acquire a mains voltage digital quantity corresponding to the number of mains voltage sampling points to form a mains voltage digital quantity set; In the process of forming the mains voltage digital quantity set, the first quantity and the second quantity are determined based on the acquired mains voltage digital quantity.
12. The method according to claim 11, characterized in that The calculating the number of mains voltage sampling points in the current mains voltage cycle includes: The mains frequency corresponding to the current mains voltage cycle is calculated, and the ratio of the inverse of the mains frequency to the execution cycle is used as the number of mains voltage sampling points in the current mains voltage cycle. The execution cycle is the interval time of the program cyclic execution in the program processing unit.
13. The method according to claim 11 or 12, characterized in that: The step of acquiring a mains voltage digital quantity corresponding to the number of mains voltage sampling points to form a mains voltage digital quantity set includes: In the first mains voltage cycle, obtaining the first mains voltage digital quantity, starting from the first address of the buffer register, storing the first mains voltage digital quantity into the buffer register in sequence until all the first mains voltage digital quantities are stored in the buffer register, determining that the first mains voltage cycle is over, and taking the set consisting of all the mains voltage digital quantities stored in the buffer register as the first mains voltage digital quantity set corresponding to the first mains voltage cycle; In each other mains voltage cycle after the first mains voltage cycle, a second mains voltage digital quantity corresponding to the current mains voltage cycle is obtained, and starting from the first address of the buffer register, the second mains voltage digital quantity is used to replace the mains voltage digital quantity of the previous mains voltage cycle stored in the buffer register until all the second mains voltage digital quantities are stored in the buffer register, and the end of the current mains voltage cycle is determined, and the set of mains voltage digital quantities obtained by replacement in the buffer register is used as the current mains voltage digital quantity set corresponding to the current mains voltage cycle.
14. The method according to claim 13, characterized in that The determining the first quantity and the second quantity based on the mains voltage digital quantity set includes: Before acquiring the first mains voltage digital quantity set, initializing the count values of the first counting unit and the second counting unit to 0; In the first mains voltage cycle, determine whether all the mains voltage values represented by the first mains voltage digital quantity are positive or negative, and when the mains voltage value represented by the first mains voltage digital quantity is positive, the count value of the first counting unit is increased by one, and when the mains voltage value represented by the first mains voltage digital quantity is negative, the count value of the second counting unit is increased by one, and after determining that all the mains voltage values represented by the first mains voltage digital quantity are positive or negative, use the count value of the first counting unit as the first quantity of the first mains voltage cycle, and use the count value of the second counting unit as the second quantity of the first mains voltage cycle; In each other mains voltage cycle after the first mains voltage cycle, before replacing the mains voltage digital quantity of the previous mains voltage cycle stored in the buffer register with the second mains voltage digital quantity, when the mains voltage value represented by the second mains voltage digital quantity and the mains voltage value represented by the mains voltage digital quantity of the previous mains voltage cycle have the same sign, the count value of the first counting unit or the count value of the second counting unit remains unchanged; when the mains voltage value represented by the second mains voltage digital quantity and the mains voltage value represented by the mains voltage digital quantity of the previous mains voltage cycle have different signs, if the mains voltage value represented by the second mains voltage digital quantity is a positive number, the count value of the first counting unit is increased by one, and the count value of the second counting unit is reduced by one; if the mains voltage value represented by the second mains voltage digital quantity is a negative number, the count value of the second counting unit is increased by one, and the count value of the first counting unit is reduced by one; In each other mains voltage cycle after the first mains voltage cycle, after each acquisition of the second mains voltage digital quantity, the count value of the first counting unit is used as the first number of the current mains voltage cycle, and the count value of the second counting unit is used as the second number of the current mains voltage cycle.
15. The method according to claim 12, characterized in that The method further comprises: Capturing the zero-crossing point of the mains voltage by a capturing unit, and defining the zero-crossing point of the mains voltage as a point where the phase angle of the mains voltage is zero degree; Calculating the current mains frequency based on the zero-crossing point of the mains voltage by the program processing unit; Based on the current mains frequency and the execution cycle, calculating the number of mains voltage sampling points of the next mains voltage cycle; After the current mains voltage cycle ends, if it is determined that the mains power has not undergone a phase jump, before obtaining the mains voltage digital quantity corresponding to the next mains voltage cycle, the first quantity and the second quantity are both updated to half of the number of mains voltage sampling points of the next mains voltage cycle.
16. The method according to claim 11, characterized in that The difference threshold is set as follows: Calculate the ratio of the set phase jump recognition angle to the circumference angle; The difference threshold is determined according to the product of the ratio and twice the number of the mains voltage sampling points, and the difference threshold is greater than the product.
17. The method according to claim 11 or 16, characterized in that The difference threshold is set as follows: Calculate the number of first mains voltage sampling points corresponding to the maximum frequency and the number of second mains voltage sampling points corresponding to the minimum frequency in the preset mains frequency protection interval; Calculating the difference between the number of the first mains voltage sampling points and the number of the second mains voltage sampling points; The difference threshold is determined according to the quantity difference, and the difference threshold is greater than the quantity difference.
