Power factor calibration method and electronic equipment

By detecting the zero crossing point of voltage and current signals, determining the phase difference and period, and adjusting the PWM signal, the problem of power factor calibration in the prior art requires a high-performance processor, real-time calibration and efficient circuit design are achieved.

CN119644013APending Publication Date: 2025-03-18BEIJING SHICHANGDING TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411791752.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The prior art requires high frequency and high computing power processors or DSPs when implementing power factor calibration (PFC), and software needs to process voltage and current signal tracking and synchronize PWM output, resulting in increased complexity and cost.

Method used

By detecting whether the voltage signal and current signal of the mains AC input have zero crossings, the PWM change amount is determined based on the phase difference and period, power factor calibration is achieved without software intervention or powerful processor computing capabilities.

Benefits of technology

Real-time adjustment of power factors calibrated PWM signals is realized according to load changes, reducing dependence on processor performance, simplifying the circuit structure, and improving the reliability and efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119644013A_ABST
    Figure CN119644013A_ABST
Patent Text Reader

Abstract

The invention provides a power factor calibration method and electronic equipment. The method comprises the following steps: detecting whether a voltage signal and a current signal input by mains supply alternating current have zero crossing points or not; determining a phase difference and a period based on the time point of the zero crossing point of the voltage signal and the time point of the zero crossing point of the current signal; a PWM variation is determined based on the phase difference and the period. In the mode, the PWM signal for power factor calibration can be adjusted in real time according to the change of the load, software or too much software intervention is not needed, and the operational capability of a strong processor is not needed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of power factor calibration, and in particular to a power factor calibration method and electronic equipment. Background Art

[0002] As the application scope of electronic devices becomes wider and wider, the power requirements of electronic devices are also increasing. This also requires electronic devices to add power calibration factor circuits to prevent electronic devices from affecting the efficiency of the power grid of the power supplier due to charging and discharging. There are several types of electronic devices in the charging system: resistive load, capacitive load, inductive load. Electronic devices generally use the above three types of loads or the combination of these three types of loads; if the load type of the electronic device is a capacitive load, an inductive load or a combination of the above two loads, it will affect the voltage and current phase of the AC power; in order to improve the conversion efficiency and not affect the power grid of the power supplier, the voltage and current phase deviation caused by the capacitive load and the inductive load must be calibrated back. The calibration method is called Power Factor Correction (PFC).

[0003] The existing technology for implementing power factor calibration (PFC) is to use a high-speed and high-cost MCU (Microcontroller Unit) with a PI (Proportional Integral) or PID (Proportional Integral Derivative) algorithm to track the voltage and current waveforms and phases. However, the biggest problem with this method is that it requires a high-frequency and high-computing processor or DSP (Digital Signal Processor) to process; after the software or hardware processes the voltage and / or current signal tracking, the software also needs to ensure the synchronization of the control PWM (Pulse Width Modulation) output. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a power factor calibration method and electronic device to adjust the power factor calibrated PWM signal in real time according to the change of load, which does not require software or too much software intervention, nor does it require the computing power of a powerful processor.

[0005] In the first aspect, an embodiment of the present invention provides a power factor calibration method, the method comprising: detecting whether the voltage signal and the current signal of the AC power input of the mains electricity pass through zero; determining the phase difference and the period based on the time point when the voltage signal passes through zero and the time point when the current signal passes through zero; determining the PWM change based on the phase difference and the period.

[0006] In an optional embodiment of the present application, the step of determining the phase difference based on the time point when the voltage signal crosses zero and the time point when the current signal crosses zero includes: starting counting when the voltage signal crosses zero, ending counting when the current signal crosses zero, and using the counting time difference as the phase difference between the voltage signal and the current signal; or, starting counting when the current signal crosses zero, ending counting when the voltage signal crosses zero, and using the counting time difference as the phase difference between the current signal and the voltage signal.

