Phase synchronization method and circuit

Through the combination of the optocoupling isolating switch and processor, the edge trigger module detects the voltage zero crossing point, calculates the synchronization delay for data sampling, solving the problem of low synchronization accuracy between power meters and power equipment in the existing technology, and achieving high-precision synchronization And reduces cost and power consumption.

CN118858831BActive Publication Date: 2025-01-17SANLI VIDEO FREQUENCY SCI & TECH SHENZHEN
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411364651.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-17
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

The prior art is difficult to take into account both cost and performance, so as to achieve high-precision synchronization between power meters and monitored power equipment, and the component consistency difference and the conduction voltage drop of the isolation switch affect the accuracy.

Method used

The optical coupling isolating switch and processor are used to detect voltage zero crossing through the edge trigger module, calculate synchronization delay, obtain the initial moment for data sampling, simplify the circuit structure and reduce cost and power consumption.

Benefits of technology

It realizes high-precision synchronization between the power instrument and the monitored power equipment, simplifies the circuit structure, reduces cost and power consumption, and improves the stability and accuracy of synchronization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118858831B_ABST
    Figure CN118858831B_ABST
Patent Text Reader

Abstract

The present invention discloses a phase synchronization method and circuit, including obtaining the time when the working voltage of an edge trigger module increases from 0 to a threshold voltage to obtain the threshold time; obtaining the trigger cycle of the edge trigger module, and subtracting the threshold time from the trigger cycle to obtain the synchronization delay; obtaining the trigger moment of the previous cycle of the edge trigger module, and adding the synchronization delay on the basis of the trigger moment of the previous cycle to obtain the initial moment; and performing data sampling based on the initial moment. After obtaining the threshold time of the edge trigger module and the synchronization delay calculated by the trigger cycle, the trigger moment of the previous cycle of the edge trigger module is obtained, and the initial moment is obtained by adding the trigger moment of the previous cycle to the synchronization delay, so that the high-precision synchronization of the power meter and the monitored power equipment can be achieved at the next forward voltage zero-crossing moment of the monitored power equipment, simplifying the circuit structure, and reducing the cost and power consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electric power data acquisition synchronization, and in particular to a phase synchronization method and circuit. Background Art

[0002] With the development of various power meters, more and more power meters are deployed in residential buildings, factories, substations and other areas to collect and monitor various electrical parameters of power equipment. In order to ensure that various electrical parameters are accurately collected and monitored, it is necessary to ensure the synchronization between a large number of power meters and the monitored power equipment.

[0003] At present, the existing technical solutions usually adopt the voltage zero-crossing detection circuit to achieve synchronization with the monitored power equipment. For example, a full-bridge rectifier + voltage comparator synchronization circuit is used. When the absolute value of the AC voltage of the power equipment is higher than a certain threshold, the synchronization circuit outputs a high level, otherwise it outputs a low level. The power meter decides whether to start working based on the output level of the synchronization circuit. When the high level output of the synchronization circuit is captured, the power meter starts sampling and realizes synchronous sampling at the moment when the voltage of the power equipment crosses the zero point, thereby achieving synchronization with the power equipment. However, this technical solution has many components, complex circuit structure, high cost, high power consumption, and low stability and accuracy.

[0004] Some technical solutions have proposed a synchronous circuit of half-wave rectification + voltage comparator + isolating switch. This technical solution reduces components, reduces cost and power consumption, and has strong and weak electrical isolation, making it safer and more reliable; but the stability and accuracy of this technical solution are still not high. Other technical solutions have proposed a synchronous circuit of half-wave rectification + isolating switch + filtering circuit + voltage stabilizing circuit. This technical solution adds more complex devices and circuits, and has higher costs and power consumption, but the stability and accuracy are greatly improved. However, due to differences in component consistency, the on-state voltage drop of the isolating switch, etc., the accuracy is still limited. Therefore, it is difficult for existing technical solutions to achieve a balance between cost and performance. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a phase synchronization method and circuit to achieve high-precision synchronization between an electric power meter and a monitored electric power device.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0007] A phase synchronization method, comprising:

