Intelligent power analysis and harmonic detection method based on load voltage and current signals

By combining Fast Fourier Transform and small-sample neural networks, and using RC voltage divider and phase-locked loop technology to acquire voltage and current signals, a BP neural network model is constructed and the training set is expanded. This solves the problems of high accuracy and adaptability in harmonic detection and achieves efficient harmonic analysis.

CN119916077BActive Publication Date: 2025-11-07QINGDAO UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510181241.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-19
Publication Date
2025-11-07
Estimated Expiration
2045-02-19

AI Technical Summary

Technical Problem

Existing technologies face challenges in achieving high-precision harmonic detection, especially under complex electrical loads and variable environmental conditions. Traditional algorithms struggle to guarantee high accuracy, and training neural networks is difficult with small sample data.

Method used

By combining Fast Fourier Transform and few-sample neural networks, voltage and current signals are acquired through RC voltage divider and phase-locked loop technology to construct a BP neural network model. Generative Adversarial Networks are used to expand the training set, and an adaptive learning rate adjustment strategy is adopted to optimize the training process.

Benefits of technology

It significantly improves the accuracy and adaptability of harmonic analysis, enhances the model's detection capability under complex and variable load conditions, and expands application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119916077B_ABST
    Figure CN119916077B_ABST
Patent Text Reader

Abstract

The application discloses a kind of intelligent power analysis and harmonic detection method based on load voltage current signal, belong to harmonic analysis technical field, the voltage signal and current signal of the load to be measured are collected by sensor;The collected signal is processed, adjusted to the appropriate input range of ADC, analog signal is converted into digital signal using ADC;Frequency following processing is carried out on digital signal using phase-locked loop circuit, so that the output signal of phase-locked loop circuit and input signal are consistent in frequency and phase;BP neural network model is constructed, adaptive learning rate adjustment strategy is used, so that the training process of network is optimized;After FFT processing, the output signal is input into the trained BP neural network model for power analysis and harmonic detection.In view of the characteristics of small sample neural network, the application innovatively uses adaptive learning rate adjustment strategy, so that the training process of network is optimized, and the limitation of relying on a large amount of data in traditional method is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of harmonic analysis, and particularly relates to an intelligent power analysis and harmonic detection method based on load voltage and current signals. BACKGROUND

[0002] The rapid development of power electronics technology in recent decades has led to the rapid progress of modern industry and the widespread application of consumer electronics, resulting in increasingly serious harmonic pollution in power systems. Harmonics can affect the normal operation efficiency of power equipment and increase the loss of power systems, and have the potential to cause equipment failure, so accurate analysis and monitoring of harmonics are particularly important in the current environment. In the field of harmonic detection, power analyzers are widely used because they can accurately measure current, voltage, and power factor.

[0003] Currently, high-precision power analysis in China generally uses classical algorithms such as Fourier transform (FFT) to sample input signals, convert time-domain signals to frequency-domain representations, and extract relevant information about harmonic components through spectral analysis. However, although fast Fourier transform (FFT) is widely used in harmonic analysis, these methods have significant limitations in data requirements, processing time, and model adaptability, especially when faced with complex electrical loads and variable environmental conditions, making it difficult to ensure high-precision detection results. To address these issues, machine learning and deep learning techniques have been gradually applied to harmonic analysis. With their powerful data processing capabilities and nonlinear mapping characteristics, neural networks can effectively compensate for the shortcomings of traditional algorithms, improving the accuracy and adaptability of harmonic analysis and providing a new solution for high-precision power analysis.

[0004] In conventional neural network methods, a large number of training data samples are required to train the model. However, in practical applications, load harmonic sample data is extremely scarce, especially for sample data specific to certain load parameters. Therefore, small sample learning gradually shows its application advantages in this scenario. Small sample neural networks can output relatively accurate results using a small amount of training data under conditions of data sample scarcity, with characteristics such as high efficiency, low cost, and strong realizability, providing a new intelligent solution for harmonic analysis.