[0007] In an optional embodiment of the present application, the step of determining the period based on the time point when the voltage signal crosses zero and the time point when the current signal crosses zero includes: starting counting when the voltage signal crosses zero, and ending counting when the voltage signal crosses zero again, and using the time difference in counting as the period of the voltage signal; or, starting counting when the current signal crosses zero, and ending counting when the current signal crosses zero again, and using the time difference in counting as the period of the current signal.

[0008] In an optional embodiment of the present application, the above-mentioned step of detecting whether the voltage signal and current signal of the AC power input pass through zero point includes: detecting whether the voltage signal of the AC power input passes through zero point through a first analog comparator; detecting whether the current signal of the AC power input passes through zero point through a second analog comparator.

[0009] In an optional embodiment of the present application, the steps of starting counting when the voltage signal passes through zero, and ending counting when the current signal passes through zero, include: the first analog comparator sends a first flag signal to the counter when the voltage signal passes through zero, and the counter starts counting based on the first flag signal; the second analog comparator sends a second flag signal to the counter when the current signal passes through zero, and the counter ends counting based on the second flag signal; the steps of starting counting when the current signal passes through zero, ending counting when the voltage signal passes through zero, and using the counting time difference as the phase difference between the current signal and the voltage signal include: the second analog comparator sends a third flag signal to the counter when the current signal passes through zero, and the counter starts counting based on the third flag signal; the first analog comparator sends a fourth flag signal to the counter when the voltage signal passes through zero, and the counter ends counting based on the fourth flag signal.

[0010] In an optional embodiment of the present application, counting starts when the voltage signal passes through zero, and ends when the voltage signal passes through zero again, and the step of using the counting time difference as the period of the voltage signal includes: when the first analog comparator detects that the voltage signal passes through zero, it sends a fifth flag signal to the counter, and the counter starts counting based on the fifth flag signal; when the first analog comparator detects that the voltage signal passes through zero again, it sends a sixth flag signal to the counter, and the counter ends counting based on the sixth flag signal; counting starts when the current signal passes through zero, and ends when the current signal passes through zero again, and the step of using the counting time difference as the period of the current signal includes: when the second analog comparator detects that the current signal passes through zero, it sends a seventh flag signal to the counter, and the counter starts counting based on the seventh flag signal; when the second analog comparator detects that the current signal passes through zero again, it sends an eighth flag signal to the counter, and the counter ends counting based on the eighth flag signal.

[0011] In an optional embodiment of the present application, the above-mentioned step of determining the PWM change amount based on the phase difference and the period includes: determining the ratio of the phase difference and the period, and adjusting the PWM duty cycle or PWM frequency of the PWM controller based on the ratio.

[0012] In an optional embodiment of the present application, the above-mentioned step of adjusting the PWM duty cycle or PWM frequency of the PWM controller based on the ratio includes: if the ratio is greater than a preset threshold, adjusting the PWM frequency of the PWM controller; if the ratio is less than or equal to the threshold, adjusting the PWM duty cycle of the PWM controller.

[0013] In an optional embodiment of the present application, the above method also includes: determining whether the voltage or current detected by the ADC suddenly rises or falls; if the voltage detected by the ADC suddenly rises or falls, adjusting the PWM duty cycle and / or PWM frequency of the PWM controller to cope with the sudden rise or fall of the voltage; if the current detected by the ADC suddenly rises or falls, adjusting the PWM duty cycle and / or PWM frequency of the PWM controller to cope with the sudden rise or fall of the current.

[0014] In a second aspect, an embodiment of the present invention further provides an electronic device, which is used to execute the above-mentioned power factor calibration method.

[0015] The embodiments of the present invention bring the following beneficial effects:

[0016] The embodiment of the present invention provides a power factor calibration method and electronic device, which detects whether the voltage signal and current signal of the AC power input of the mains electricity pass through zero; determines the phase difference and the period based on the time point when the voltage signal passes through zero and the time point when the current signal passes through zero; and determines the PWM change amount that needs to be adjusted based on the proportion of the phase difference to the period. In this way, the PWM signal for power factor calibration can be adjusted in real time according to the change of the load, and neither software or too much software intervention is required, nor the computing power of a powerful processor is required.

[0017] Other features and advantages of the present disclosure will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.