[0008] Obtain the time it takes for the working voltage of the edge trigger module to increase from 0 to the threshold voltage, and obtain the threshold time;

[0009] Acquire the trigger period of the edge trigger module, and subtract the threshold time from the trigger period to obtain the synchronization delay;

[0010] Obtaining the triggering moment of the edge trigger module in the previous cycle, and adding the synchronization delay on the basis of the triggering moment of the previous cycle to obtain the initial moment;

[0011] Data sampling is performed based on the initial time.

[0012] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0013] A phase synchronization circuit comprises an optocoupler isolation switch and a processor; the processor stores a computer program, and when the processor executes the computer program, each step in the above-mentioned phase synchronization method is implemented;

[0014] The live wire input end of the optical coupler isolating switch is used to connect to the positive pole of the working voltage of the monitored power equipment, the neutral wire end is used to connect to the negative pole of the working voltage of the monitored power equipment, the power input end is used to connect to the power supply, and the output end is connected to the processor.

[0015] The beneficial effects of the present invention are as follows: voltage zero-crossing point detection is realized by setting an optocoupler isolating switch, a high level is output when the forward voltage crosses zero point, a low level is output when the reverse voltage crosses zero point, and the edge trigger module detects the triggered rising edge high level; thus, after obtaining the threshold time of the edge trigger module and the trigger cycle to calculate the synchronization delay, the triggering moment of the previous cycle of the edge trigger module is obtained, and the initial moment is obtained by adding the triggering moment of the previous cycle to the synchronization delay, so that the high-precision synchronization of the power meter and the monitored power equipment can be realized at the next forward voltage zero-crossing point of the monitored power equipment, thereby simplifying the circuit structure and reducing the cost and power consumption. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A flow chart of the steps of a phase synchronization method in an embodiment of the present invention;

[0017] Figure 2 This is a flow chart of the steps of the main program of a phase synchronization method in an embodiment of the present invention:

[0018] Figure 3 The following is a flow chart of the interrupt procedure of a phase synchronization method in an embodiment of the present invention;

[0019] Figure 4 It is a structural schematic diagram of a phase synchronization circuit in an embodiment of the present invention;

[0020] Figure 5 This is a working waveform diagram of a phase synchronization circuit in an embodiment of the present invention;

[0021] Description of labels:

[0022] U1, optocoupler isolation switch; U2, processor. DETAILED DESCRIPTION

[0023] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in conjunction with the implementation modes and the accompanying drawings.

[0024] Existing methods for phase synchronization usually study improvements in hardware circuits, which makes it difficult to reduce the number of components, simplify the circuit structure, reduce costs and power consumption, and improve stability and accuracy, that is, it is difficult to strike a balance between cost and performance. In addition, the existing technical solutions do not fully consider the phase changes of the monitored power equipment itself. The effective value and frequency of its power frequency voltage actually have a certain allowable range of variation, that is, the voltage zero point will have a certain change, which will further reduce the stability and accuracy of synchronization. In response to the above technical problems, the present invention provides a phase synchronization method and circuit, which specifically include:

[0025] Please refer to Figure 1 , a phase synchronization method, comprising:

[0026] Obtain the time it takes for the working voltage of the edge trigger module to increase from 0 to the threshold voltage, and obtain the threshold time;

[0027] Acquire the trigger period of the edge trigger module, and subtract the threshold time from the trigger period to obtain the synchronization delay;

[0028] Obtaining the triggering moment of the edge trigger module in the previous cycle, and adding the synchronization delay on the basis of the triggering moment of the previous cycle to obtain the initial moment;

[0029] Data sampling is performed based on the initial time.