[0005] The application is based on the analysis of the harmonic components of the input signal by fast Fourier transform (FFT), and the construction of a small sample neural network as the core method, and the voltage and current in the load input signal are collected by using resistance-capacitance voltage division and resistance sampling, and combined with differential amplification and program-controlled gain amplification technology, the signal is adjusted to the appropriate input range of ADC to realize quantization. At the same time, the frequency and phase of the output signal are ensured to be consistent with the input signal by the phase-locked loop technology, so as to further improve the analysis accuracy. The method can accurately analyze the harmonic characteristics of different types of loads (such as resistance, inductance, capacitance, etc.) under different process parameters offline, and train the neural network model on the small sample data set. On the basis of the existing data, the generative adversarial neural network is used to generate diversified power analysis value samples to expand the training set, so as to train the neural network. In the training process, the loss function is monitored, so that the change of the learning rate is determined according to the loss function, and the efficiency and stability of the model training are improved. SUMMARY

[0006] In view of the above problems existing in the prior art, the application provides an intelligent power analysis and harmonic detection method based on load voltage and current signals, which is reasonable in design, solves the problems of the prior art, and has good effects.

[0007] An intelligent power analysis and harmonic detection method based on load voltage and current signals, comprising the following steps:

[0008] Step 1: collecting the voltage signal and current signal of the load to be measured by a sensor;

[0009] Step 2: processing the collected signal and adjusting it to the appropriate input range of ADC, and converting the analog signal to digital signal by using ADC;

[0010] Step 3: frequency following processing of the digital signal by using a phase-locked loop circuit, so that the output signal of the phase-locked loop circuit is consistent with the input signal in frequency and phase;

[0011] Step 4: constructing a BP neural network model, and adopting an adaptive learning rate adjustment strategy to optimize the network training process;

[0012] Step 5: inputting the output signal of step 3 after FFT processing into the trained BP neural network model for power analysis and harmonic detection.

[0013] Further, in step 1, the voltage and current signals of the load are collected by using resistance-capacitance voltage division method and resistance sampling method respectively; in the resistance-capacitance voltage division method, the attenuation coefficient of the resistance-capacitance voltage division network at low frequency is approximately equal to the ratio of the resistance R1 and R2; at high frequency, the resistance-capacitance parallel connection is used to offset the influence of the parasitic capacitance of the resistance itself and the parasitic capacitance generated by the PCB layout; R1C1=R2C2 is used to eliminate the influence of frequency on voltage division, and C1 and C2 are frequency compensation capacitors.

[0014] Further, in step 3, the phase-locked loop circuit is used to follow the frequency of the collected signal, the input signal, the output signal and the phase comparator are initialized first, the phase difference between the reference signal and the voltage-controlled oscillator VCO output signal is compared by the phase comparator, the error signal is smoothed by the low-pass filter, the frequency of the voltage-controlled oscillator VCO is adjusted, and then the output signal and the reference signal are compared again, in this process, the phase-locked loop continuously adjusts the frequency and phase of the output signal to keep consistent with the input signal, so as to realize accurate tracking of the input signal frequency.

[0015] Further, step 4 includes the following sub-steps:

[0016] Step 4.1: Constructing a data set;

[0017] Step 4.2: Using a generative adversarial network to expand and enhance the data set to obtain a training set;

[0018] Step 4.3: Building a BP neural network model;

[0019] Step 4.4: Training the BP neural network model using the training set, and updating the model parameters by using the loss function for back propagation according to the improved Adam algorithm.

[0020] Further, in step 4.1, for different load types, the electrical parameters of each load and the manufacturing process of the load are changed to simulate various actual use scenarios, the load types include resistance, capacitance and inductance, the electrical parameters include resistance value, capacitance value and inductance value, and the manufacturing process includes material characteristics and geometric shape, and 1000 times of current and voltage collection are performed for each load.

[0021] The collected data is subjected to FFT processing, and 3000 groups of data are calculated, each group of data including 15 measurement values of voltage value, current value, active power value, power factor, current harmonic coefficient THD, current fundamental wave and effective value of 2-10 harmonic components; in addition, 3000 groups of actual data are calculated manually under the same conditions, each group of data including 15 data values of voltage value, current value, active power value, power factor, current harmonic coefficient THD, current fundamental wave and effective value of 2-10 harmonic components as target values;

[0022] The measurement values and target values are subjected to standardization processing, so that the mean value of each feature is 0 and the standard deviation is 1, and are reshaped into a two-dimensional matrix to construct a data set.