[0018] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 A flow chart of a power factor calibration method provided by an embodiment of the present invention;

[0021] Figure 2 A schematic diagram of the phase relationship between voltage and current of different load types provided by an embodiment of the present invention;

[0022] Figure 3 A schematic diagram of an existing power factor calibration implementation method provided by an embodiment of the present invention;

[0023] Figure 4 A schematic diagram of a power factor calibration implementation method provided by an embodiment of the present invention;

[0024] Figure 5 A schematic diagram of a phase difference φ and an amplitude difference б of a PFC output PWM adjustment condition provided by an embodiment of the present invention;

[0025] Figure 6 A schematic diagram of a power factor calibration process provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0027] At present, as the application scope of electronic devices becomes wider and wider, the power requirements of electronic devices are also increasing. This also requires electronic devices to add power calibration factor circuits to prevent electronic devices from affecting the efficiency of the power grid of the power supplier due to charging and discharging. There are several types of electronic devices in the charging system: resistive load, capacitive load, inductive load. Electronic devices generally use the above three types of loads or the three types of combined loads; if the load type of the electronic device is a capacitive load, an inductive load or a combination of the above two loads, it will affect the voltage and current phase of the AC power; in order to improve the conversion efficiency and not affect the power grid of the power supplier, the voltage and current phase deviation caused by the capacitive load and the inductive load must be calibrated back. The calibration method is called power factor calibration (PFC).

[0028] The existing technology for implementing power factor correction (PFC) is to use a high-speed and high-cost MCU with PI or PID algorithm to track the voltage and current waveforms and phases. However, the biggest problem with this method is that it requires a high-frequency and high-computing processor or DSP to process; after the software or hardware processes the voltage and / or current signal tracking, the software also needs to ensure the synchronization of the control PWM output.

[0029] Based on this, a power factor calibration method and electronic device provided in an embodiment of the present invention specifically provide a circuit structure and method for a new adapter power factor calibration PFC, which can adjust the PWM signal of the power factor calibration in real time according to the change of the load, without requiring software or too much software intervention, and without requiring the computing power of a powerful processor.

[0030] To facilitate understanding of this embodiment, a power factor calibration method disclosed in an embodiment of the present invention is first introduced in detail.

[0031] Embodiment 1:

[0032] The embodiment of the present invention provides a power factor calibration method, see Figure 1 A flow chart of a power factor calibration method is shown, the power factor calibration method comprising the following steps:

[0033] Step S102, detecting whether the voltage signal and the current signal of the AC power input of the mains electricity pass through zero.

[0034] In this embodiment, the zero-crossing points of the voltage signal and the current signal of the AC power input of the mains can be detected by the circuit respectively.

[0035] Step S104, determining the phase difference and the period based on the time point when the voltage signal crosses zero and the time point when the current signal crosses zero.

[0036] In this embodiment, the phase difference and the period may be determined based on the time point at which the voltage signal crosses zero and the time point at which the current signal crosses zero.

[0037] In some embodiments, counting starts when the voltage signal passes through zero, and ends when the current signal passes through zero, and the time difference in counting is used as the phase difference between the voltage signal and the current signal; or, counting starts when the current signal passes through zero, and ends when the voltage signal passes through zero, and the time difference in counting is used as the phase difference between the current signal and the voltage signal.

[0038] For the voltage signal and the current signal, this embodiment can start counting when the first signal passes through zero, and end counting when the second signal passes through zero, and use the counting time difference as the phase difference between the first signal and the second signal.

[0039] For example: the counting starts when the voltage signal passes through zero, and the counting ends when the current signal passes through zero. The time difference of counting can be regarded as the phase difference between the voltage signal and the current signal; or, the counting starts when the current signal passes through zero, and the counting ends when the voltage signal passes through zero. The time difference of voltage and current obtained from the analog comparator can tell the phase difference between voltage and current, that is, whether the voltage leads or lags behind the current phase difference.