[0030] From the above description, it can be seen that the beneficial effect of the present invention is that after obtaining the threshold time of the edge trigger module and the trigger cycle to calculate the synchronization delay, the trigger time of the previous cycle of the edge trigger module is obtained, and the initial time is obtained by adding the trigger time of the previous cycle to the synchronization delay. In this way, high-precision synchronization between the power meter and the monitored power equipment can be achieved at the next time the forward voltage of the monitored power equipment passes through zero.

[0031] Further, the obtaining the trigger period of the edge trigger module includes:

[0032] The time difference between two adjacent rising edge triggers of the edge trigger module is recorded to obtain the trigger period.

[0033] From the above description, it can be seen that the trigger period is obtained by recording the time difference between two adjacent rising edge triggers of the edge trigger module, that is, the actual rising edge trigger time interval of the edge trigger module is used as the trigger period, so as to obtain the actual trigger period of the current edge trigger module and improve the accuracy of obtaining the trigger period.

[0034] Furthermore, after the data sampling based on the initial time, the method further includes:

[0035] Get the current sampling time and sampling time threshold;

[0036] It is determined whether the current sampled time is greater than the sampling time threshold, and if so, the trigger period is acquired again.

[0037] From the above description, it can be seen that when the current sampled time is greater than the sampling time threshold, the trigger period is updated by re-acquiring the trigger period to ensure the consistency of the trigger period with the current sinusoidal voltage frequency, thereby achieving high-precision synchronization between the power meter and the monitored power equipment.

[0038] Furthermore, the recording of the time difference between two adjacent rising edge triggers of the edge trigger module to obtain the trigger period includes:

[0039] Each time the edge trigger module is triggered, an interrupt program is triggered;

[0040] Determine whether it is necessary to obtain the trigger period. If so, record the current timing value to obtain the first trigger moment; and when the interrupt program is triggered next time, record the current timing value to obtain the second trigger moment; and subtract the first trigger moment from the second trigger moment to obtain the trigger period.

[0041] From the above description, it can be seen that by setting an interrupt program and triggering the interrupt program at each rising edge, that is, when the cycle needs to be re-acquired, the rising edge triggering time can be recorded based on two adjacent rising edges to trigger the interrupt program, thereby obtaining an accurate triggering cycle.

[0042] Further, the reacquiring the trigger period includes:

[0043] Setting the first triggering time to zero;

[0044] The trigger interrupt procedure then includes:

[0045] Determine whether the first trigger time is zero, if so, record the current timing value as the first trigger time; if not, record the current timing value as the second trigger time.

[0046] From the above description, it can be seen that by setting the first trigger moment to zero, when the trigger cycle needs to be reacquired, the first trigger interrupt program records the first trigger moment based on judgment, and changes the value of the first trigger moment, so that the second trigger interrupt program records the second trigger moment based on judgment.

[0047] Further, the reacquiring the trigger period includes:

[0048] Marking the state value as a first preset value;

[0049] The determining whether the trigger period needs to be obtained includes:

[0050] Determine whether the state value is a first preset value, if so, execute the step of obtaining the trigger period; if not, exit the interrupt program.

[0051] It can be seen from the above description that by marking the state value as the first preset value when the trigger cycle needs to be re-acquired, the interrupt program can determine whether a re-acquisition cycle is needed.

[0052] Further, the obtaining of the initial time includes:

[0053] The state value is marked as a second preset value.

[0054] From the above description, it can be seen that after the initial moment is obtained, the state value is marked as the second preset value, which means that there is no need to re-acquire the trigger period until the current sampled time is greater than the sampling time threshold.

[0055] Furthermore, the step of obtaining the time for the working voltage of the edge trigger module to increase from 0 to the threshold voltage includes:

[0056] ;

[0057] in, Indicates the threshold time; Represents the threshold voltage.

[0058] From the above description, it can be known that the time for the working voltage of the edge trigger module to increase from 0 to the threshold voltage can be accurately calculated by the above formula.

[0059] Another embodiment of the present invention provides a phase synchronization circuit, including an optocoupler isolation switch and a processor; the processor stores a computer program, and when the processor executes the computer program, each step in the above-mentioned phase synchronization method is implemented;

