A frequency detection method for three-phase AC power grids

CN122568097APending Publication Date: 2026-08-14ZHUHAI JUSHENG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-21
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0005]本发明实施例提供了用于三相交流电网的频率检测方法,可以解决现有技术中频率检测对处理器算力需求及外围硬件依赖大的技术问题

Benefits of technology

[0038]本发明一些实施例提供的技术方案带来的有益效果至少包括:通过精确记录电压信号两次达到同一预设电压阈值的精确时刻,并计算其时间差,直接测量电压信号的周期,避免了频谱分析中的同步采样要求和锁相环的稳态误差。本发明核心算法基于时间戳的简单比较和计算,无需复杂的FFT变换或锁相环控制算法,对微控制器的计算能力和存储资源要求极低。可采用基于ARM Cortex-M0/M3等低成本、低功耗的32位MCU实现。硬件上仅需简单的电阻分压、滤波和电压跟随电路,无需高精度的电压互感器或复杂的调理电路,系统整体成本显著降低,易于大规模部署和应用。并且基于相邻两次阈值穿越的周期测量,理论上只需一个电压周期即可完成一次频率计算,响应速度快,能够及时跟踪电网频率的动态变化。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122568097A_ABST
    Figure CN122568097A_ABST
Patent Text Reader

Abstract

This invention discloses a frequency detection method for a three-phase AC power grid, relating to the field of power electronics. The method includes: acquiring three-phase power grid voltage signals and converting them into low-voltage sinusoidal signals; continuously acquiring the low-voltage sinusoidal signals of each phase at a preset sampling frequency, and recording in real time the first moment when the voltage value of each phase reaches a preset voltage threshold, and the second moment when it reaches the preset voltage threshold again; wherein the first moment and the second moment are adjacent; and determining the power grid frequency based on the time difference between the first moment and the second moment. This invention solves the technical problem in the prior art where frequency detection requires significant processor computing power and is highly dependent on peripheral hardware.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power electronics technology, and in particular to a frequency detection method for a three-phase AC power grid. Background Technology

[0002] Grid frequency is one of the most critical state variables in power system operation. Its accurate measurement is essential for ensuring stable system operation, achieving synchronized grid connection of equipment, ensuring power quality, and executing relay protection functions. Traditional and currently commonly used three-phase grid frequency detection methods mainly rely on the following technical approaches:

[0003] One method is based on hardware zero-crossing detection circuits. Its basic principle is to detect the zero-crossing points of the three-phase voltage waveforms using hardware circuits such as voltage comparators and optocouplers, and then calculate the grid frequency by measuring the time interval between adjacent zero-crossing points using a timer. This method is intuitive and has a fast response speed. However, it requires an independent zero-crossing detection hardware circuit for each phase voltage (or the converted signal), increasing the number of components, hardware complexity, and overall cost. Furthermore, the hardware circuit is susceptible to interference from grid harmonics, noise, and voltage dips, which may lead to incorrect zero-crossing judgments, thus reducing measurement accuracy and reliability. The second method is based on Fast Fourier Transform (FFT) spectrum analysis, which is applied to frequency measurement. This method performs FFT operations on the sampled three-phase voltage signals to extract the fundamental component from the spectrum and obtain its frequency value. This method can achieve high frequency resolution under steady-state conditions. However, its FFT algorithm itself is computationally complex and has a long data window, resulting in poor real-time frequency updates and significant lag. To achieve high accuracy, it is usually necessary to increase the sampling rate and perform high-point FFT operations, which places extremely high demands on the processor's computing power and storage resources. High-performance, high-cost digital signal processors must be selected, and the computational load is large and the power consumption is high, making it difficult to widely use in low-cost, resource-constrained embedded platforms. The third method is based on software phase-locked loops (SPLLs). SPLLs dynamically adjust the frequency of the internal oscillator through closed-loop control to track the phase and frequency of the grid voltage. However, to achieve fast, accurate, and stable phase locking, especially in the face of complex operating conditions such as grid imbalance and harmonics, improved and more complex PLL algorithms are usually required. The implementation of these algorithms also involves a large number of trigonometric function, filtering, and coordinate transformation operations, resulting in high computational complexity and stringent requirements on the computing power, processing speed, and word length of microprocessors or DSPs. This leads to high system costs and makes it difficult to deploy in small-scale, low-cost application scenarios.