[0023] Further, in step 4.3, the BP neural network model includes an input layer, l hidden layers and an output layer, each hidden layer includes a plurality of neurons, the activation function of the neuron is a Relu function, the activation function of the output layer adopts a Softmax activation function, the loss function adopts a mean square error loss function, and the input of the input layer is equal to the activation value, that is:

[0024] z (1) =a (1) =x (1) ;

[0025] z (i+1) =w (i) a (i) +b (i) ;

[0026] a (i+1) =f(z (i+1) );

[0027] Wherein, x (1) is the input of the input layer, a (1) is the output of the input layer, z (1) is the linear combination of the input layer, i.e. the weighted sum of each neuron input; z (i+1) is the linear combination of the i+1th hidden layer, w (i) is the weight matrix of the i-th hidden layer, a (i) is the output of the i-th hidden layer, i.e. the activation value, b (i) is the bias term of the i-th hidden layer, f(z (i+1) ) is the activation function of the i+1th layer, i=1,…,l-1.

[0028] Further, in step 4.4, the model parameter update expression is:

[0029]

[0030] In the formula, θt+1 θt+1 is the model parameter of next time step t θt is the model parameter of current time step, α is the learning rate; ε is the minimum value to prevent division by zero, which is 10 -8 ; is the first moment estimation of the corrected time step t, is the second moment estimation of the corrected time step t;

[0031] A piecewise learning rate method is designed, which represents a large distance from the target function before the loss function reaches the set threshold, at which time the maximum learning rate α is maintained max , which represents the proximity to the optimal solution after the loss function reaches the set threshold, and the learning rate is exponentially decayed by the loss function, which is expressed as:

[0032]

[0033] In the formula, loss is the current loss error, loss set is the set piecewise loss error threshold, loss min is the minimum value of the current loss function.

[0034] The beneficial technical effects brought by the present application are:

[0035] The present application first combines neural networks with fast Fourier transform (FFT) to realize compensation for the error of circuit power harmonic analysis, significantly improving the accuracy of harmonic analysis. In particular, for the characteristics of small sample neural networks, the present application innovatively uses an adaptive learning rate adjustment strategy, thereby optimizing the network training process and avoiding the limitations of relying on a large amount of data in traditional methods. Through this innovation, not only the accuracy of the power analyzer in the harmonic detection of the load input signal is improved, but also the adaptability and practicality of the model under complex and variable load conditions are enhanced, greatly expanding its application scenarios. BRIEF DESCRIPTION OF DRAWINGS

[0036] Figure 1 is the ideal model diagram of the resistance-capacitance voltage division in the present application;

[0037] Figure 2 is the BP neural network model diagram in the present application;

[0038] Figure 3 is the improved ADAM algorithm parameter update flowchart in the present application;

[0039] Figure 4 is the improved ADAM algorithm optimizing BP neural network flowchart in the present application; DETAILED DESCRIPTION

[0040] The specific embodiments of the application will be further described below in conjunction with specific embodiments.

[0041] An intelligent power analysis and harmonic detection method based on load voltage and current signals, comprising the following steps:

[0042] Step 1: Collect the voltage signal and current signal of the load to be measured through the sensor;

[0043] Step 2: Process the collected signals and adjust them to the appropriate input range of the ADC, and convert the analog signals to digital signals using the ADC;

[0044] Step 3: Use a phase-locked loop circuit to process the frequency following of the digital signal, so that the output signal of the phase-locked loop circuit and the input signal are consistent in frequency and phase;

[0045] Step 4: Construct a BP neural network model and train it;

[0046] Step 5: Input the output signal of step 3 after FFT processing into the trained BP neural network model for power analysis and harmonic detection.

[0047] Specifically, in step 1, the voltage and current signals of the load are collected using resistance-capacitance voltage division method and resistance sampling method respectively; as shown in Figure 1 In the resistance-capacitance voltage division method, the attenuation coefficient of the resistance-capacitance voltage division network is approximately equal to the ratio of the resistance R1 and R2 at low frequency; at high frequency, a resistance-capacitance parallel connection is used to offset the influence of the resistance parasitic capacitance and the parasitic capacitance generated by the PCB layout. According to the transfer function of the resistance-capacitance voltage division model:

[0048]

[0049] R1C1=R2C2 to eliminate the influence of frequency on voltage division, C1 and C2 are frequency compensation capacitors.

[0050] In step 3, the phase-locked loop circuit is used to follow the frequency of the collected signal, the input signal, the output signal and the phase comparator are initialized first, the phase comparator is used to compare the phase difference between the reference signal and the voltage controlled oscillator VCO output signal, a low pass filter is used to smooth the error signal, and the frequency of the voltage controlled oscillator VCO is adjusted, then the output signal and the reference signal are compared again. In this process, the phase-locked loop continuously adjusts the frequency and phase of the output signal to keep it consistent with the input signal, achieving accurate tracking of the input signal frequency.

[0051] Step 4 includes the following sub-steps:

[0052] Step 4.1: Construct a data set;

[0053] For different load categories, by changing the electrical parameters of each load and the manufacturing process of the load, a plurality of actual use scenarios are simulated, the load categories include resistance, capacitance and inductance, the electrical parameters include resistance value, capacitance value and inductance value, the manufacturing process includes material properties and geometric shape, a plurality of actual use scenarios are simulated, and 1000 times of current and voltage collection are performed on each load respectively;

[0054] The collected data is subjected to FFT processing, and 3000 groups of data are calculated, each group of data including 15 measurement values of voltage value, current value, active power value, power factor, current harmonic coefficient THD, current fundamental wave and effective value of 2-10 harmonic components thereof; In addition, 3000 groups of actual data are calculated manually under the same conditions, each group of data including 15 data values of voltage value, current value, active power value, power factor, current harmonic coefficient THD, current fundamental wave and effective value of 2-10 harmonic components thereof as target values;

[0055] The measured values and the target values are subjected to standardization processing, so that the mean value of each feature is 0 and the standard deviation is 1, and are reshaped into a two-dimensional matrix to construct a data set.

[0056] Step 4.2: The data set is expanded and enhanced by using a generative adversarial network to obtain a training set;

[0057] A least square loss function is used to train the generative adversarial network GAN, a z (random noise vector) is input to the generator, 15 continuous values are output, and then input to the discriminator. The discriminator adopts a fully connected network structure, 15 continuous values enter the input layer, are processed by the hidden layer, and a probability value is output at the output layer to represent whether the sample can be used as real data.

[0058] Step 4.3: Build a BP neural network model;

[0059] As shown in Figure 2 , the BP neural network model includes an input layer, l hidden layers and an output layer, each hidden layer includes a plurality of neurons, the activation function of the neuron is a Relu function, the activation function of the output layer adopts a Softmax activation function, the loss function adopts a mean square error loss function, and the input of the input layer is equal to the activation value, that is:

[0060] z (1) =a (1) =x (1) ;

[0061] z (i+1) =w (i) a (i) +b (i) ;

[0062] a (i+1) (i+1) ;

[0063] where x (1) is the input of the input layer, a (1) is the output of the input layer, z (1) is the linear combination of the input layer, i.e., the weighted sum of each neuron input; z (i+1) is the linear combination of the (i+1)th hidden layer, w (i) is the weight matrix of the ith hidden layer, a (i) is the output of the ith hidden layer, i.e., the activation value, b (i) is the bias term of the ith hidden layer, f(z (i+1) ) is the activation function of the (i+1)th layer, i = 1, …, l-1.

[0064] The expression of the Relu function is:

[0065] f(x) = max(0, x);

[0066] When the input x is positive, the Relu output is x;

[0067] When the input x is negative, the Relu output is 0.

[0068] The expression of the Softmax activation function is:

[0069]

[0070] where z i is the original score of the ith class (the linear output of the neural network, i.e., the original output without activation function); e zi is the result of the exponential operation on z i ; is the sum of the exponential operation results of all classes, used for normalization, so that the sum of the probabilities of all outputs is 1;

[0071] The expression of the mean square error loss function is:

[0072]

[0073] where: is the predicted value of the model for the input x i , y i is the actual target value (label), and N is the number of samples in the data set.

[0074] Step 4.4: Train the BP neural network model using the training set, update the model parameters using the loss function according to the Adam algorithm, such as Figure 3 and​Figure 4 as shown.