[0060] The live wire input terminal of the optocoupler isolating switch is used to be connected to the positive pole of the working voltage of the monitored power equipment, the neutral wire terminal is used to be connected to the negative pole of the working voltage of the monitored power equipment, the power input terminal is used to connect the power supply, and the output terminal is connected to the processor; wherein, the processor includes an edge trigger module, a software timer and a storage module; the edge trigger module is used to receive the signal of the optocoupler isolating switch; the software timer is used for timing; and the storage module is used to store the threshold voltage and the computer program.

[0061] From the above description, it can be seen that the beneficial effect of this embodiment is that the voltage zero-crossing point detection is realized by setting the optocoupler isolation switch, a high level is output when the forward voltage crosses the zero point, and a low level is output when the reverse voltage crosses the zero point, and the edge trigger module detects the triggered rising edge high level; thus, after obtaining the threshold time of the edge trigger module and the trigger cycle to calculate the synchronization delay, the trigger time of the previous cycle of the edge trigger module is obtained, and the initial time is obtained by adding the trigger time of the previous cycle to the synchronization delay, so that the power meter and the monitored power equipment can be synchronized with high precision at the next forward voltage zero-crossing point of the monitored power equipment, which simplifies the circuit structure and reduces the cost and power consumption.

[0062] The phase synchronization method and circuit provided by the present invention can be applied to power monitoring scenarios, such as synchronization between a power meter and a monitored power device, and are described below through specific implementation methods:

[0063] Embodiment 1

[0064] Please refer to Figure 1 , a phase synchronization method, comprising:

[0065] S1. Obtain the time for the working voltage of the edge trigger module to increase from 0 to the threshold voltage, and obtain the threshold time. In an optional implementation, the threshold time is calculated by the following formula:

[0066] ;

[0067] in, Indicates the threshold time; Represents the threshold voltage.

[0068] S2. Obtain the trigger period of the edge trigger module, and subtract the threshold time from the trigger period to obtain the synchronization delay; wherein, the trigger period of the edge trigger module is obtained by recording the time difference between two adjacent rising edge triggers of the edge trigger module. In an optional embodiment, the interrupt program is triggered each time the edge trigger module is triggered, and the time difference between two adjacent rising edge triggers is recorded based on the interrupt program, and the interrupt program performs the following steps:

[0069] S21, determine whether it is necessary to obtain the trigger cycle, if so, record the current timing value to obtain the first trigger time t1; wherein, determine whether it is necessary to obtain the trigger cycle by the state value; specifically: determine whether the state value is the first preset value, if so, execute the step of obtaining the trigger cycle; if not, exit the interrupt program. For example, if the first preset value is 0, that is, when the state value is 0, it is determined that the trigger cycle needs to be obtained; if the state value is 1, exit the interrupt program.

[0070] S22, when the interrupt program is triggered next time, the current timing value is recorded to obtain the second trigger time t2; and the first trigger time t1 is subtracted from the second trigger time t2 to obtain the trigger period TL, that is, TL=t2-t1, and the synchronization delay is further obtained as TL-T1. Among them, by judging whether the first trigger time is zero, it is judged whether the current trigger is the first trigger or the second trigger; that is, if the first trigger time is zero, the current timing value is recorded as the first trigger time t1; if the first trigger time is not zero, the current timing value is recorded as the second trigger time t2.

[0071] S3, obtain the triggering moment of the previous cycle of the edge trigger module, and add the synchronization delay on the basis of the triggering moment of the previous cycle to obtain the initial moment; that is, the triggering moment of the previous cycle is t2, then the initial moment is expressed as t3, expressed as t3=t2+TL-T1. At the same time, the initial moment indicates that the new triggering cycle is currently obtained, that is, there is no need to re-acquire the triggering cycle within a period of time, and the state value is marked as the second preset value to avoid repeated acquisition of the triggering cycle; for example, the second preset value is set to 1, and when the state value is 1, the interrupt program is directly exited. That is, starting from time t2, the delay (TL-T1) time is the third positive zero crossing time t3; if the power meter starts sampling at this time, then the power meter and the monitored power equipment are synchronized; because the delay generated by the program running calculation is at the nanosecond level, it will not affect the accuracy, and the accuracy of the software timer is also at the nanosecond level, and the error is at the nanosecond level, which can be ignored relative to the millisecond level of the power frequency cycle, so it can fully ensure that the devices are synchronized when collecting from the third time.

