A kind of variable step- size LMS adaptive harmonic current detection method
Technical field
The present invention relates to power technologies, and in particular to a kind of variable step- size LMS adaptive harmonic current detection method.
Background technique
With more and more non-linear power electronic equipment investment applications, resulting a large amount of harmonic waves are directly affected
The harmonic pollution problems of the power quality of power grid, power grid are extremely serious.Corresponding effective measures must be taken to come to harmonic problem
Inhibited, with this come reduce or even avoid harmonic wave bring influence.Active Power Filter-APF can be compensated dynamically as one kind
The device of harmonic wave has obtained extensive attention and application.Wherein as the core of active filter --- Harmonic currents detection
Link will have a direct impact the effect of harmonics restraint using which kind of technology and methods, therefore the real-time inspection to harmonic current
The research of method of determining and calculating seems particularly significant with improvement.
Current main Harmonic Detecting Algorithm includes being become based on instantaneous reactive power theory, Fast Fourier Transform (FFT), small echo
It changes.Wherein made in active filter by the H.Akagi method based on instantaneous reactive power proposed and its improved method
With more universal, but its detection system is open loop, and frequency is fixed, extremely sensitive for the variation of original part parameter and voltage on line side,
And it is only applicable to three-phase system.Adaptive algorithm detection system is closed loop, and system has adaptivity, and detection effect is good;Not only
Monophase system is also applied for suitable for three-phase system.Currently, lowest mean square (Least Mean Square, LMS) is most widely used
General adaptive algorithm.In Measurement of Harmonics in Power System, what is proposed earliest is fixed step algorithm, because fixed step size can not be protected simultaneously
The equilibrium problem of convergence rate and steady-state error is demonstrate,proved, so that the application of algorithm is by many limitations.In order to solve fixed step size institute band
Problems, various Variable Step Algorithms propose that harmonic detecting effect also increasingly optimizes in succession.
Summary of the invention
Goal of the invention of the invention is to provide a kind of variable step- size LMS adaptive harmonic current detection method, humorous to improve
Precision, convergence rate and the real-time of wave current detecting.
For achieving the above object, technical scheme is as follows:
A kind of variable step- size LMS adaptive harmonic current detection method, comprising steps of
S1: installing voltage sensor or current sensor in each phase of network system respectively, to monitor the load of every phase
Electric current iL(t) and system voltage us(t), wherein L represents load, and S represents system, and variable t is the time;
S2: to periodically non-sinusoidal load current iL(t) and the active reference signal x of its fundamental current1, x1=sin
(ω t), idle reference signal x2, x2=cos (ω t) synchronizes sampling, respectively obtains the load current of current sample time n
Discrete value iL(n), the fundamental active discrete value x of reference signal1(n) and fundamental wave reactive power discrete value x2 (n), wherein x1For standard
Fundamental voltage, x2For the value after 90 ° of its phase shift, ω is that fundamental wave hands over frequency;
S3: by the fundamental active discrete value x of current sample time1(n) and fundamental wave reactive power discrete value x2(n) composition is currently adopted
The discrete value matrix X (n) of the fundamental wave at sample moment=[x1(n), x2(n)];
S4: by estimating for fundamental wave discrete matrix X (n) and the mutually multiplied sampled signal of weight coefficient matrix W (n) of current sample time
Evaluation, filter export y (n), y (n)=X (n) WT(n), initial value 0, W (n)=[w1(n), w2(n)], x1(n) corresponding
For fundamental active discrete value x1(n) weight, x2(n) fundamental wave reactive power discrete value x is corresponded to2(n) weight;
S5: the discrete value iL (n) of current time load current is subtracted to the estimated value and y of fundamental current current sample time
(n), the harmonic current i of current sample time is obtainedh(n) error amount, error signal are e (n), e (n)=iL(n)-y(n);
S6: calculating the sef-adapting filter weight coefficient matrix W (n+1) of next sampling instant,
W (n+1)=+ 2 μ (n) e (n) X (n) of W (n)
Wherein μ is step-length of the sef-adapting filter in current sample time, and μ needs to meet certain condition of convergence, 0 < μ <
1/λmax, λmaxFor the maximum eigenvalue of input signal autocorrelation matrix, X (n) is the discrete value matrix of fundamental wave of current sample time
Autocorrelation matrix characteristic value;
S7: the update of step-length
1) letter i is being originally inputted with signalL(n) the related averaged power spectrum of proportion is as feedback amount in,
μ (n+1)=α μ (n)+γ P2(n)
Wherein, P (n) is the related averaged power spectrum of proportion in original input signal;β is forgetting factor, 0 < β < 1;α is
Fixed value;γ is preset parameter, γ > 0;
2) β (n)=γ β (n-1)+η is obtained by P (n) | P (n) |, γ and η are preset parameter, the change of common constraint beta (n)
Change;
3) it replaces volume e (n) to be used as feedback amount by P (n), establishes the class sigmoid functional relation of step-length Yu feedback amount;
4) n=n+1 is enabled, repeating above step S3 to S7 can be realized real-time inspection to the harmonic current in load current
It surveys.
Technical solution as a further improvement of that present invention, the step 3) in the step S7 specifically include:
It replaces volume e (n) to be used as feedback amount by P (n), establishes the class sigmoid functional relation of step-length Yu feedback amount,
μ (n)=β (n) (1-exp (- α (n) | P (n) |2)), whereinα (n) be currently with previous step
System tracking error ratio.
The value range of technical solution as a further improvement of that present invention, the α (n) is
The clipping of technical solution as a further improvement of that present invention, the step-length is
Beneficial effects of the present invention:
1, be zero principle by steady state power harmonic wave mean value it is foundation, error is replaced by coherence average estimation P (n) of error
Feedback amount of the e (n) as algorithm, eliminates influence of the harmonic component ξ (n) to step change;Secondly class Sigmoid function is utilized
Compression Mappings, the functional relation for establishing step-length and feedback amount carrys out the variation of dynamic adjusting step, and by preset parameter α and
β becomes variable α (n) and β (n) carrys out the variation of dynamic adjusting step so that algorithm has faster initial convergence speed, when transition compared with
Higher convergence precision when the dynamically track effect and stable state got well;
2, α (n) is currently to be embodied in the system tracking error of previous step ratio for constraining step change speed
When error becomes larger, α (n) becomes larger, and the increase of step-size factor obtains very fast convergence rate;When error becomes smaller, α (n) reduces, step
Long coefficient value reduces available lesser steady-state error;γ and η is preset parameter, and the variation of common constraint beta (n) is different from β
For caused by definite value when P (n) level off to zero when, brought suddenly to change, dynamic constraint beta (n) allows side length slow
Variation, thus avoid algorithm stable state or when close to stable state because of β value it is fixed caused by larger steady-state error.
Detailed description of the invention
Fig. 1 is traditional fixed step size adaptive algorithm in the Real output waveform of asynchronous long time base wave and ideal output wave
The comparison diagram of shape, it is u=0.1 that wherein a figure, which is step-length, and figure b is step-length u=0.04;
Fig. 2 is the fundamental current figure and sheet of the algorithm for the class Sigmoid functional relation established between step-length and mean square error
The fundamental current figure of algorithm in inventive embodiments, wherein a figure is the algorithm of class Sigmoid functional relation, and b figure is of the invention real
Apply the algorithm in example;
Fig. 3 is right value update change curve, and wherein a figure is the algorithm of class Sigmoid functional relation, and b figure is of the invention real
Apply the algorithm in example;
Fig. 4 is fundamental current change curve when loading current jump, and wherein a figure is class Sigmoid functional relation
Algorithm, b figure are the fundamental current figure of the algorithm in the embodiment of the present invention;
Fig. 5 is weight change curve when loading current jump, and wherein a figure is the algorithm of class Sigmoid functional relation,
B figure is the algorithm in the embodiment of the present invention.
Specific embodiment:
Embodiment
A kind of variable step- size LMS adaptive harmonic current detection method, comprising the following steps:
Step 1: voltage sensor or current sensor are installed respectively in each phase of network system, to monitor every phase
Load current iL(t) and system voltage us(t), subscript L represents load, and S represents system, and variable t is the time;
Step 2: to periodically non-sinusoidal load current iL(t) and the active reference signal x of its fundamental current1,x1=
Sin (ω t), idle reference signal x2,x2=cos (ω t) synchronizes sampling, respectively obtains the load electricity of current sample time n
The discrete value i of streamL(n), the fundamental active discrete value x of reference signal1(n) and fundamental wave reactive power discrete value x2 (n);Wherein x1For mark
Quasi- fundamental voltage, x2For the value after 90 ° of its phase shift, ω is that fundamental wave hands over frequency;
Step 3: by the fundamental active discrete value x of current sample time1(n) and fundamental wave reactive power discrete value x2(n) composition is worked as
The discrete value matrix X (n) of the fundamental wave of preceding sampling instant=[x1(n),x2(n)].
Step 4: by the mutually multiplied sampled signal of weight coefficient matrix W (n) of fundamental wave discrete matrix X (n) and current sample time
Estimated value, i.e., filter output y (n), y (n)=X (n) WT(n), initial value 0, W (n)=[w1(n),w2(n)],x1
(n) fundamental active discrete value x is corresponded to1(n) weight, x2(n) fundamental wave reactive power discrete value x is corresponded to2(n) weight;
Step 5: the discrete value iL (n) of current time load current to be subtracted to the estimation of fundamental current current sample time
Value and y (n), just obtain the harmonic current i of current sample timeh(n) error amount, that is, error signal e (n), e (n)=iL(n)-y
(n);
Step 6: the sef-adapting filter weight coefficient matrix W (n+1) of next sampling instant is calculated,
W (n+1)=+ 2 μ (n) e (n) X (n) of W (n)
Wherein μ is step-length of the sef-adapting filter in current sample time, and μ needs to meet certain condition of convergence, 0 < μ <
1/λmax(λmaxFor the maximum eigenvalue of input signal autocorrelation matrix), X (n) is the discrete value matrix of fundamental wave of current sample time
Autocorrelation matrix characteristic value.
Step 7: the update of step-length
1, letter i is being originally inputted with signalL(n) the related averaged power spectrum of proportion is as feedback amount in, i.e.,
μ (n+1)=α μ (n)+γ P2(n),
P (n) is the related averaged power spectrum of proportion in original input signal, and harmonic carcellation electric current does step-length update
It disturbs;β is forgetting factor, value range (0,1), influence of the past signal to present status, and value is determined by the width of time window,
β is bigger, indicates that the forgetting degree of signal in the past is bigger, to present influence with regard to smaller;Conversely, β is smaller, the past, signal was to present
It influences bigger.;α is fixed value, it determines step value when restraining known to formula;γ is the preset parameter close to 1, certainly
Determine convergence rate (γ > 0).
2, β (n)=γ β (n-1)+η is obtained by P (n) | P (n) |, γ and η are preset parameter, the change of common constraint beta (n)
Change, be different from β be definite value caused by when P (n) level off to zero when, brought suddenly to change, dynamic constraint beta (n) makes side
Length can be slowly varying, thus avoid algorithm stable state or when close to stable state because of β value it is fixed caused by larger steady-state error.
3, it replaces volume e (n) to be used as feedback amount by P (n), establishes the class sigmoid functional relation of step-length Yu feedback amount, such as
μ (n)=β (n) (1-exp (- α (n) | P (n) |2)), whereinα (n) be currently with previous step
System tracking error ratio is embodied in when error becomes larger, α (n) becomes larger, step-size factor for constraining step change speed
Increase obtain very fast convergence rate, sayed by above-mentioned, the value range that can obtain α (n) is
It is simultaneously the stability for guaranteeing algorithm, does not generate biggish step value jump, algorithm is restrained, step-length
Need clipping.
In formula: μmax、μminSelection should ensure that the stability of algorithm, usually enable μmaxIt is calculated close to fixed step size adaptive-filtering
The neutrality step value of method.
4, n=n+1 is enabled, repeating the above steps three to seven can be realized real-time inspection to the harmonic current in load current
It surveys.
Emulation experiment
In order to examine the superiority and accuracy of new algorithm, using simulation software, to verify new algorithm.To be calculated convenient for comparing
The performance of method, the present embodiment use in emulation and penetrate load current are as follows:
iL=A (sin (ω t)+0.2sin (6 ω t)+0.1sin (10 ω t)+0.05sin (ω t)) fundamental frequency is
50HZ, sampling number define 32 sampled points of each period, reference input in emulation are as follows:
[x1, x2]=[sin ω t, cos ω t]
Tap input be w=[w1, w2], weight initial value zero, i.e.,
W (0)=[0,0].
The value of parameter is as shown in table 1 in algorithm, and by simulating, verifying, the present embodiment algorithm has selected more good ginseng
Number setting, it is same to see the table below 1.
1 algorithm parameter value table of table
Emulation experiment one
Fig. 1 is traditional fixed step size adaptive algorithm in the Real output waveform of asynchronous long time base wave and ideal output wave
The comparison diagram of shape, as shown in Figure 1 when guaranteeing that step-length can be in convergent situation, when the step-length taken takes smaller u=0.04, although can
To keep lesser steady-state error, but obviously it can be seen that convergent speed is very slow;When taking biggish step-length u=0.1, step-length
Convergence rate is obviously accelerated, but compared with the former, disadvantage is that steady-state error error is again very big.It is possible thereby to simple proof,
Implacable relationship between convergence rate and steady-state error possessed by the fixed not long algorithm of tradition.
Emulation experiment two
Fig. 2 is the fundamental current figure of the algorithm based on class sigmoid function, the fundamental wave of the algorithm proposed with the present embodiment
Current graph.
The present embodiment modified hydrothermal process is obviously faster than based on class sigmoid function in convergence rate it can be seen from figure b
Algorithm, begin to restrain and tend towards stability in a cycle, there is lesser steady-state error.
Fig. 3 is weight with new change curve, by weight change curve can be seen that the present embodiment algorithm convergence rate with
It will be better than the algorithm based on class sigmiod function on stable state accuracy.
Emulation experiment three
It can be seen from Fig. 4 and Fig. 5 when load current amplitude mutates, the present embodiment innovatory algorithm can be quickly
The tracking ideal fundamental current variation of speed, and ideal fundamental current variation has just been kept up in a cycle, and by weight
Change curve, which can be seen that the present embodiment innovatory algorithm not only, has fast convergence rate and lesser steady-state error, works as input
When electric current mutates, the present embodiment algorithm also has faster dynamic responding speed.