[0075] First, the gradient g t is calculated, and the expression is:

[0076]

[0077] where θ t-1 is the model parameter corresponding to time step t-1, is the model parameter gradient, f t is the optimization objective function of time step t;

[0078] The first-order momentum is calculated for each parameter, and the parameters include weights and biases, and the expression is:

[0079] m t = β1m t-1 +(1-β1)g t ;

[0080] The second-order momentum is calculated for each parameter, and the expression is:

[0081] v t = β2v t-1 +(1-β2)(g t ) 2 ;

[0082] In the formula, m t is the first-order moment estimation of time step t, v t is the second-order moment estimation of time step t, β1 is the first-order momentum decay rate, and is taken as 0.9; β2 is the second-order momentum decay rate, and is taken as 0.999;

[0083] The bias correction expression is:

[0084]

[0085] In the formula, is the corrected first-order moment estimation of time step t, is the power of decay factor β1 at time step t, is the corrected second-order moment estimation of time step t, is the power of decay factor β2 at t step;

[0086] The final model parameter update expression is:

[0087]

[0088] In the formula, θ t+1 is the model parameter of the next time step, θ t is the model parameter of the current time step, α is the learning rate; ε is the minimum value to prevent division by zero, and is taken as 10 -8;

[0089] In the process of neural network training, a fixed learning rate may cause the optimization to stay at a local optimum and cannot escape. If the learning rate is too small, the weight update is insufficient, and it is easy to fall into a local optimal solution; if the learning rate is too large, it will not converge to the optimal solution stably.

[0090] To solve the above problems, a segmented learning rate method is designed. Before the loss function reaches the set threshold, it means that the distance from the target function is far, at this time, the maximum learning rate α max is maintained, and the high-speed search efficiency of ADAM algorithm is enjoyed; after the loss function reaches the set threshold, it means that it is close to the optimal solution, the learning rate is exponentially decayed, which avoids oscillation or skipping the optimal point, and is beneficial to the later convergence of the model, and when the error reaches the expected value, the prediction value of the neural network is output. The expression is:

[0091]

[0092] In the formula, loss is the current loss error, loss set is the set segmented loss error threshold, loss min is the minimum value of the current loss function.

[0093] When the loss function value reaches loss set , the learning rate needs to be fine-tuned, at this time, loss set is small, so that is small, presents exponential growth, and the learning rate gradually decreases, which improves the optimization accuracy of the model.

[0094] The maximum learning rate is set to 0.001, and the segmented loss function threshold loss set is 0.2.

[0095] If the loss function value is less than or equal to the expected loss function value, i.e. loss≤loss 期望 , the training is ended.

[0096] The test results in the embodiment part are shown in Tables 1-3. It can be seen that after the neural network compensation processing, the error value of the measurement data is further reduced, and the measurement accuracy is effectively improved.

[0097] Table 1 Comparison of partial test results of voltage

[0098]

[0099] Table 2 Comparison of partial test results of current

[0100]

[0101] Table 3 Test results for current total harmonic distortion (THD) part

[0102]

[0103] Of course, the above description is not a limitation on the present application, and the present application is not limited to the above examples. Changes, modifications, additions or substitutions made by those skilled in the art within the spirit and scope of the present application should also be included in the protection scope of the present application.

Claims