[0040] In some embodiments, counting starts when the voltage signal passes through zero, and ends when the voltage signal passes through zero again, and the time difference of counting is used as the period of the voltage signal; or, counting starts when the current signal passes through zero, and ends when the current signal passes through zero again, and the time difference of counting is used as the period of the current signal. Under normal circumstances, the periods or frequencies of the current and voltage are the same.

[0041] For the voltage signal and the current signal, this embodiment can start counting when the first signal passes through zero, and end counting when the first signal passes through zero again, and use the counting time difference as the period of the first signal.

[0042] For example: when the voltage signal passes through zero, the counting starts, and when the voltage signal passes through zero again, the counting ends, and the counting time difference is used as the period of the voltage signal. Alternatively, when the current signal passes through zero, the counting starts, and when the current signal passes through zero again, the counting ends, and the counting time difference is used as the period of the current signal.

[0043] Step S106, determining the PWM variation based on the phase difference and the period.

[0044] After determining the phase difference and the period, this embodiment can determine the PWM variation based on the phase difference and the period through hardware.

[0045] The embodiment of the present invention provides a power factor calibration method, which detects whether the voltage signal and current signal of the AC power input of the mains electricity pass through zero; determines the phase difference and the period based on the time point when the voltage signal passes through zero and the time point when the current signal passes through zero; and determines the PWM change amount that needs to be adjusted based on the proportion of the phase difference to the period. In this way, the PWM signal for power factor calibration can be adjusted in real time according to the change of the load, and neither software or too much software intervention is required, nor the computing power of a powerful processor is required.

[0046] Embodiment 2:

[0047] This embodiment provides another power factor calibration method, which is implemented on the basis of the above embodiment. This embodiment focuses on describing the circuit and specific method for implementing power factor calibration.

[0048] See also Figure 2 A schematic diagram of the voltage and current phase relationship for different load types is shown in FIG. Figure 2 The figure shows the phase relationship between voltage and current for different load types; the current waveform on the left indicates that the device is a capacitive load; the current waveform in the middle indicates that the device is a resistive load; and the current waveform on the right indicates that the device is an inductive load. The main purpose of power factor calibration is to eliminate the phase difference between the voltage and current waveforms.

[0049] See also Figure 3 A schematic diagram of an existing power factor calibration implementation method is shown in FIG. Figure 3 As shown, in addition to the comparator, ADC (Analog to Digital Converter), DAC (Digital to Analog Converter), sine wave generator, filter, reading value mapping and disturbance, a PID controller, a signal processing unit, a CPU (Central Processing Unit) processor, a storage device and a PWM controller are also required.

[0050] Among them, the PWM controller adjustment parameters also need to be converted by the CPU processor. The delay of this part for software processing is uncontrollable, and the processing priority needs to be specially handled, otherwise there may be surges. In other words, this architecture can theoretically improve the power factor, but because the power system is high voltage, but this system uses high-performance processors and basically requires working below 5V. If this system is to work properly, the peripheral circuit needs to do additional processing and requires a large storage space and processor, and the system operating frequency must be above 100MHz. Otherwise, the calculated power factor will not only not improve but may even decrease. Even if a lot of costs are spent to improve the power factor, the total harmonic distortion of the output will deteriorate because a lot of circuits have been added.

[0051] See also Figure 4 A schematic diagram of a power factor calibration implementation method is shown in FIG. Figure 4 The circuit system architecture of this embodiment for improving the power factor is shown. Figure 4 It can be seen that this new circuit structure only needs a comparator, a counter and a PWM controller to perfectly track the voltage and current phases and improve the power factor.

[0052] like Figure 4 As shown, this embodiment uses comparators for voltage and current loops to detect, and the two comparators detect the zero crossing points of the voltage signal and the current signal respectively. This embodiment uses the time point of the voltage signal and the current signal to detect the zero crossing point to determine whether the voltage or current phase leads.

[0053] In some embodiments, a first analog comparator is used to detect whether a voltage signal of the AC mains input crosses a zero point; and a second analog comparator is used to detect whether a current signal of the AC mains input crosses a zero point.