[0004] Therefore, there is an urgent need for a new frequency detection method that can greatly reduce the demand for processor computing power and dependence on peripheral hardware while maintaining high measurement accuracy and good dynamic response, so as to meet the growing demand of power electronic devices for low-cost, high-reliability, and easily integrated frequency measurement functions. Summary of the Invention

[0005] This invention provides a frequency detection method for three-phase AC power grids, which solves the technical problems of high processor computing power requirements and high dependence on peripheral hardware in existing frequency detection technologies. The technical solution is as follows:

[0006] In a first aspect, embodiments of the present invention provide a frequency detection method for a three-phase AC power grid, comprising:

[0007] Acquire the three-phase grid voltage signal and convert the three-phase grid voltage signal into a low-voltage sine wave signal;

[0008] The low-voltage sinusoidal signal of each phase is continuously acquired at a preset sampling frequency, and the first moment when the voltage value of each phase reaches the preset voltage threshold and the second moment when it reaches the preset voltage threshold again are recorded in real time; wherein the first moment and the second moment are adjacent.

[0009] The power grid frequency is determined based on the time difference between the first time point and the second time point.

[0010] In some embodiments of the present invention, determining the power grid frequency based on the time difference between the first time moment and the second time moment includes:

[0011] Calculate the time difference between the first moment and the second moment to obtain the single-phase voltage period;

[0012] Continuously acquire multiple single-phase voltage cycles and determine the average voltage cycle of the multiple cycles;

[0013] The power grid frequency is determined based on the average voltage period, according to the reciprocal relationship between frequency and period.

[0014] In some embodiments of the present invention, before recording the first moment when the voltage value of each phase reaches a preset voltage threshold, and before the second moment when it reaches the preset voltage threshold again, the method further includes:

[0015] Determine whether the voltage values ​​of multiple consecutive sampling points before reaching the preset voltage threshold all meet a preset condition; the preset condition is that the voltage values ​​of N consecutive sampling points are all greater than the preset voltage threshold, where N is a positive integer;

[0016] If the conditions are met, then the current time when the preset voltage threshold is reached is considered valid.

[0017] In some embodiments of the present invention, the method further includes:

[0018] Based on the characteristic that the three-phase voltage phases differ by 120°, it is determined whether the time difference between the first moments when the recorded phase voltage values ​​reach the preset voltage threshold is within the threshold range.

[0019] If not, the voltage value is determined to be abnormal.

[0020] In some embodiments of the present invention, determining whether the time difference between the first moments when the recorded phase voltage values ​​reach a preset voltage threshold is within the threshold range includes:

[0021] Verify whether the time difference between any two adjacent phase signals reaching the preset voltage threshold is within the threshold range; the threshold range is a preset tolerance of one-third of the voltage cycle.

[0022] In some embodiments of the present invention, the detection circuit for the three-phase power grid voltage signal includes:

[0023] The three-phase input terminals are connected to the voltages of phases A, B, and C, respectively.

[0024] Multiple voltage divider resistors are connected in series in each phase voltage line;

[0025] A parallel pull-up resistor is connected to each phase voltage line;

[0026] A capacitor used for filtering three-phase voltage;

[0027] The MCU is used to periodically sample the three-phase voltage.

[0028] In some embodiments of the present invention, the method further includes:

[0029] Based on the time difference sequence of the first moment when each phase reaches the preset voltage threshold, determine whether there is abnormal data.

[0030] Secondly, the present invention also provides a frequency detection device for a three-phase AC power grid, comprising:

[0031] The acquisition and conversion module is used to acquire the three-phase power grid voltage signal and convert the three-phase power grid voltage signal into a low-voltage sine wave signal;

[0032] The acquisition module is used to continuously acquire low-voltage sinusoidal signals of each phase at a preset sampling frequency, and record in real time the first moment when the voltage value of each phase reaches the preset voltage threshold, and the second moment when it reaches the preset voltage threshold again; wherein the first moment and the second moment are adjacent.

[0033] The frequency determination module is used to determine the power grid frequency based on the time difference between the first time and the second time.