[0072] S4, data sampling is performed based on the initial time; wherein, each time the current round of data sampling is completed, the current sampled time and the sampling time threshold are obtained; it is determined whether the current sampled time is greater than the sampling time threshold, and if so, the trigger period is re-acquired; at the same time, when the trigger period is re-acquired, the first trigger time is set to zero and the state value is marked as the first preset value, which means that a new trigger period needs to be re-acquired. For example, if the sampling time threshold Tz is set to 1 hour, the trigger period needs to be re-acquired after every 1 hour of data sampling.

[0073] The above steps are implemented by the main program and the interrupt program respectively; the main program is used to implement step S4, and the interrupt program is used to implement steps S1-S3.

[0074] Please refer to Figure 2 , is a flow chart of the steps of the main program in this embodiment, and the main program includes the following steps:

[0075] A1. Set flag = 0, and then execute step A2; wherein flag represents a state value, and setting flag = 0 indicates that a trigger cycle needs to be obtained currently.

[0076] A2: Determine whether flag is equal to 0. If so, execute A2; otherwise, execute A3; that is, wait for the trigger cycle to be obtained before executing subsequent steps.

[0077] A3, delay t3, and then execute A4; that is, wait for the delay time before starting data sampling.

[0078] A4, perform sampling or other functions, and then execute A5.

[0079] A5. Determine whether the current time minus t3 is greater than Tz. If not, execute A4; if yes, execute A6. For example, if the sampling time threshold Tz is set to 1 hour, then after every 1 hour of data sampling, execute step A6.

[0080] A6, set flag = 0, and then execute A7; this means that the trigger cycle needs to be re-acquired.

[0081] A7, set t1=0, and then execute A2, that is, set the first trigger time t1 to zero, so that the interrupt program can determine whether the current timing is the first or second timing.

[0082] Please refer to Figure 3 , is the step flow of the interruption procedure in this embodiment, and the interruption procedure includes the following steps:

[0083] B1. Determine whether flag is equal to 1. If so, execute interrupt return. If not, execute step B2; that is, execute the step in step S2 to determine whether it is necessary to obtain the trigger cycle. When flag=1, it means that the trigger cycle does not need to be obtained at present, then return directly; and when flag=0, it means that the trigger cycle needs to be obtained at present, then execute step B2.

[0084] B2. Determine whether t1 is equal to 0. If so, execute step B3; if not, execute step B4; that is, execute the step in step S2 to determine whether the current trigger is the first or second trigger. If t1=0, it means that the current is the first rising edge; if t1≠0, it means that the current is the second rising edge.

[0085] B3. Set t1 equal to the current timing value of the timer, and then execute the interrupt return; that is, execute the recording of the first triggering time t1 in step S2, and record the current timing value as the first triggering time t1.

[0086] B4. Set t2 equal to the current timing value of the timer, and then execute step B5; that is, execute the recording of the second triggering time t2 in step S2, and record the current timing value as the second triggering time t2.

[0087] B5. Let TL be equal to t2 minus t1, and then execute step B6; that is, execute the step of calculating the current trigger period TL in step S3.

[0088] B6. Read T1 from the storage module, and then execute step B7; that is, to obtain the threshold time T1 generated by step S1.

[0089] B7, let t3 = t2 + TL-T1, and then execute step B8; that is, execute the step of calculating the initial time in step S3, and calculate the initial time for data sampling after the main program delay.