[0054] like Figure 4 As shown, the working principle of this embodiment is: two analog comparators detect the zero-crossing points of the voltage signal and the current signal respectively. Considering that the actual load change will cause the voltage signal and the current signal to not be an ideal sine wave, this comparator will have a hysteresis function to provide a window to ensure that the zero-crossing point detected by the comparator will not produce oscillation.

[0055] In some embodiments, the first analog comparator detects that the voltage signal passes through zero and sends a first flag signal to the counter, and the counter starts counting based on the first flag signal; the second analog comparator detects that the current signal passes through zero and sends a second flag signal to the counter, and the counter stops counting based on the second flag signal.

[0056] Alternatively, when the second analog comparator detects that the current signal passes through zero, it sends a third flag signal to the counter, and the counter starts counting based on the third flag signal; when the first analog comparator detects that the voltage signal passes through zero, it sends a fourth flag signal to the counter, and the counter ends counting based on the fourth flag signal.

[0057] like Figure 4 As shown, the voltage comparator (i.e., the first analog comparator mentioned above) or the current comparator (i.e., the second analog comparator mentioned above) generates a flag signal to notify the other party when detecting the zero crossing point, and the counter can start counting according to the flag signal to calculate the phase difference.

[0058] For example, if the voltage crosses zero first, the voltage comparator generates zvs_flag (i.e., the first flag signal mentioned above), and the counter starts counting according to zvs_flag. When the counter sees the zero-crossing signal zcs_flag (i.e., the second flag signal mentioned above) generated by the current comparator, the count value of the counter at this time is the phase difference between the voltage leading the current. Vice versa, when the current comparator detects the zero-crossing zcs_flag signal (i.e., the third flag signal mentioned above) first, this signal will notify the counter to start counting. When the counter detects the zvs_flag of the voltage comparator (i.e., the fourth flag signal mentioned above), the comparison value of the current comparator is the phase difference between the current leading the voltage.

[0059] In some embodiments, when the first analog comparator detects that the voltage signal crosses zero, it sends a fifth flag signal to the counter, and the counter starts counting based on the fifth flag signal; when the first analog comparator detects that the voltage signal crosses zero again, it sends a sixth flag signal to the counter, and the counter ends counting based on the sixth flag signal.

[0060] Alternatively, when the second analog comparator detects that the current signal crosses zero, it sends a seventh flag signal to the counter, and the counter starts counting based on the seventh flag signal; when the second analog comparator detects that the current signal crosses zero again, it sends an eighth flag signal to the counter, and the counter ends counting based on the eighth flag signal.

[0061] like Figure 4 As shown, after the phase difference is detected, the counter continues to count until the next zero-crossing count value is detected. This count value is the frequency of the voltage or current. Generally, the frequency of AC power is between 47Hz-63Hz. If the voltage leads the current, the zero-crossing reference of the frequency detection step is the voltage. If the current leads the voltage, the zero-crossing reference of the frequency detection step is the current.

[0062] In summary, this embodiment only needs to use two comparators to detect the zero point and then use a digital counter to determine the phase difference of voltage and current and calculate the frequency of voltage and current. There are two frequencies of AC power: 50Hz and 60Hz. Taking 50Hz as an example, the PWM frequency is 100KHz. The error introduced by the calculation method provided by this embodiment is 0.05%; if the PWM frequency is increased, the error introduced by the calculation will decrease proportionally. Therefore, the method provided by this embodiment is more reliable and faster than the traditional method of using CPU or DSP for calculation.

[0063] In some embodiments, a ratio of the phase difference to the period may be determined, and a PWM duty cycle or a PWM frequency of a PWM controller may be adjusted based on the ratio.

[0064] like Figure 4 As shown, the PWM duty cycle or PWM frequency of the PWM controller can be adjusted according to the phase difference and the proportion of the period.

[0065] If the ratio is greater than a preset threshold, the PWM frequency of the PWM controller is adjusted; if the ratio is less than or equal to the threshold, the PWM duty cycle of the PWM controller is adjusted.

[0066] For example, if the ratio of the phase difference to the period is greater than a preset threshold, the PWM frequency may be adjusted; if the ratio of the phase difference to the period is less than the preset threshold, the PWM duty cycle may be adjusted.