[0034] Thirdly, the present invention also provides an electronic device, comprising: a processor and a memory;

[0035] The memory stores a computer-readable program that can be executed by the processor;

[0036] When the processor executes the computer-readable program, it implements the steps in the frequency detection method for a three-phase AC power grid as described above.

[0037] Fourthly, the present invention also provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the steps in the frequency detection method for a three-phase AC power grid as described above.

[0038] The beneficial effects of the technical solutions provided by some embodiments of the present invention include at least the following: by accurately recording the precise times when a voltage signal reaches the same preset voltage threshold twice and calculating the time difference, the period of the voltage signal can be directly measured, avoiding the synchronous sampling requirements and steady-state errors of the phase-locked loop in spectrum analysis. The core algorithm of the present invention is based on simple comparison and calculation of timestamps, requiring no complex FFT transformation or phase-locked loop control algorithm, thus placing extremely low demands on the computing power and storage resources of the microcontroller. It can be implemented using low-cost, low-power 32-bit MCUs such as ARM Cortex-M0 / M3. Hardware-wise, only simple resistor divider, filtering, and voltage follower circuits are needed, eliminating the need for high-precision voltage transformers or complex conditioning circuits, significantly reducing the overall system cost and facilitating large-scale deployment and application. Furthermore, based on the period measurement of two adjacent threshold crossings, theoretically only one voltage cycle is needed to complete one frequency calculation, resulting in fast response speed and timely tracking of dynamic changes in the power grid frequency. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 This is a system architecture diagram of an embodiment of the frequency detection method for a three-phase AC power grid provided by the present invention;

[0041] Figure 2This is a flowchart of an embodiment of the frequency detection method for a three-phase AC power grid provided by the present invention;

[0042] Figure 3 A schematic diagram of the structure of an embodiment of the three-phase circuit output circuit in the frequency detection method for a three-phase AC power grid provided by the present invention;

[0043] Figure 4 This is a schematic diagram of an embodiment of the frequency detection device for a three-phase AC power grid provided by the present invention;

[0044] Figure 5 This is a schematic diagram of the operating environment of an embodiment of the electronic device provided by the present invention. Detailed Implementation

[0045] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0046] It should be noted that the frequency detection method for three-phase AC power grids provided in this application is generally executed by terminal equipment, and correspondingly, the frequency detection device for three-phase AC power grids is generally installed in the terminal equipment.

[0047] Figure 1 An exemplary system architecture for a frequency detection method or a frequency detection device for a three-phase AC power grid that can be applied to this application is shown.

[0048] like Figure 1 As shown, the system architecture may include: terminal device 101 and server 102. Terminal device 101 and server 102 can communicate via a network, which serves as the medium for providing communication links between the various units. The network may include various types of wired or wireless communication links, such as: wired communication links including fiber optic cables, twisted-pair cables, or coaxial cables; and wireless communication links including Bluetooth communication links, Wi-Fi communication links, or microwave communication links.

[0049] It should be noted that the terminal device 101 and the server 102 can be either hardware or software. When the terminal device 101 and the server 102 are hardware, they can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the terminal device 101 and the server 102 are software, they can be implemented as multiple software programs or software modules (for example, to provide distributed services), or as a single software program or software module; no specific limitations are made here.

[0050] The terminal device of this application can be equipped with various communication client applications, such as video recording applications, video playback applications, voice interaction applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0051] A terminal device can be either hardware or software. When the terminal device is hardware, it can be various terminal devices with a display screen, including but not limited to smartphones, tablets, laptops, and desktop computers. When the terminal device is software, it can be installed on the terminal devices listed above. It can be implemented as multiple software programs or software modules (e.g., used to provide distributed services) or as a single software program or software module; no specific limitation is made here.

[0052] When the terminal device is hardware, it can also be equipped with a display device and a camera. The display device can be any device capable of displaying information, and the camera is used to capture video streams. For example, the display device can be a cathode ray tube display (CR), a light-emitting diode display (LED), an e-ink screen, a liquid crystal display (LCD), a plasma display panel (PDP), etc. Users can use the display device on the terminal device to view displayed text, images, videos, and other information.

