Phase compensation method and system for power test unit
By acquiring and applying the delay amount of the current and voltage signals in the debugging mode, the accuracy and flexibility problems of the phase compensation method in the existing technology under low power factors are solved, and the accuracy of the sampling time of the voltage and current signals is achieved. Adjustment improves the accuracy and applicable scope of power testing and reduces costs.
Patent Information
- Application Number
- CN202410985047.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-07-23
AI Technical Summary
Existing phase compensation methods are difficult to achieve accurate, flexible and cost-effective phase compensation in low power factor power analysis, especially in the new energy industry, especially under the low power factor of photovoltaic inverter module reactance, where the phase difference affects the active power Accuracy of power measurements.
By obtaining the delay amount between the standard source current and voltage in the debugging mode, and applying the delay amount in the test mode, the sampling moments of the voltage and current signals are delayed, thereby achieving phase compensation and reducing the phase difference. influence and improve the accuracy of power testing.
It achieves precise adjustment of the sampling time of voltage and current signals, reduces the impact of phase difference introduced by hardware factors, improves the accuracy and applicable scope of power testing, and reduces the cost without adding a large amount of hardware resources.
Smart Images

Figure CN118518932B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of phase compensation, and in particular to a phase compensation method and system for a power test unit. Background Art
[0002] In the measurement of power testing, the power accuracy of AC voltage (or current) is an important measurement item. While measuring the accuracy of voltage and current, how to eliminate the phase difference of voltage and current analog sampling has become an industry pain point, especially in the new energy industry, where the power consumption test of the photovoltaic inverter module reactance under low power factor is particularly important. Most new energy-related power tests not only involve local testing, but also large currents require the connection of equipment such as transformers. Therefore, accurately compensating for the test path phase deviation has become an industry pain point.
[0003] The power test formula is: , where n is the number of sampling points per unit time, u i is the instantaneous sampling value of voltage, i i Instantaneous current sampling value, in addition to ensuring u i and i i In addition to the accuracy of u i and i i The phase difference introduced at the sampling time due to hardware and other factors is also an important factor affecting the active power measurement.
[0004] At present, there are two most commonly used phase compensation methods: one is the memory buffer method, and the other is the hardware compensation method.
[0005] The memory buffer method adjusts the sampling point phase by increasing the cache through voltage and current sampling. Before data calculation, the voltage and current sampling point data need to be stored in the cache. Before calculation, the data is moved back and forth in units of sampling time to achieve the effect of phase adjustment.
[0006] The advantages of this method are that it is not affected by external and load conditions, and the offset time can be controlled accurately and controllably. The disadvantages are: (1) the offset step is the sampling period. For example, if the sampling rate is 500kHz, the minimum adjustable time unit is 1 / 500kHz=2us. However, when the actual offset time is less than this time, the compensation value cannot be equal to the actual offset value, and there will be a deviation. (2) The high-speed sampling cache requires the addition of some high-speed cache hardware, which is costly and has higher requirements for algorithm processing.
[0007] The hardware compensation method is to delay the signal through the RC unit so that the voltage or current analog path can obtain fixed phase compensation.
[0008] The advantages of this method are low cost and only a small number of components need to be added to achieve it. The disadvantages are: (1) fixed loads and hardware conditions are limited. RC has a filtering effect and is accurate as a delay circuit, but it has a weakening effect on wideband signals. (2) Changes are not flexible. Adjusting the delay requires changing the hardware circuit. If applied to products, this will affect later maintenance.
[0009] Therefore, how to find a phase compensation method with precise modulation, small step and adaptability to multiple scenarios has become an important problem in the field of low power factor power analysis.
[0010] The above information disclosed in the background technology is only used to increase the understanding of the background technology of the present application, and therefore, it may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0011] The purpose of an embodiment of the present invention is to provide a phase compensation method for a power test unit, which obtains the time delay between a standard source current and a standard source voltage in a debugging mode, and applies it to a test mode to generate a CNV signal with a time delay to change the sampling time of a test voltage signal and a test current signal, thereby achieving a phase compensation effect, reducing the impact on the phase difference between current and voltage, and improving the accuracy of power testing.
[0012] In order to achieve the above-mentioned purpose, the present invention adopts the following technical solutions:
[0013] The present application relates to a phase compensation method for a power test unit, including a debugging mode and a test mode, wherein the debugging mode includes the following steps:
[0014] Dividing a clock source having a preset frequency into a first clock signal and a second clock signal, wherein the frequencies of the first clock signal and the second clock signal are equal;
[0015] Processing the first clock signal into a voltage CNV signal;
[0016] Processing the second clock signal into a current CNV signal;
[0017] Using the voltage CNV signal, the standard source voltage signal is processed into a voltage zero-crossing waveform;
[0018] Using the current CNV signal, the standard source current signal is processed into a current zero-crossing waveform, and the standard source current signal and the standard source voltage signal have the same phase;
[0019] Based on the current zero-crossing waveform and the voltage zero-crossing waveform, respectively extracting the current and voltage signal zero-crossing information;
[0020] Based on the extracted zero-crossing information of the current and voltage signals, a time delay between the current and voltage is obtained;
[0021] Storing the delay amount;
[0022] The test mode comprises the following steps:
[0023] Reading the delay amount;
[0024] Using the delay amount, dividing a clock source with a preset frequency into a first test clock signal and a second test clock signal, wherein the frequencies of the first test clock signal and the second test clock signal are equal;
[0025] Processing the first test clock signal into a test voltage CNV signal;
[0026] Processing the second test clock signal into a test current CNV signal;
[0027] Using the test voltage CNV signal, sampling the test voltage signal;
[0028] Using the test current CNV signal, sampling the test current signal;
[0029] Power calculation is performed based on the sampled test voltage signal and the test current signal.
[0030] In some embodiments of the present application, the phase compensation method further includes a switching mode for controlling switching between a debugging mode and a test mode, and the switching mode includes the following steps:
[0031] When switching to the debugging mode, configuring a write address for storing the delay amount;
[0032] When switching to the test mode, a read address for reading the delay amount is configured.
[0033] In some embodiments of the present application, in the debugging mode, all steps in the debugging mode are looped in sequence to obtain multiple delay amounts written at different addresses;
[0034] In the test mode, the delay amount at the corresponding address is read accordingly.
[0035] In some embodiments of the present application, the frequency division frequency of the clock source in the debug mode is greater than the frequency division frequency of the clock source in the test mode.
[0036] In some embodiments of the present application, based on the current zero-crossing waveform and the voltage zero-crossing waveform, the current and voltage signal zero-crossing information is extracted respectively, specifically, a plurality of current zero-crossing moments and a plurality of corresponding voltage zero-crossing moments are obtained;
[0037] Based on the extracted current and voltage signal zero-crossing information, the time delay between the current and voltage is obtained, specifically:
[0038] Obtain the number of sampling points between each current zero-crossing moment and the corresponding voltage zero-crossing moment;
[0039] Calculate the average value of the number of sampling points;
[0040] The product of the average value and the current sampling period is taken as the time delay.
[0041] In some embodiments of the present application, the power calculation includes:
[0042] Calculate active power;
[0043] Calculate the apparent power;
[0044] Calculate reactive power;
[0045] Calculate the power factor.
[0046] The phase compensation method involved in the present application uses a standard source voltage signal and a standard source current signal to obtain a time delay in a debugging mode, and applies the time delay to a voltage CNV signal and a current CNV signal in a test mode to generate a CNV signal with a time delay, thereby changing the sampling time of the test voltage signal and the test current signal, avoiding the phase difference introduced by hardware and other factors, achieving phase compensation, and improving the accuracy of power testing.
[0047] The present application also relates to a phase compensation system for a power test unit, comprising:
[0048] A clock source module, which is used to provide a clock source with a preset frequency;
[0049] A mode control module, which is used to configure a debug mode or a test mode;
[0050] A sampling and frequency division module, used for dividing the clock source into a first clock signal and a second clock signal in the debugging mode, based on that the frequencies of the first clock signal and the second clock signal are equal;
[0051] a voltage ADC controller, which processes the first clock signal into a voltage CNV signal in the debugging mode;
[0052] a current ADC controller, wherein in the test mode, the second clock signal is processed into a current CNV signal;
[0053] A voltage acquisition module, which uses the voltage CNV signal to process the standard source voltage signal into a voltage zero-crossing waveform in the debugging mode;
[0054] A current acquisition module, which uses the current CNV signal to process the standard source current signal into a current zero-crossing waveform in the debugging mode, and the standard source current signal and the standard source voltage signal have the same phase;
[0055] A zero point acquisition module, which receives the current zero point waveform and the voltage zero point waveform in the debugging mode, and extracts the zero crossing information of the current and voltage signals respectively;
[0056] A time delay calculation module, which obtains the time delay between the current and voltage based on the extracted current and voltage signal zero-crossing information;
[0057] A delay storage module, connected to the mode control module, for storing the delay amount obtained by the delay calculation module in the debugging mode;
[0058] Wherein, in the test mode, the sampling frequency division module divides the clock source into a first test clock signal and a second test clock signal using the delay amount from the delay storage module, and the frequencies of the first test clock signal and the second test clock signal are equal;
[0059] In the test mode, the voltage ADC controller processes the first test clock signal into a test voltage CNV signal, and the current ADC controller processes the second test clock signal into a test current CNV signal;
[0060] In the test mode, the voltage acquisition module samples the test voltage signal using the test voltage CNV signal, and the current acquisition module samples the test current signal using the current CNV signal;
[0061] The data processing unit performs power calculation based on the sampled test voltage signal and the test current signal.
[0062] In some embodiments of the present application, in the debugging mode, the mode control module configures the delay storage module to be in a write mode, and simultaneously issues a write address for storing the acquired delay amount;
[0063] The phase compensation system further comprises:
[0064] A delay reading module is respectively connected to the mode control module, the delay storage module and the sampling frequency division module, and is used to configure a reading address when the mode control module controls entry into the test module. The delay reading module uses the reading address to read the corresponding delay amount from the delay storage module and sends it to the sampling frequency division module.
[0065] In some embodiments of the present application, the frequency division frequency of the clock source in the debug mode is greater than the frequency division frequency of the clock source in the test mode.
[0066] In some embodiments of the present application, receiving the current zero-crossing waveform and the voltage zero-crossing waveform, and extracting the current and voltage signal zero-crossing information respectively specifically comprises obtaining a plurality of current zero-crossing moments and a plurality of corresponding voltage zero-crossing moments;
[0067] Based on the extracted current and voltage signal zero-crossing information, the time delay between the current and voltage is obtained, specifically:
[0068] Obtain the number of sampling points between each current zero-crossing moment and the corresponding voltage zero-crossing moment;
[0069] Calculate the average value of the number of sampling points;
[0070] The product of the average value and the current sampling period is taken as the time delay.
[0071] After reading the specific embodiments of the present invention in conjunction with the accompanying drawings, other features and advantages of the present invention will become more clear. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0073] Figure 1 A flow chart showing an embodiment of a phase compensation method for a power test unit in a debugging mode according to the present invention is shown;
[0074] Figure 2 A flow chart showing an embodiment of a phase compensation method for a power test unit in a test mode according to the present invention is shown;
[0075] Figure 3 A structural block diagram showing an embodiment of a phase compensation system for a power test unit provided by the present invention;
[0076] Figure 4 A waveform diagram showing that the voltage input signal and the current input signal involved in an embodiment of the phase compensation method for a power test unit proposed by the present invention are respectively a standard source voltage signal and a standard source current signal;
[0077] Figure 5 The voltage waveform and current waveform after being offset by the hardware circuit are shown;
[0078] Figure 6The waveform diagram of the voltage CNV signal and the current CNV signal obtained before compensation is shown;
[0079] Figure 7 A diagram showing the correspondence between the voltage CNV signal and the current CNV signal with the applied time delay (i.e. after compensation) and the voltage waveform and the current waveform after the offset;
[0080] Figure 8 The voltage ADC sampling point and the current ADC sampling point controlled according to the compensated CNV signal are shown.
[0081] Reference numerals:
[0082] 100, clock source module; 200, sampling and frequency division module; 310, voltage ADC controller; 320, current ADC controller; 410, voltage acquisition module; 420, current acquisition module; 500, zero point acquisition module; 610, delay calculation module; 620, delay storage module; 630, delay reading module; 700, data processing module; 800, mode control module. DETAILED DESCRIPTION
[0083] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0084] Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. In the description of the present invention, it should be understood that the orientation or position relationship indicated by the terms "center", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc. is based on the orientation or position relationship shown in the accompanying drawings, which is 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 a limitation on the present invention.
[0085] In the description of the present invention, it should be noted that, 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. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0086] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, "plurality" means two or more.
[0087] In the present application, in order to avoid the influence of the phase difference introduced by hardware and other factors on the power measurement at the current sampling time and the voltage sampling time, the present application solves this problem by phase compensation.
[0088] In some embodiments of the present application, a phase compensation method and system for a power test unit are provided. The phase compensation method is implemented by relying on a phase compensation system. Therefore, the phase compensation method will be described in conjunction with the phase compensation system as follows.
[0089] The power test unit refers to the unit, module or device that tests the power. The formula is Test, where n is the number of sampling points per unit time, u i is the instantaneous sampling value of voltage, i i is the instantaneous sampling value of current.
[0090] In some embodiments of the present application, see Figure 3 The phase compensation system includes a clock source module 100, a sampling frequency division module 200, a mode control module 800, a delay storage module 620, a delay calculation module 610, a zero point acquisition module 500, a voltage ADC controller 310, a current ADC controller 320, a voltage acquisition module 410, a current acquisition module 420 and a data processing module 700.
[0091] The phase compensation system includes a debugging mode and a testing mode.
[0092] This application adopts a timing preprocessing control mechanism to obtain the delay of the current hardware system through the debugging mode, and then in the test mode, the corresponding delay control sampling in the debugging mode is called up, and the phase-compensated data is obtained through sampling and calculation to improve the accuracy of power measurement.
[0093] In the debugging mode, a plurality of delay amounts can be acquired and stored. Correspondingly, in the testing mode, the stored corresponding delay amounts are retrieved.
[0094] Among them, one application scenario (for example, scenarios with different hardware systems, scenarios with different loads, etc.) corresponds to a delay amount. After multiple cycles of debugging mode, multiple sets of parameters can be debugged to adapt to different application scenarios.
[0095] When performing power tests in different application scenarios, different time delays are selected for phase compensation, which is highly targeted and has a good compensation effect. It also meets the requirements for flexible use in multiple application scenarios, thereby improving the scope of application of the phase compensation system.
[0096] In debugging mode, the phase compensation system includes a clock source module 100, a sampling and frequency division module 200, a mode control module 800, a delay storage module 620, a delay calculation module 610, a zero point acquisition module 500, a voltage ADC controller 310, a current ADC controller 320, a voltage acquisition module 410 and a current acquisition module 420.
[0097] In the test mode, the phase compensation system includes a clock source module 100, a sampling and frequency division module 200, a mode control module 800, a delay storage module 620, a delay calculation module 610, a zero point acquisition module 500, a voltage ADC controller 310, a current ADC controller 320, a voltage acquisition module 410, a current acquisition module 420 and a data processing module 700.
[0098] As follows, it will be combined Figure 3 The phase compensation system is shown and the phase compensation method is described in detail.
[0099] First, see Figure 1 , describes the debug mode.
[0100] In debug mode, the following steps will be performed respectively.
[0101] S11: Divide a clock source with a preset frequency into a first clock signal and a second clock signal.
[0102] The clock source module 100 provides a clock source with a preset frequency. In some embodiments of the present application, the preset frequency may be selected as 100 MHz. Optionally, the preset frequency may also be selected as other frequencies, which is not limited here.
[0103] The sampling and frequency division module 200 performs frequency division according to a clock source to generate two clock signals: a first clock signal and a second clock signal, wherein the frequencies of the first clock signal and the second clock signal are equal.
[0104] In some embodiments of the present application, the division frequency of the two clock signals may be selected to be 20 MHz. Optionally, the frequency may also be selected to be other frequencies, which is not limited here.
[0105] S12: Processing the first clock signal into a voltage CNV (Conversion start) signal.
[0106] In the debugging mode, the voltage ADC (Analog-to-Digital Converter) controller 310 is used to process the first clock signal into a voltage CNV (Conversion start) signal.
[0107] In some embodiments of the present application, the voltage ADC controller 310 is capable of tracking the first clock signal and converting it into a voltage CNV signal for controlling the voltage ADC conversion timing.
[0108] S13: Process the second clock signal into a current CNV signal.
[0109] In the debugging mode, the current ADC controller 320 is used to process the second clock signal into a current CNV signal.
[0110] In some embodiments of the present application, the current ADC controller 320 can track the second clock signal and convert it into a current CNV signal for controlling the current ADC conversion timing.
[0111] See also Figure 6 Shown are a voltage CNV signal before compensation and a current CNV signal before compensation.
[0112] S14: Using the voltage CNV signal, the standard source voltage signal is processed into a voltage zero-crossing waveform.
[0113] In some embodiments of the present application, in the debugging mode, in order to accurately obtain the time delay of the phase difference between the current and the voltage, a standard source voltage signal with the same phase is used (see Figure 4 voltage input signal shown) and a standard source current signal (see Figure 4 The current input signal shown in the figure is used for debugging to avoid phase deviation caused by the difference between voltage signal and current signal.
[0114] In order to implement the input of the standard source voltage signal, a voltage acquisition module 410 is provided.
[0115] The analog sampling voltage terminal of the voltage acquisition module 410 receives the standard source voltage signal as a voltage input signal.
[0116] The voltage CNV signal processed by the voltage ADC controller 310 is also sent to the voltage acquisition module 410 to control the voltage acquisition module 410 to sample the standard source voltage signal and provide a voltage zero-crossing waveform.
[0117] In some embodiments of the present application, the voltage acquisition module 410 includes an ADC, an operational amplifier, and a sampling device, and has two functions: (1) controlling the ADC analog-to-digital conversion according to the voltage CNV signal sent by the voltage ADC controller 310; and (2) amplifying and integrating the input signal to provide a voltage zero-crossing waveform.
[0118] S15: Using the current CNV signal, the standard source current signal is processed into a current zero-crossing waveform.
[0119] In order to implement the input of the standard source current signal, a current acquisition module 420 is provided.
[0120] The analog sampling current terminal of the current acquisition module 420 receives the standard source current signal as a current input signal.
[0121] The current CNV signal processed by the current ADC controller 320 is also sent to the current acquisition module 420 to control the current acquisition module 420 to sample the standard source current signal and provide a current zero-crossing waveform.
[0122] In some embodiments of the present application, the current acquisition module 420 also includes an ADC, an operational amplifier, and a sampling device, and also has two functions: (1) controlling the ADC analog-to-digital conversion according to the current CNV signal sent by the current ADC controller 320; and (2) amplifying and integrating the input signal to provide a current zero-crossing waveform.
[0123] The waveform diagram of the standard source voltage signal input by the voltage acquisition module 410 and the standard source current signal input by the current acquisition module 420 is shown in FIG. Figure 4 ; See the waveform after the hardware circuit generates the offset Figure 5 , so it can be explained that the voltage and current phase difference of the standard source voltage signal and the standard source current signal with the same phase should not be zero, but due to the phase offset introduced by the hardware, the following is produced Figure 5 The offset waveform is shown.
[0124] S16: Based on the current zero-crossing waveform and the voltage zero-crossing waveform, extract the current and voltage signal zero-crossing information respectively.
[0125] In some embodiments of the present application, the zero-point acquisition module 500 is used to extract the zero-crossing information of the current and voltage signals based on the current zero-crossing waveform and the voltage zero-crossing waveform.
[0126] In some embodiments of the present application, the zero-crossing information includes a signal zero-crossing moment, which may include multiple consecutive zero-crossing moments.
[0127] For the voltage zero-crossing waveform, multiple consecutive zero-crossing moments can be obtained. For example, the first five zero-crossing moments are obtained and recorded as Tu1 to Tu5.
[0128] For the current zero-crossing waveform, multiple consecutive zero-crossing moments can be obtained. For example, the first five zero-crossing moments are obtained and recorded as: Ti1~ Ti5.
[0129] Alternatively, another number of zero-crossing moments other than five may be selected.
[0130] The first voltage zero crossing moment corresponds to the first current zero crossing moment, the second voltage zero crossing moment corresponds to the second current zero crossing moment, the third voltage zero crossing moment corresponds to the third current zero crossing moment, the fourth voltage zero crossing moment corresponds to the fourth current zero crossing moment, and the fifth voltage zero crossing moment corresponds to the fifth current zero crossing moment.
[0131] S17: Based on the extracted zero-crossing information of the current and voltage signals, the time delay between the current and voltage is obtained.
[0132] In some embodiments of the present application, the delay calculation module 610 is used to calculate and obtain the delay amount t.
[0133] In some embodiments of the present application, one of the voltage zero-crossing moments Tun and a current zero-crossing moment Tin corresponding to the voltage zero-crossing moment may be selected.
[0134] The number of sampling points N between the voltage zero-crossing time Tun and the current zero-crossing time Tin is obtained, and the time delay t is the product of the number of sampling points N and the current sampling period.
[0135] In order to ensure data accuracy, the average value of multiple sampling points can be selected to calculate the delay.
[0136] The number of sampling points between the first voltage zero crossing moment Tu1 and the first current zero crossing moment Ti1 is N1, the number of sampling points between the second voltage zero crossing moment Tu2 and the second current zero crossing moment Ti2 is N2, the number of sampling points between the third voltage zero crossing moment Tu3 and the third current zero crossing moment Ti3 is N3, the number of sampling points between the fourth voltage zero crossing moment Tu4 and the fourth current zero crossing moment Ti4 is N4, and the number of sampling points between the fifth voltage zero crossing moment Tu5 and the fifth current zero crossing moment Ti5 is N5.
[0137] The number of sampling points N=(N1+N2+N3+N4+N5) / 5.
[0138] As above, when the 100MHz clock source is divided into two 20MHz clock signals, the sampling period is 1 / (20* ).
[0139] Therefore, the delay t is N*1 / (20*10 6 ), see Figure 7 shown.
[0140] The time delay t as described above is the relative amount of the voltage signal and the current signal. When the voltage signal remains unchanged, the time delay t is deduced backwards to output the delayed current signal.
[0141] S18: storing the delay amount.
[0142] In some embodiments of the present application, a delay storage module 620 is used to store the delay amount.
[0143] In order to facilitate the calling of the delay amount in the test mode later, the mode control module 800 also configures a write address when configuring to enter the debug mode, and writes the delay amount into the write address accordingly.
[0144] In some embodiments of the present application, for example, the write address is configured as Waddr=0x0001, and when the delay amount is calculated, the delay amount is stored in the address Waddr.
[0145] At this point, the debugging mode ends, and the process of obtaining the delay amount during the debugging process is completed.
[0146] When compensating for another application scenario under other hardware connection status, just set other Waddr to re-enter the debugging mode.
[0147] In this way, the latency in multiple application scenarios can be obtained.
[0148] After the delay is obtained, the delay is used in the test mode to generate a current CNV signal with a delay (the voltage CNV signal remains unchanged) to change the sampling time of the current signal (the sampling time of the voltage signal remains unchanged) to achieve the effect of phase compensation.
[0149] As follows, see Figure 2 , describing the test mode.
[0150] In the test mode, the following steps will be performed respectively.
[0151] In the test mode, the test voltage signal and the test current signal are tested.
[0152] S21: Read the delay.
[0153] In some embodiments of the present application, in order to implement the call of the delay amount, see Figure 3 , the phase compensation system also includes a delay reading module 630.
[0154] The delay reading module 630 is connected to the mode control module 800 , the delay storage module 620 and the sampling frequency division module 200 respectively.
[0155] As described above, for each delay amount, there is a write address, so when the delay amount needs to be called, it can be read through the address.
[0156] In some embodiments of the present application, when the mode control module 800 controls to enter the test mode, a read address is configured, and the delay reading module 630 reads the delay amount from the delay storage module 620 according to the read address and sends it to the sampling and frequency division module 200.
[0157] In some embodiments of the present application, the read address is set to Waddr=0x0001.
[0158] The delay reading module 630 reads the corresponding delay amount from the delay storage module 620 according to the read address set to Waddr.
[0159] S22: Divide a clock source with a preset frequency into a first test clock signal and a second test clock signal by using the delay amount.
[0160] In some embodiments of the present application, the preset frequency may be selected as 100 MHz.
[0161] The sampling and frequency division module 200 performs frequency division according to a clock source to generate two test clock signals: a first test clock signal and a second test clock signal.
[0162] The frequencies of the first test clock signal and the second test clock signal are equal.
[0163] In some embodiments of the present application, the division frequency of the two test clock signals may be selected as 1 MHz. Optionally, the frequency may also be selected as other frequencies, which is not limited here.
[0164] In some embodiments of the present application, the frequency of dividing the clock source in the test mode is lower than the frequency of dividing the clock source in the debug mode. Higher frequency sampling can ensure higher accuracy of the delay used for compensation, thereby improving the accuracy of power measurement when applied.
[0165] S23: Process the first test clock signal into a test voltage CNV signal.
[0166] In the test mode, the voltage ADC (analog-to-digital conversion) controller 310 is used to process the first test clock signal into a test voltage CNV (Conversion start) signal.
[0167] In some embodiments of the present application, the voltage ADC controller 310 is capable of tracking the first test clock signal and converting it into a voltage CNV signal for controlling the voltage ADC conversion timing.
[0168] S24: Process the second test clock signal into a test current CNV signal.
[0169] In the test mode, the current ADC controller 320 is used to process the second test clock signal into a test current CNV signal.
[0170] In some embodiments of the present application, the current ADC controller 320 can track the second test clock signal and convert it into a test current CNV signal for controlling the current ADC conversion timing.
[0171] Using the time delay, the compensated test voltage CNV signal and the compensated current CNV signal refer to Figure 7 shown.
[0172] compared to Figure 6 , Figure 7 The voltage CNV signal before compensation is shown to be the same as the voltage CNV signal after compensation (ie, the test voltage CNV signal), and the current CNV signal after compensation (ie, the test current CNV signal) is delayed by a time delay t relative to the current CNV signal before compensation.
[0173] S25: Sample the test voltage signal using the test voltage CNV signal.
[0174] The test voltage CNV signal is used to control the sampling time of the test voltage signal.
[0175] S26: Sample the test current signal using the test current CNV signal.
[0176] The test current CNV signal is used to control the sampling moment of the test current signal.
[0177] So, see Figure 7 and Figure 8 , using the test voltage CNV signal and the test current CNV signal, respectively control the sampling time of the test voltage signal and the sampling time of the test current signal, and obtain Figure 8 The voltage ADC sampling points and the current ADC sampling points are shown.
[0178] from Figure 7 It can be seen from the waveform shown that if the standard source voltage signal is used as the test voltage signal and the standard source current signal is used as the test current signal, the waveform sampled by the ADC after compensation (see Figure 8 ) to restore the original signal to the maximum extent possible (see Figure 4 ), the phase difference compensation problem introduced by hardware and other factors is realized. Therefore, when performing power calculation, the collected voltage sampling points and current sampling points are accurate.
[0179] S27: Perform power calculation based on the sampled test voltage signal and test current signal.
[0180] In some embodiments of the present application, the calculation of power includes calculating active power, calculating apparent power, calculating reactive power, and calculating power factor.
[0181] Voltage effective value: Urms= , where N is the number of samples, u n is the voltage sampling value (n=1,2,3,...,N).
[0182] Current effective value: Irms= , where N is the number of samples, i n is the voltage sampling value.
[0183] Active power P= .
[0184] Apparent power S=Urms×Irms.
[0185] Reactive power Q = S × .
[0186] As described above, the phase compensation method described above can accurately sample the voltage signal and the current signal, thereby also improving the accuracy of the acquired power.
[0187] In some embodiments of the present application, the clock source module 100, sampling and frequency division module 200, voltage ADC controller 310, current ADC controller 320, zero point acquisition module 500, data processing module 700, delay storage module 620, delay reading module 630 and mode control module 800 described above can be supported by FPGA as hardware, in which a software function module is set, which is mainly responsible for obtaining the delay amount, driving the generation of CNV signal with delay to change the voltage and current sampling time, and realizing the phase compensation effect. In power testing, power calculation is also performed based on FPGA. Therefore, the phase compensation system and method involved in the present application are mainly designed with FPGA module, without redundant hardware and platform resources, thus reducing cost investment.
[0188] As above reference Figure 3 The 100MHz clock source is combined with the zero-crossing sampling number calculation to ensure that the compensation step meets the compensation accuracy requirements of the 1M sampling bandwidth device, and can compensate up to 10ns, achieving high-precision compensation effect.
[0189] See also Figure 3 The phase compensation system involved in the present application has a high degree of modularity, low coupling, clear interface, high degree of portability, and is easy to apply to a variety of test units.
[0190] The phase compensation system can support multiple application scenarios. In different application scenarios, different delay amounts can be called up to realize multi-scenario applications without changing the hardware structure.
[0191] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for a person skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to replace some of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions claimed to be protected by the present invention.
Claims
1. A phase compensation method for a power test unit, It is characterized in that It includes a debugging mode, a test mode and a switching mode for controlling the switching between the debugging mode and the test mode. The debugging mode includes the following steps: Dividing a clock source having a preset frequency into a first clock signal and a second clock signal, wherein the frequencies of the first clock signal and the second clock signal are equal; Processing the first clock signal into a voltage CNV signal; Processing the second clock signal into a current CNV signal; Using the voltage CNV signal, the standard source voltage signal is processed into a voltage zero-crossing waveform; Using the current CNV signal, the standard source current signal is processed into a current zero-crossing waveform, and the standard source current signal and the standard source voltage signal have the same phase; Based on the current zero-crossing waveform and the voltage zero-crossing waveform, obtaining a plurality of current zero-crossing moments and a corresponding plurality of voltage zero-crossing moments; Obtain the number of sampling points between each current zero-crossing point and the corresponding voltage zero-crossing point, calculate the average value of the number of sampling points, and use the product of the average value and the current sampling period as the time delay between the current and voltage; The delay amount is stored; the test mode comprises the following steps: Reading the delay amount; Using the delay amount, dividing a clock source with a preset frequency into a first test clock signal and a second test clock signal, wherein the frequencies of the first test clock signal and the second test clock signal are equal; Processing the first test clock signal into a test voltage CNV signal; Processing the second test clock signal into a test current CNV signal; Using the test voltage CNV signal, sampling the test voltage signal; Using the test current CNV signal, sampling the test current signal; Performing power calculation based on the sampled test voltage signal and test current signal; Wherein, the frequency division frequency of the clock source in the debugging mode is greater than the frequency division frequency of the clock source in the test mode; The switching mode includes: when switching to the debug mode, configuring a write address for storing the delay amount; when switching to the test mode, configuring a read address for reading the delay amount.
2. The phase compensation method for a power test unit according to claim 1, It is characterized in that In the debugging mode, all steps in the debugging mode are cycled in sequence to obtain a plurality of delay amounts written at different addresses; In the test mode, the delay amount at the corresponding address is read accordingly.
3. The phase compensation method for a power test unit according to claim 1, It is characterized in that The power calculation includes: Calculate active power; Calculate the apparent power; Calculate reactive power; Calculate the power factor.
4. A phase compensation system for a power test unit, It is characterized in that include: A clock source module, which is used to provide a clock source with a preset frequency; A mode control module, which is used to configure a debugging mode, a test mode, and a switching mode for controlling switching between the debugging mode and the test mode; A sampling and frequency division module, which is used to divide the clock source into a first clock signal and a second clock signal in the debugging mode, wherein the frequencies of the first clock signal and the second clock signal are equal; a voltage ADC controller, which processes the first clock signal into a voltage CNV signal in the debugging mode; a current ADC controller, which processes the second clock signal into a current CNV signal in the debugging mode; A voltage acquisition module, which uses the voltage CNV signal to process the standard source voltage signal into a voltage zero-crossing waveform in the debugging mode; A current acquisition module, which uses the current CNV signal to process the standard source current signal into a current zero-crossing waveform in the debugging mode, and the standard source current signal and the standard source voltage signal have the same phase; A zero point acquisition module, which receives the current zero point waveform and the voltage zero point waveform in the debugging mode, and obtains a plurality of current zero point moments and a plurality of corresponding voltage zero point moments; A time delay calculation module obtains the number of sampling points between each current zero-crossing point and the corresponding voltage zero-crossing point, calculates the average value of the number of sampling points, and uses the product of the average value and the current sampling period as the time delay between the current and voltage; A delay storage module connected to the mode control module, configured to configure the delay storage module to a write mode in the debugging mode and simultaneously issue a write address for storing the delay amount obtained by the delay calculation module; A delay reading module, which is connected to the mode control module, the delay storage module and the sampling frequency division module respectively, and is used to configure a reading address when the mode control module controls to enter the test module, and the delay reading module uses the reading address to read the corresponding delay amount from the delay storage module and send it to the sampling frequency division module; In the test mode, the sampling frequency division module divides the clock source into a first test clock signal and a second test clock signal using the delay amount from the delay storage module, and the frequencies of the first test clock signal and the second test clock signal are equal; In the test mode, the voltage ADC controller processes the first test clock signal into a test voltage CNV signal, and the current ADC controller processes the second test clock signal into a test current CNV signal; In the test mode, the voltage acquisition module samples the test voltage signal using the test voltage CNV signal, and the current acquisition module samples the test current signal using the current CNV signal; A data processing unit, which performs power calculation based on the sampled test voltage signal and test current signal; Wherein, the frequency division frequency of the clock source in the debugging mode is greater than the frequency division frequency of the clock source in the testing mode.