1. A method of intelligent power analysis and harmonic detection based on load voltage current signals, characterized by, The method comprises the following steps: Step 1: collecting voltage and current signals of a load to be measured by a sensor; Step 2: processing the collected signals and adjusting them to a suitable input range of an ADC, and converting the analog signals into digital signals by using the ADC; Step 3: performing frequency following processing on the digital signals by using a phase-locked loop circuit, so that the output signal of the phase-locked loop circuit keeps consistent with the input signal in frequency and phase; Step 4: constructing a BP neural network model, and adopting an adaptive learning rate adjustment strategy to optimize the network training process; Step 5: inputting the output signal of step 3 after FFT processing into the trained BP neural network model for power analysis and harmonic detection; In step 3, the phase-locked loop circuit is used to follow the frequency of the collected signals, the input signal, the output signal and the phase comparator are initialized first, the phase difference between the reference signal and the voltage-controlled oscillator VCO output signal is compared by using the phase comparator, the error signal is smoothed by using a low-pass filter, the frequency of the voltage-controlled oscillator VCO is adjusted, and then the output signal and the reference signal are compared again, in the process, the phase-locked loop continuously adjusts the frequency and phase of the output signal to keep consistent with the input signal, so that the frequency of the input signal is accurately tracked; Step 4 comprises the following sub-steps: Step 4.1: constructing a data set; Step 4.2: expanding and enhancing the data set by using a generative adversarial network to obtain a training set; Step 4.3: building a BP neural network model; Step 4.4: training the BP neural network model by using the training set, and updating the model parameters by using the loss function according to the improved Adam algorithm; In step 4.4, the model parameter update expression is: where θ t+1 are the model parameters for the next time step, θ t are the model parameters for the current time step, and a is the learning rate. e is the minimum value to prevent division by zero, taken as 10 -8 ; is the first moment estimate for the corrected time step t, is the second moment estimate for the corrected time step t. A segmented learning rate method is designed. Before the loss function reaches a set threshold, it means that the distance to the objective function is far, at which time the maximum learning rate α is maintained max After the loss function reaches the set threshold, it means that it is close to the optimal solution, and the learning rate is exponentially decayed by the loss function, which is expressed as: where loss is the current loss error, loss set is the set segment loss error threshold, loss min is the minimum value of the current loss function.

2. The intelligent power analysis and harmonic detection method based on load voltage and current signals according to claim 1, characterized in that, In step 1, the voltage and current signals of the load are collected by using the resistance-capacitance voltage division method and the resistance sampling method respectively; in the resistance-capacitance voltage division method, the attenuation coefficient of the resistance-capacitance voltage division network is approximately equal to the ratio of the resistance R1 and the resistance R2 at low frequency; at high frequency, the resistance-capacitance parallel connection method is used to offset the influence of the resistance parasitic capacitance and the parasitic capacitance generated by the PCB layout; R1C1=R2C2 is used to eliminate the influence of frequency on voltage division, and C1 and C2 are frequency compensation capacitors.

3. The intelligent power analysis and harmonic detection method based on load voltage and current signals according to claim 1, characterized in that, In step 4.1, for different load types, the electrical parameters and the manufacturing process of each load are changed to simulate various actual use scenarios, the load types include resistance, capacitance and inductance, the electrical parameters include resistance value, capacitance value and inductance value, and the manufacturing process includes material characteristics and geometric shape, and 1000 times of current and voltage collection are performed on each load respectively. The collected data is subjected to FFT processing, and 3000 groups of data are calculated, each group of data including 15 measurement values of voltage value, current value, active power value, power factor, current harmonic coefficient THD, current fundamental wave and effective values of 2-10 harmonic components; in addition, 3000 groups of actual data are calculated manually under the same conditions, each group of data including 15 data values of voltage value, current value, active power value, power factor, current harmonic coefficient THD, current fundamental wave and effective values of 2-10 harmonic components as target values; The measurement values and the target values are subjected to standardization processing, so that the mean value of each feature is 0 and the standard deviation is 1, and are reshaped into a two-dimensional matrix to construct a data set.

4. The intelligent power analysis and harmonic detection method based on load voltage and current signals according to claim 1, characterized in that, In the step 4.3, the BP neural network model includes an input layer, l hidden layers and an output layer, each hidden layer includes a plurality of neurons, the activation function of the neuron is a Relu function, the activation function of the output layer adopts a Softmax activation function, and the loss function adopts a mean square error loss function; the input of the input layer is equal to the activation value, that is: z (1) = a (1) = x (1) ; z (i+1) = w (i) a (i) + b (i) ; a (i+1) = f(z (i+1) ); where x (1) is the input to the input layer, a (1) is the output of the input layer, z (1) is the linear combination of the input layer, i.e., the weighted sum of each neuron input; z (i+1) is the linear combination of the i+1th hidden layer, w (i) is the weight matrix of the i-th hidden layer, a (i) is the output of the i-th hidden layer, i.e., the activation value, b (i) is the bias term of the i-th hidden layer, f(z (i+1) ) is the activation function of the i+1th layer, i = 1, …, l-1.