[0053] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is for illustrative purposes only. Depending on implementation needs, there can be any number of terminal devices, networks, and servers.

[0054] The following will be combined with the appendix Figure 2 This application provides a detailed description of the frequency detection method for a three-phase AC power grid according to embodiments of the present application. The frequency detection device for a three-phase AC power grid in these embodiments can be... Figure 1 The terminal device shown.

[0055] Please see Figure 2 This document provides a flowchart illustrating a frequency detection method for a three-phase AC power grid, as described in an embodiment of this application. Figure 2 As shown, the method described in this application embodiment may include the following steps:

[0056] S201. Acquire the three-phase grid voltage signal and convert the three-phase grid voltage signal into a low-voltage sine wave signal;

[0057] like Figure 3As shown, CN1 is a three-phase voltage input connector, typically used in three-phase four-wire (L1, L2, L3, N) or three-phase three-wire systems. For safety, a fuse or varistor can be connected in series at the input for overcurrent and overvoltage protection. Three-phase voltage signals are obtained based on CN1.

[0058] It should be noted that low-voltage sinusoidal signals typically refer to AC signals with peak values ​​within the MCU's ADC reference voltage range. Their DC bias can be set at the midpoint of the reference voltage to ensure complete acquisition of both positive and negative half-cycles. The conversion process should maintain good linearity to minimize measurement errors.

[0059] Furthermore, the high-voltage signal (typically several hundred volts) is safely and linearly converted into a low-voltage sinusoidal signal suitable for the input range of the microcontroller's analog-to-digital converter (ADC) through a front-end signal conditioning circuit. For example, a voltage divider network composed of high-resistance precision resistors can attenuate the 380V line voltage to a sinusoidal wave in the 0-3.3V range, and impedance matching and isolation can be achieved through a voltage follower or operational amplifier. Finally, a first-order RC low-pass filter can be added to filter out some high-frequency noise. In a specific embodiment, such as... Figure 3 As shown, the mains voltage is divided by a series voltage divider network consisting of resistors R6, R7, R8, R9, R10, and R67. Using multiple resistors in series instead of a single large-value resistor distributes the high-voltage peak voltage across six resistors. Each resistor withstands a voltage drop of approximately 50V, far below its rated withstand voltage, ensuring long-term reliability and avoiding the risk of single-point breakdown. Furthermore, connecting multiple resistors in series distributes the total power consumption across them, reducing the temperature rise of individual resistors, improving thermal stability and circuit lifespan. Even if individual resistors experience slight changes in resistance due to manufacturing processes or aging, the overall voltage division ratio changes relatively less, improving the long-term stability of the voltage division ratio. After high-voltage division, the signal amplitude drops to a safe range. Resistor R24 ​​is the sampling resistor; the voltage across it is the sampling voltage fed into the ADC. Resistor R27 acts as a pull-up resistor, connected to a stable reference voltage, providing a clear DC operating point for the ADC input pin and boosting the bipolar AC signal to a unipolar signal referenced to Vmid. Capacitors C8, C9, and C10 are connected in parallel between the ADC input terminals of phases A, B, and C and ground, respectively, and together with the preceding resistors (R24, R23, R22 and the internal resistance of their pull-up networks) form a first-order RC low-pass filter.

[0060] It should be noted that, in addition to resistive voltage division, voltage transformers can also be used to achieve electrical isolation, or isolation amplifiers or linear optocouplers can be used.

[0061] S202. Continuously acquire low-voltage sinusoidal signals of each phase at a preset sampling frequency, and record in real time the first moment when the voltage value of each phase reaches the preset voltage threshold, and the second moment when it reaches the preset voltage threshold again; wherein, the first moment and the second moment are adjacent.

[0062] It should be noted that the microcontroller starts its ADC module at a fixed preset sampling frequency f_s, which is much higher than the power frequency, to synchronously or sequentially sample the voltage signals after the conversion of the three phases A, B, and C. For each phase, the MCU monitors its sampled value in real time. When the voltage value U(n) of a certain phase is detected to reach the preset voltage threshold V_th, the judgment process begins. Reaching the threshold can be either a rising edge (from bottom to top) or a falling edge (from top to bottom). The first moment t1 refers to the moment when the voltage value first effectively reaches V_th within a complete cycle. The second moment t2 refers to the moment immediately following the next effective reaching of V_th. t1 and t2 are adjacent, and the time difference between them represents a complete voltage cycle T.