[0067] In some embodiments, it can also be determined whether the voltage or current detected by the ADC suddenly rises or falls; if the voltage detected by the ADC suddenly rises or falls, the PWM duty cycle and / or PWM frequency of the PWM controller is adjusted; if the current detected by the ADC suddenly rises or falls, the PWM duty cycle and / or PWM frequency of the PWM controller is adjusted to cope with the sudden rise or fall of the current.

[0068] like Figure 4 As shown, the PWM controller adjusts the PWM frequency and / or the PWM duty cycle according to the ratio of the phase difference and the period. In addition, there can be a way to receive the Vpfc voltage detected by the ADC to see if there is a sudden rise or fall. If there is a sudden rise or fall, it means that the electronic device now has a large load change demand and requires the PWM controller to quickly adjust the PWM frequency and / or the PWM duty cycle; adjusting the PWM controller through the ADC can be regarded as a software mode.

[0069] See also Figure 5 A schematic diagram of a PFC output PWM adjustment condition phase difference φ and amplitude difference б is shown, Figure 5The chopping on the right side of the middle is the clock cycle of the latch comparison of the front and back stages of the internal comparator. When the latch comparison clock is faster, the chopping time interval is smaller, and the relative amplitude difference б will also be smaller, which means that the sine wave tracking of the power grid will be more accurate. When the load changes more, the phase difference φ of the current and / or voltage of the previous and next cycles will also become relatively larger; when the phase becomes larger, it means that the current and / or voltage required by the load is larger, at this time, the PWM frequency needs to be faster or / and the duty cycle needs to be increased.

[0070] On the contrary, when the phase difference between the previous and next cycles becomes smaller, it means that the voltage and / or current required by the load change is smaller. At this time, the PWM frequency needs to be slowed down and / or the duty cycle needs to be reduced or unchanged. The fastest adjustment of PWM frequency refresh is one sine wave adjustment, which is adjusted when it crosses the zero point. The greater the amplitude difference before and after the latch comparison, the larger the PWM duty cycle should be. On the contrary, when the amplitude difference before and after the latch comparison is smaller, the PWM duty cycle should be smaller accordingly.

[0071] For the overall process of power factor calibration and adjustment in the embodiment of the present invention, please refer to Figure 6 The schematic diagram of a power factor calibration process shown in the figure, the embodiment of the present invention uses voltage and current zero-crossing detection and a counter to calculate the phase difference between voltage and current and the frequency of voltage and / or current. Based on the ratio of phase difference to frequency, the frequency and / or duty cycle of the PWM controller is adjusted to achieve the purpose of adjusting the phase of voltage or current.

[0072] In summary, the power factor calibration method provided in the embodiment of the present invention can be applied to application scenarios such as adapters, socket strips, energy storage, AC-DC primary voltage reduction, and AC-DC secondary voltage reduction.

[0073] The power factor calibration method provided by the embodiment of the present invention can be applied to both bridgeless totem-pole and bridge circuit architectures.

[0074] The power factor calibration method provided in the embodiment of the present invention can digitize the power factor calibration circuit and improve the reliability of the circuit; the entire control loop has a fast response time and does not use DSP and processor calculations; the modules required for the entire power supply path are simplified; and because the number of step-down stages is reduced, the overall efficiency is improved.

[0075] Embodiment three:

[0076] Corresponding to the above method embodiment, an embodiment of the present invention provides an electronic device for executing the power factor calibration method provided by the above embodiment.

[0077] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and / or device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0078] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0079] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0080] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.

[0081] Finally, it should be noted that the above embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A power factor calibration method, characterized in that: The method comprises: Detect whether the voltage signal and current signal of AC power input from the mains electricity pass through zero; Determine the phase difference and the period based on the time point at which the voltage signal passes through zero and the time point at which the current signal passes through zero; A PWM variation amount is determined based on the phase difference and the period.