[0090] B8, set FLAG = 1; then execute interrupt return; which means that there is no need to obtain the trigger cycle at present.

[0091] Embodiment 2

[0092] Please refer to Figure 4 A phase synchronization circuit includes an optocoupler isolating switch U1, a resistor R1, a resistor R2 and a processor U2; the processor U2 stores a computer program, and when the processor U2 executes the computer program, the various steps in a phase synchronization method described in Example 1 are implemented; wherein the live input terminal (L) of the optocoupler isolating switch U1 is used to connect to the positive pole of the working voltage of the monitored power equipment, the neutral terminal (N) is used to connect to the negative pole of the working voltage of the monitored power equipment, the power input terminal is used to connect to the power supply (VCC), and the output terminal is connected to the processor; the power supply (VCC) is the positive pole of the weak voltage, and the G terminal is the negative pole of the weak voltage; wherein the optocoupler isolating switch U1 is composed of a light emitting diode D1 and a phototransistor Q1; wherein the processor U2 is mainly composed of an edge trigger module, a software timer and a storage module; the edge trigger module is used to receive a signal from the optocoupler isolating switch; the software timer is used for timing; and the storage module is used to store a threshold voltage and a computer program.

[0093] Please refer to Figure 5, is the working waveform diagram of the circuit in this embodiment; wherein, the industrial frequency sine wave is the input waveform; VL is the voltage at the L terminal, and the on-state voltage drop of the phototransistor Q1 is VQ1. Since the industrial frequency sine wave can only pass through the diode D1 in one direction, VL is the industrial frequency half wave; at the same time, only when VL is greater than a certain value, the phototransistor Q1 can be turned on, and at this time, the resistor R2 has a terminal voltage; so the terminal voltage of the resistor R2 changes with VL; the on and off of the phototransistor Q1 actually has a certain process, and the terminal voltage of the resistor R2 is actually not a very ideal rectangular wave, but a trapezoidal wave; however, the on and off time of the phototransistor Q1 are both in the nanosecond level, which can be ignored compared to the millisecond level of the industrial frequency cycle, so the terminal voltage of the resistor R2 can be regarded as a rectangular wave.

[0094] When VL is greater than a certain threshold value V1, the light-emitting diode D1 emits light, the phototransistor Q1 is turned on, and the terminal voltage of the resistor R2 is (VCC-VQ1). At this time, the edge trigger module is a rising edge trigger; when VL is less than a certain threshold value V1, the light-emitting diode D1 does not emit light, the phototransistor Q1 is turned off, and the terminal voltage of the resistor R2 is 0. At this time, the edge trigger module is a falling edge trigger;

[0095] The threshold voltage V1 is obtained based on experimental tests, and the specific method is as follows:

[0096] (1) Use a voltage source device that can adjust the output voltage value, connect the positive output terminal to the L terminal, and the negative output terminal to the N terminal;

[0097] (2) Use a voltmeter, connect the positive pole to the upper end of resistor R2 and the negative pole to the G end, and observe the voltage reading. When the voltage reading is 0, it means that the phototransistor Q1 is turned off and the light-emitting diode D1 is not emitting light, that is, VL is less than the threshold V1. When the voltage reading is equal to (VCC-VQ1), it means that the phototransistor Q1 is turned on and the light-emitting diode D1 is emitting light, that is, VL is greater than the threshold V1.

[0098] (3) Adjust the output of the voltage source device so that VL is 0. At this time, the voltage reading of the voltmeter is also 0.

[0099] (4) Adjust the output of the voltage source device so that VL increases slowly until the voltage reading on the voltmeter equals (VCC - VQ1). Record the value of VL at this time, which is the threshold voltage V1, and store it in the product's storage module.

[0100] Compared with the structure of the existing synchronization circuit, the circuit structure in this embodiment greatly reduces the number of components required for the synchronization circuit, simplifies the circuit structure, and reduces cost and power consumption; at the same time, it eliminates the impact of component differences and has no dependence; it fully considers the characteristics of the components and greatly improves the synchronization accuracy; and the processor performance requirements are very low, and it can be applied to a wider range of scenarios.