[0063] It should be noted that the preset voltage threshold V_th is set to the midpoint of the voltage range of the conditioned low-voltage sine wave signal. The midpoint is chosen because the sine wave has the largest slope (maximum dv / dt) near this point, and the time measurement when crossing this threshold is least sensitive to noise, thus improving time resolution. Other fixed thresholds can also be selected based on the actual signal and noise characteristics, but the midpoint is the optimal choice.

[0064] S203. Determine the power grid frequency based on the time difference between the first time and the second time.

[0065] It should be noted that the time difference Δt (Δt = t2 - t1) between the first time t1 and the second time t2 is theoretically equal to one complete period T of the sinusoidal voltage signal of that phase. Therefore, the instantaneous frequency of that phase is f_inst = 1 / Δt.

[0066] In one embodiment of the present invention, determining the power grid frequency based on the time difference between the first time point and the second time point includes:

[0067] Calculate the time difference between the first moment and the second moment to obtain the single-phase voltage period;

[0068] Continuously acquire multiple single-phase voltage cycles and determine the average voltage cycle of the multiple cycles;

[0069] The power grid frequency is determined based on the average voltage period, according to the reciprocal relationship between frequency and period.

[0070] In this embodiment, to avoid the influence of instantaneous fluctuations in the power grid frequency, multiple periodic measurements of phase A are continuously collected, and their arithmetic mean is calculated as the average period T_A_avg of phase A. Similarly, T_B_avg and T_C_avg are obtained.

[0071] In this embodiment, the period of the voltage signal is directly measured by accurately recording the precise moments when the voltage signal reaches the same preset voltage threshold twice and calculating the time difference between them, thus avoiding the synchronous sampling requirements and steady-state errors of the phase-locked loop in spectrum analysis. The core algorithm of this invention is based on simple comparison and calculation of timestamps, requiring no complex FFT transformation or phase-locked loop control algorithm, resulting in extremely low requirements for the microcontroller's computing power and storage resources. It can be implemented using a low-cost, low-power 32-bit MCU based on ARM Cortex-M0 / M3. Hardware-wise, only simple resistor divider, filtering, and voltage follower circuits are needed, eliminating the need for high-precision voltage transformers or complex conditioning circuits, significantly reducing the overall system cost and facilitating large-scale deployment and application. Furthermore, based on the period measurement of two adjacent threshold crossings, theoretically, only one voltage cycle is needed to complete one frequency calculation, resulting in fast response and timely tracking of dynamic changes in the power grid frequency.

[0072] In some embodiments of the present invention, before recording the first moment when the voltage value of each phase reaches a preset voltage threshold, and before the second moment when it reaches the preset voltage threshold again, the method further includes:

[0073] Determine whether the voltage values ​​of multiple consecutive sampling points before reaching the preset voltage threshold all meet a preset condition; the preset condition is that the voltage values ​​of N consecutive sampling points are all greater than the preset voltage threshold, where N is a positive integer;

[0074] If the conditions are met, then the current time when the preset voltage threshold is reached is considered valid.