2. The method according to claim 1, characterized in that The step of determining the phase difference based on the time point at which the voltage signal passes through zero and the time point at which the current signal passes through zero comprises: Counting starts when the voltage signal passes through zero, and ends when the current signal passes through zero, and the counting time difference is used as the phase difference between the voltage signal and the current signal; Alternatively, counting starts when the current signal passes through zero, and counting ends when the voltage signal passes through zero, and the counting time difference is used as the phase difference between the current signal and the voltage signal.

3. The method according to claim 2, characterized in that The step of determining the period based on the time point at which the voltage signal crosses zero and the time point at which the current signal crosses zero comprises: When the voltage signal passes through zero, counting starts, and when the voltage signal passes through zero again, counting ends, and the time difference of counting is used as the period of the voltage signal; Alternatively, counting starts when the current signal passes through zero, and ends when the current signal passes through zero again, and the counting time difference is used as the period of the current signal.

4. The method according to claim 3, characterized in that The steps of detecting whether the voltage signal and the current signal of the AC power input of the mains power have zero crossings include: Detecting whether the voltage signal of the AC power input from the mains passes through a zero point by means of a first analog comparator; The second analog comparator is used to detect whether the current signal of the AC power input from the mains passes through a zero point.

5. The method according to claim 4, characterized in that The step of starting counting when the voltage signal passes through zero and ending counting when the current signal passes through zero comprises: When the first analog comparator detects that the voltage signal crosses zero, it sends a first flag signal to the counter, and the counter starts counting based on the first flag signal; when the second analog comparator detects that the current signal crosses zero, it sends a second flag signal to the counter, and the counter stops counting based on the second flag signal; The step of starting counting when the current signal passes through zero, ending counting when the voltage signal passes through zero, and using the counting time difference as the phase difference between the current signal and the voltage signal comprises: When the second analog comparator detects that the current signal passes through zero, it sends a third flag signal to the counter, and the counter starts counting based on the third flag signal; when the first analog comparator detects that the voltage signal passes through zero, it sends a fourth flag signal to the counter, and the counter ends counting based on the fourth flag signal.

6. The method according to claim 5, characterized in that The step of starting counting when the voltage signal passes through zero, ending counting when the voltage signal passes through zero again, and taking the counting time difference as the period of the voltage signal comprises: When the first analog comparator detects that the voltage signal crosses zero, it sends a fifth flag signal to the counter, and the counter starts counting based on the fifth flag signal; when the first analog comparator detects that the voltage signal crosses zero again, it sends a sixth flag signal to the counter, and the counter stops counting based on the sixth flag signal; The step of starting counting when the current signal passes through zero, ending counting when the current signal passes through zero again, and taking the counting time difference as the period of the current signal comprises: When the second analog comparator detects that the current signal crosses zero, it sends a seventh flag signal to the counter, and the counter starts counting based on the seventh flag signal. When the second analog comparator detects that the current signal crosses zero again, it sends an eighth flag signal to the counter, and the counter ends counting based on the eighth flag signal.

7. The method according to claim 1, characterized in that The step of determining the PWM variation based on the phase difference and the period comprises: A ratio of the phase difference to the period is determined, and a PWM duty cycle or a PWM frequency of a PWM controller is adjusted based on the ratio.

8. The method according to claim 7, characterized in that The step of adjusting the PWM duty cycle or the PWM frequency of the PWM controller based on the ratio comprises: If the ratio is greater than a preset threshold, adjusting the PWM frequency of the PWM controller; If the ratio is less than or equal to the threshold, the PWM duty cycle of the PWM controller is adjusted.

9. The method according to claim 1, characterized in that: The method further comprises: Determine whether the voltage or current detected by the ADC has a sudden rise or fall; If the voltage detected by the ADC suddenly rises or falls, adjust the PWM duty cycle and / or PWM frequency of the PWM controller to cope with the sudden rise or fall of the voltage; If the current detected by the ADC suddenly increases or decreases, the PWM duty cycle and / or PWM frequency of the PWM controller is adjusted to cope with the sudden increase or decrease of the current.

10. An electronic device, characterized in that: The electronic device is used to execute the power factor calibration method according to any one of claims 1 to 9.