[0101] In summary, the phase synchronization method and circuit provided by the present invention realize voltage zero-crossing detection through an optocoupler isolation switch, output a high level when the forward voltage crosses zero, and output a low level when the reverse voltage crosses zero; collect two adjacent level rising edges, record their time difference, and add the circuit delay time as the total delay time, and then use a software timer to delay the total delay time before starting sampling, so that at the third time when the forward voltage of the monitored power equipment crosses zero, high-precision synchronization of the power meter and the monitored power equipment can be achieved.

[0102] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A phase synchronization method, characterized in that: The invention comprises a phase synchronization circuit, wherein the phase synchronization circuit comprises an optocoupler isolating switch and a processor; the live wire input end of the optocoupler isolating switch is used to be connected to the positive pole of the working voltage of the monitored power equipment, the neutral wire end is used to be connected to the negative pole of the working voltage of the monitored power equipment, the power input end is used to connect the power supply, and the output end is connected to the processor; the processor comprises an edge trigger module, a software timer and a storage module; the edge trigger module is used to receive the signal of the optocoupler isolating switch; the software timer is used for timing; the storage module is used to store the threshold voltage and the computer program; the processor stores the computer program, and the processor implements the following steps when executing the computer program: Obtain the time it takes for the working voltage of the edge trigger module to increase from 0 to the threshold voltage, and obtain the threshold time; Acquire the trigger period of the edge trigger module, and subtract the threshold time from the trigger period to obtain the synchronization delay; Obtaining the triggering moment of the edge trigger module in the previous cycle, and adding the synchronization delay on the basis of the triggering moment of the previous cycle to obtain the initial moment; Data sampling is performed based on the initial time.

2. A phase synchronization method according to claim 1, characterized in that: The step of obtaining the trigger period of the edge trigger module comprises: The time difference between two adjacent rising edge triggers of the edge trigger module is recorded to obtain the trigger period.

3. A phase synchronization method according to claim 2, characterized in that: After the data sampling is performed based on the initial time, the following step is further included: Get the current sampling time and sampling time threshold; It is determined whether the current sampled time is greater than the sampling time threshold, and if so, the trigger period is acquired again.

4. A phase synchronization method according to claim 3, characterized in that: The recording of the time difference between two adjacent rising edge triggers of the edge trigger module to obtain the trigger period includes: Each time the edge trigger module is triggered, an interrupt program is triggered; Determine whether it is necessary to obtain the trigger period. If so, record the current timing value to obtain the first trigger moment; and when the interrupt program is triggered next time, record the current timing value to obtain the second trigger moment; and subtract the first trigger moment from the second trigger moment to obtain the trigger period.

5. A phase synchronization method according to claim 4, characterized in that: The reacquiring the trigger period comprises: Setting the first triggering time to zero; The trigger interrupt procedure then includes: Determine whether the first trigger time is zero, if so, record the current timing value as the first trigger time; if not, record the current timing value as the second trigger time.

6. A phase synchronization method according to claim 4, characterized in that: The reacquiring the trigger period comprises: Marking the state value as a first preset value; The determining whether the trigger period needs to be obtained includes: Determine whether the state value is a first preset value, if so, execute the step of obtaining the trigger period; if not, exit the interrupt program.

7. A phase synchronization method according to claim 6, characterized in that: The obtaining of the initial time includes: The state value is marked as a second preset value.

8. A phase synchronization method according to claim 1, characterized in that: The step of obtaining the time for the edge trigger module working voltage to increase from 0 to the threshold voltage comprises: ; in, Indicates the threshold time; Represents the threshold voltage.

Citation Information

Patent Citations

  • Zero-crossing synchronization pulse signal circuit of power grid

    CN104539267A

  • Zero crossing point counting acquisition method and counting acquisition system of alternating current signal

    CN118275763A