[0075] In this embodiment, to determine that a single crossing is "valid" and not a false trigger caused by noise or interference, simply comparing U(n) and V_th is not sufficient. Therefore, when the sampled voltage U(n) reaches or exceeds V_th instantaneously, the MCU does not immediately record the current time t(n). Instead, it retrospectively checks the previous consecutive M (M is a preset positive integer, and a preset condition is set. For example, it is required that the voltage values of these consecutive M sampled points are all greater than V_th (for rising-edge crossing). That is: U(n - M), U(n - M + 1),..., U(n - 1)>V_th and U(n)>=V_th; only when this condition is met, it is determined that this crossing is a real and stable sine wave rising process rather than a short noise spike, and the recorded time t(n) is the valid first time t1. For falling-edge crossing, the condition can be set that the consecutive M points are all less than V_th. This criterion is equivalent to a simple digital filter that can effectively filter out pulse interference with a width less than (M*Ts) (Ts is the sampling period).

[0076] In some embodiments of the present invention, the method further includes:

[0077] Based on the characteristic that the three-phase voltages have a phase difference of 120°, determine whether the time difference between the first times when the recorded voltage values of each phase reach the preset voltage threshold is within the threshold range;

[0078] If not, it is determined that the voltage value is abnormal.

[0079] It should be noted that for an ideal three-phase symmetric sine wave, the phase difference between each phase is 120° (i.e., 2π / 3 radians). For a 50Hz system, one cycle is 20ms, and the time difference between adjacent two phases passing through the same threshold point should be 20ms / 3≈6.667ms. In this embodiment, after recording the first times t_A1, t_B1, t_C1 of the A, B, and C phases respectively, calculate the time differences between adjacent phases: Δt_AB = |t_B1 - t_A1|, Δt_BC = |t_C1 - t_B1|, Δt_CA = |t_A1_next - t_C1| (the phase difference from the C phase to the next A phase cycle). Calculate the average cycle estimate T of the current cycle, preset a tolerance threshold ε, |Δt_AB - T / 3|<ε and |Δt_BC - T / 3|<ε and |Δt_CA - T / 3|<ε, and at the same time, verify the phase sequence closed-loop t_A1<t_B1<t_C1<t_A1 or vice versa. If the measured value of a certain phase (such as t_B1 of the B phase) deviates significantly from the theoretical position due to severe interference, resulting in Δt_AB or Δt_BC exceeding the tolerance ε, it is determined that the measurement data of this phase for this time is abnormal. It is also possible to calculate the frequency only using the verified two-phase data, or replace the current abnormal value with the valid measurement time of the previous cycle of this phase or the theoretical time deduced from the other two phases.

[0080] Based on the above-described frequency detection method for three-phase AC power grids, this invention also provides a frequency detection device for three-phase AC power grids. Please refer to [link to relevant documentation]. Figure 4 ,include:

[0081] The conversion module 410 is used to acquire the three-phase grid voltage signal and convert the three-phase grid voltage signal into a low-voltage sine wave signal;

[0082] The acquisition module 420 is used to continuously acquire low-voltage sinusoidal signals of each phase at a preset sampling frequency, and record in real time the first moment when the voltage value of each phase reaches the preset voltage threshold, and the second moment when it reaches the preset voltage threshold again; wherein the first moment and the second moment are adjacent.

[0083] The frequency determination module 430 is used to determine the power grid frequency based on the time difference between the first time and the second time.

[0084] This application also provides a computer storage medium that can store multiple instructions, which are adapted to be loaded and executed by a processor as described above. Figure 2 The method steps of the illustrated embodiment can be found in the following documentation for detailed execution. Figure 2 The specific details of the illustrated embodiments will not be elaborated here.

[0085] This application also provides a computer program product that stores at least one instruction, which is loaded and executed by the processor to implement the frequency detection method for a three-phase AC power grid as described in the above embodiments.

[0086] Please see Figure 5 This document provides a schematic diagram of the structure of a terminal device according to an embodiment of this application. Figure 5 As shown, the terminal device 500 may include: at least one processor 501, at least one network interface 504, user interface 503, memory 505, and at least one communication bus 502.

[0087] The communication bus 502 is used to enable communication between these components.

[0088] The user interface 503 may include a display screen and a camera. Optionally, the user interface 503 may also include a standard wired interface and a wireless interface.

[0089] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0090] The processor 501 may include one or more processing cores. The processor 501 connects to various parts within the terminal device 500 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 505, and by calling data stored in the memory 505. Optionally, the processor 501 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 501 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content required for display; and the modem handles wireless communication. It is understood that the modem may also be implemented as a separate chip, without being integrated into the processor 501.

[0091] The memory 505 may include random access memory (RAM) or read-only memory. Optionally, the memory 505 may include a non-transitory computer-readable storage medium. The memory 505 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 505 may also be at least one storage device located remotely from the aforementioned processor 501. Figure 5 As shown, the memory 505, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and application programs.

[0092] exist Figure 5In the terminal device 500 shown, the user interface 503 is mainly used to provide an input interface for the user and to obtain the user's input data; while the processor 501 can be used to call the application program stored in the memory 505 and specifically execute, such as Figure 2 The method shown can be referred to for details. Figure 2 As shown, it will not be elaborated further here.

[0093] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory, or random access memory, etc.

[0094] The above description discloses only preferred embodiments of the present invention and should not be construed as limiting the scope of the present invention. Therefore, equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.

Claims

1. A frequency detection method for a three-phase AC power grid, characterized in that, include: Acquire the three-phase grid voltage signal and convert the three-phase grid voltage signal into a low-voltage sine wave signal; The low-voltage sinusoidal wave signal of each phase is continuously acquired at a preset sampling frequency, and the first moment when the voltage value of each phase reaches the preset voltage threshold and the second moment when it reaches the preset voltage threshold again are recorded in real time; wherein the first moment and the second moment are adjacent. The power grid frequency is determined based on the time difference between the first time point and the second time point.

2. The frequency detection method for a three-phase AC power grid according to claim 1, characterized in that, Determining the power grid frequency based on the time difference between the first time point and the second time point includes: Calculate the time difference between the first moment and the second moment to obtain the single-phase voltage period; Continuously acquire multiple single-phase voltage cycles and determine the average voltage cycle of the multiple cycles; The power grid frequency is determined based on the average voltage period, according to the reciprocal relationship between frequency and period.

3. The frequency detection method for a three-phase AC power grid according to claim 1, characterized in that, Before recording the first moment when the voltage value of each phase reaches the preset voltage threshold, and before the second moment when it reaches the preset voltage threshold again, the process also includes: Determine whether the voltage values ​​of multiple consecutive sampling points before reaching the preset voltage threshold all meet a preset condition; the preset condition is that the voltage values ​​of N consecutive sampling points are all greater than the preset voltage threshold, where N is a positive integer; If the conditions are met, then the current time when the preset voltage threshold is reached is considered valid.

4. The low-cost, high-precision three-phase power grid frequency detection method according to claim 1, characterized in that, The method further includes: Based on the characteristic that the three-phase voltage phases differ by 120°, it is determined whether the time difference between the first moments when the recorded phase voltage values ​​reach the preset voltage threshold is within the threshold range. If not, the voltage value is determined to be abnormal.

5. The low-cost, high-precision three-phase power grid frequency detection method according to claim 4, characterized in that, The determination of whether the time difference between the first moments when the recorded phase voltage values ​​reach the preset voltage threshold is within the threshold range includes: Verify whether the time difference between any two adjacent phase signals reaching the preset voltage threshold is within the threshold range; the threshold range is a preset tolerance of one-third of the voltage cycle.

6. The frequency detection method for a three-phase AC power grid according to claim 1, characterized in that, The detection circuit for the three-phase power grid voltage signal includes: The three-phase input terminals are connected to the voltages of phases A, B, and C, respectively. Multiple voltage divider resistors are connected in series in each phase voltage line; A parallel pull-up resistor is connected to each phase voltage line; A capacitor used for filtering three-phase voltage; The MCU is used to periodically sample the three-phase voltage.

7. The frequency detection method for a three-phase AC power grid according to claim 1, characterized in that, The method further includes: Based on the time difference sequence of the first moment when each phase reaches the preset voltage threshold, determine whether there is abnormal data.

8. A frequency detection device for a three-phase AC power grid, characterized in that, include: The acquisition and conversion module is used to acquire the three-phase power grid voltage signal and convert the three-phase power grid voltage signal into a low-voltage sine wave signal; The acquisition module is used to continuously acquire low-voltage sinusoidal signals of each phase at a preset sampling frequency, and record in real time the first moment when the voltage value of each phase reaches the preset voltage threshold, and the second moment when it reaches the preset voltage threshold again; wherein the first moment and the second moment are adjacent. The frequency determination module is used to determine the power grid frequency based on the time difference between the first time and the second time.

9. An electronic device, characterized in that, include: Processor and memory; The memory stores a computer-readable program that can be executed by the processor; When the processor executes the computer-readable program, it implements the steps of the frequency detection method for a three-phase AC power grid as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the steps in the frequency detection method for a three-phase AC power grid as described in any one of claims 1-7.