CN112114185B - Power grid peak value sampling method based on derivative algorithm - Google Patents

Power grid peak value sampling method based on derivative algorithm Download PDF

Info

Publication number
CN112114185B
CN112114185B CN202010903523.2A CN202010903523A CN112114185B CN 112114185 B CN112114185 B CN 112114185B CN 202010903523 A CN202010903523 A CN 202010903523A CN 112114185 B CN112114185 B CN 112114185B
Authority
CN
China
Prior art keywords
power grid
value
sampling
voltage
derivative
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010903523.2A
Other languages
Chinese (zh)
Other versions
CN112114185A (en
Inventor
林枝堂
罗钊明
潘叶江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vatti Co Ltd
Original Assignee
Vatti Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vatti Co Ltd filed Critical Vatti Co Ltd
Priority to CN202010903523.2A priority Critical patent/CN112114185B/en
Publication of CN112114185A publication Critical patent/CN112114185A/en
Application granted granted Critical
Publication of CN112114185B publication Critical patent/CN112114185B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R19/00Arrangements for measuring currents or voltages or for indicating presence or sign thereof
    • G01R19/04Measuring peak values or amplitude or envelope of ac or of pulses

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Measurement Of Current Or Voltage (AREA)
  • Control Of Electrical Variables (AREA)

Abstract

The invention discloses a power grid peak value sampling method based on a derivative algorithm, which comprises the following steps: initializing parameter variables by powering on, starting to time by an internal clock, sampling voltage values at fixed time intervals, recording sampling values and sampling time, and fitting a third-order function; obtaining a maximum value after taking a second derivative of the third-order function, sampling two groups of data on the left side and the right side of the maximum value, and fitting the two groups of data to obtain a first-order function respectively; and respectively taking the first derivatives of the two groups of first-order functions, finding out a first maximum value and a second maximum value from the two groups of data, and taking the average value as a power grid peak value. According to the power grid peak value sampling method based on the derivative algorithm, the voltage value is sampled at fixed time intervals, the three-order polynomial function is synthesized through curve fitting after continuous collection, and the peak turning point of the power grid alternating voltage is judged by taking the convexity of the second derivative judging function.

Description

Power grid peak value sampling method based on derivative algorithm
Technical Field
The invention belongs to the technical field of power supply of power grids, and particularly relates to a power grid peak value sampling method based on a derivative algorithm.
Background
In the case where the power supply parameters of the power grid are unknown, the general control system will collect the parameters (voltage or frequency) of the power grid in order to configure the initial parameters of the control system.
The working frequency of the power grid is easy to determine, but the voltage is alternating, and certain impact damage is caused to the system and the load, so that the voltage of the alternating current power grid is detected, the actual voltage value is generally obtained by a method of frequently sampling and then averaging, but the method is relatively traditional, the accuracy is relatively poor, and the system resource is relatively consumed.
Disclosure of Invention
In order to solve the problems, the invention provides a power grid peak value sampling method based on a derivative algorithm, which has the characteristics of quick response time and automatic adaptation to different alternating current power grids.
The technical scheme adopted by the invention is as follows:
a power grid peak value sampling method based on derivative algorithm comprises the following steps:
s1, powering up an initialization parameter variable, starting timing by an internal clock, sampling voltage values at fixed intervals, recording sampling values and sampling time, and fitting a third-order function;
s2, taking a second derivative of the third-order function, obtaining a maximum value, sampling two groups of data on the left side and the right side of the maximum value, and fitting the first-order function respectively;
s3, respectively taking the first derivatives of the two groups of first-order functions, finding out a first maximum value and a second maximum value from the two groups of data, and taking the average value as a power grid peak value.
Preferably, the step S1 further includes the following steps: and reducing the voltage of the power grid through an inverse proportion coefficient of 1/K so as to adapt to the withstand voltage value of the sampling chip.
Preferably, in the step S1, before the step of fitting the third-order function after recording the sampling value and the sampling time, the method includes:
judging whether the sampled voltage value is greater than zero, if not, the recorded data set is invalid, resampling the voltage value, and if so, recording the sampled value and the sampling time and fitting a third-order function.
Preferably, the sampled voltage values comprise at least four groups.
Preferably, in the step S2, before sampling two sets of data on the left and right sides of the maximum and fitting the first-order functions respectively, the method includes: judging whether the second derivative is smaller than zero, if the second derivative is not smaller than zero, recording data sets invalid, resampling at least four sets of voltage values, if the second derivative is smaller than zero, acquiring a maximum value according to the fact that the first derivative of the third-order function is equal to zero, sampling two sets of data on the left side and the right side of the maximum value, and fitting the first-order function respectively.
Preferably, the two sets of data comprise at least two sets of voltage values, respectively.
Preferably, in the step S3, the step of finding a first maximum value and a second maximum value from the two sets of data, and before taking the average value as the grid peak value, the step further includes: judging whether the product of the two groups of first derivatives is smaller than zero, if not, the recorded data groups are invalid, resampling at least four groups of voltage values, if so, finding out a first maximum value and a second maximum value from the two groups of data, and taking the average value as a power grid peak value.
Preferably, the calculation formula of the grid peak value is:
umax=k (vmax1+vmax2)/2, where k is the grid scaling factor, umax is the grid peak, vmax1 is the first maximum, vmax2 is the second maximum.
Preferably, the method further comprises the step of calculating an instantaneous value U at any moment according to a sinusoidal alternating voltage formula after the power grid peak value is obtained:
U=Umax*sin(ωt+τu)
where U is the instantaneous value of the voltage (V), umax is the peak value of the grid (V), ω is the angular velocity, t is the time, and τu is the angular frequency (rad/s).
Preferably, the step of reducing the voltage of the power grid through the inverse proportionality coefficient 1/K adopts a circuit, which comprises a diode D1, a first resistor R1, a second resistor R2, a third resistor R3 and a capacitor C1, wherein the diode D1, the first resistor R1 and the second resistor R2 are sequentially connected in series between the live wire and the zero line of the power grid, a common connection end between the first resistor R1 and the second resistor R2 is connected with one end of the third resistor R3, the other end of the third resistor R3 is connected with one end of the capacitor C1, the other end of the capacitor C1 is connected with the zero line of the power grid, and a common connection end of the third resistor R3 and the capacitor C1 is connected with a voltage sampling AD port.
Compared with the prior art, the power grid peak value sampling method based on the derivative algorithm has the characteristics of fast response time and automatic adaptation to different alternating current power grids by sampling the voltage value once at fixed time intervals, fitting the voltage value into a third-order polynomial function through a curve after continuous acquisition, and judging the peak turning point of the alternating current voltage of the power grid by taking the convexity of the second derivative judging function.
Drawings
FIG. 1 is a flowchart of a power grid peak sampling method based on a derivative algorithm provided by an embodiment of the invention;
FIG. 2 is a specific flowchart of a power grid peak sampling method based on a derivative algorithm according to an embodiment of the present invention;
fig. 3 is a voltage reduction circuit diagram of a power grid peak sampling method based on a derivative algorithm according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Examples
The embodiment of the invention provides a power grid peak value sampling method based on a derivative algorithm, which is shown in fig. 1-2 and comprises the following steps:
s1, powering up an initialization parameter variable, starting timing by an internal clock, sampling voltage values at fixed intervals, recording sampling values and sampling time, and fitting a third-order function;
s2, taking a second derivative of the third-order function, obtaining a maximum value, sampling two groups of data on the left side and the right side of the maximum value, and fitting the first-order function respectively;
s3, respectively taking the first derivatives of the two groups of first-order functions, finding out a first maximum value and a second maximum value from the two groups of data, and taking the average value as a power grid peak value.
In this way, the voltage value is sampled once at fixed time intervals, the third-order polynomial function is synthesized through curves after continuous collection, the convexity of the function is judged through taking the second derivative, the peak turning point of the alternating voltage of the power grid is judged, namely the maximum value, two groups of data on the left side and the right side of the maximum value are sampled again, the first-order function and the second maximum value are respectively fitted, the first maximum value and the second maximum value are found out, and the average value is taken as the power grid peak value, so that the method has the characteristics of quick response time and automatic adaptation to the characteristics of different alternating current power grids.
The step S1 also comprises the following steps: and reducing the voltage of the power grid through an inverse proportion coefficient of 1/K so as to adapt to the withstand voltage value of the sampling chip.
Thus, by stepping down the grid voltage by an inverse proportionality factor of 1/K, the rated voltage (e.g., 220V) can be reduced to a voltage range (e.g., within 5V) that the sampling chip can withstand.
In the step S1, before the step of fitting out the third-order function after recording the sampling value and the sampling time, the method comprises the following steps:
judging whether the sampled voltage value is greater than zero, if not, the recorded data set is invalid, resampling the voltage value, and if so, recording the sampled value and the sampling time and fitting a third-order function.
Thus, the voltage value is sampled by an interval of M microseconds, because the alternating current has a positive half-axis and a negative half-axis. According to the design of the sampling circuit, the three-order function can be fitted only by the data of the positive half axis, namely the voltage value is larger than zero, the sampled voltage value at least comprises four groups, and the function y=ax is fitted every 4 groups of data 3 +bx 2 +cx+d; where x is time and y is the voltage sample value (y>0)。
In the step S2, two sets of data on the left and right sides of the maximum are sampled, and before fitting the first-order function, the method includes: judging whether the second derivative is smaller than zero, if the second derivative is not smaller than zero, recording data sets invalid, resampling at least four sets of voltage values, if the second derivative is smaller than zero, acquiring a maximum value according to the fact that the first derivative of the third-order function is equal to zero, sampling two sets of data on the left side and the right side of the maximum value, and fitting the first-order function respectively.
Thus, the third order function y=ax 3 +bx 2 +cx+d takes the second derivative as long as f' (x)>0, namely an alternating voltage transition point (inflection point), namely the third-order function is a convex arc, and the maximum value is obtained according to the fact that the first derivative of the third-order function is equal to zero, namely the alternating voltage transition point is obtainedInflection point), samples two sets of data on the left and right sides of the maximum, fits the function y=ax+b, respectively, and takes the first derivative, respectively. The two sets of data respectively comprise at least two sets of voltage values, so that a first-order function can be fitted.
In the step S3, the first maximum value and the second maximum value are found out from the two sets of data, and before taking the average value as the grid peak value, the method further includes judging whether the product of the two sets of first derivatives is smaller than zero, if not smaller than zero, the recorded data sets are invalid, resampling at least four sets of voltage values, if smaller than zero, the first maximum value and the second maximum value are found out from the two sets of data, and taking the average value as the grid peak value.
Thus, taking the first derivatives of the two groups of first-order functions respectively, and if f' (x) >0, indicating that the alternating voltage of the power grid increases monotonically upwards; if f' (x) <0, it indicates that the ac voltage of the power grid decreases monotonically downwards, so that on the premise that the third-order function is a convex arc, one side of the primary function increases monotonically, the other side of the primary function decreases monotonically, the two groups of primary functions can be determined to be respectively located at two sides of the inflection point, the first maximum value and the second maximum value of the two groups of primary functions are respectively found, and the power grid peak value of the power grid can be obtained by taking the average value.
The calculation formula of the power grid peak value is as follows:
umax=k (vmax1+vmax2)/2, where k is the grid scaling factor, umax is the grid peak, vmax1 is the first maximum, vmax2 is the second maximum.
In this way, the actual value of the grid peak value can be calculated through the calculation formula of the grid peak value Umax, wherein k is the grid proportionality coefficient, and the voltage value which is reduced in multiple in detection can be increased in multiple and converted into the actual grid peak value.
The method further comprises the step of calculating an instantaneous value U at any moment according to a sine alternating voltage formula after the power grid peak value is obtained:
U=Umax*sin(ωt+τu)
where U is the instantaneous value of the voltage (V), umax is the peak value of the grid (V), ω is the angular velocity, t is the time, and τu is the angular frequency (rad/s).
Thus, the instantaneous value U of the power grid at any moment can be calculated through the sine alternating voltage formula and the power grid peak value Umax.
As shown in fig. 3, the step of reducing the voltage of the power grid by the inverse proportionality coefficient 1/K adopts a circuit, which comprises a diode D1, a first resistor R1, a second resistor R2, a third resistor R3 and a capacitor C1, wherein the diode D1, the first resistor R1 and the second resistor R2 are sequentially connected in series between the live wire and the zero line of the power grid, a common connection end between the first resistor R1 and the second resistor R2 is connected with one end of the third resistor R3, the other end of the third resistor R3 is connected with one end of the capacitor C1, the other end of the capacitor C1 is connected with the zero line of the power grid, and a common connection end of the third resistor R3 and the capacitor C1 is connected with a voltage sampling AD port.
In this way, the diode D1 is turned on in the forward direction and turned off in the reverse direction, so that the live wire current of the power grid smoothly flows into the voltage reducing circuit, the voltage of the voltage sampling AD port is R2/(R1+R2) times of the live wire voltage of the power grid through the voltage dividing circuit formed by the first resistor R1 and the second resistor R2, the third resistor R3 is used as a current limiting resistor to prevent the current from being overlarge, the capacitor C1 is used for filtering to prevent interference, and the voltage is reduced in proportion (for example, 1/k times) through the sampling circuit, so that the voltage AD data value of the positive half shaft is sampled.
According to the power grid peak value sampling method based on the derivative algorithm, the voltage value is sampled at fixed time intervals, the three-order polynomial function is synthesized through curve fitting after continuous collection, and the peak turning point of the power grid alternating voltage is judged by taking the convexity of the second derivative judging function.
The present invention is not limited to the above-mentioned embodiments, and any changes or substitutions that can be easily understood by those skilled in the art within the technical scope of the present invention are intended to be included in the scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims (10)

1. The power grid peak value sampling method based on the derivative algorithm is characterized by comprising the following steps of:
s1, powering up an initialization parameter variable, starting timing by an internal clock, sampling voltage values at fixed intervals, recording sampling values and sampling time, and fitting a third-order function;
s2, taking a second derivative of the third-order function, obtaining a maximum value, sampling two groups of data on the left side and the right side of the maximum value, and fitting the first-order function respectively;
s3, respectively taking the first derivatives of the two groups of first-order functions, finding out a first maximum value and a second maximum value from the two groups of data, and taking the average value as a power grid peak value.
2. The derivative algorithm-based power grid peak sampling method according to claim 1, wherein the step S1 is preceded by the further step of: and reducing the voltage of the power grid through an inverse proportion coefficient of 1/k so as to adapt to the withstand voltage value of the sampling chip.
3. The derivative algorithm-based power grid peak sampling method according to claim 2, wherein in S1, before the step of fitting a third-order function after recording the sampling value and the sampling time, the method includes:
judging whether the sampled voltage value is greater than zero, if not, the recorded data set is invalid, resampling the voltage value, and if so, recording the sampled value and the sampling time and fitting a third-order function.
4. A derivative algorithm based power grid peak sampling method according to claim 3, wherein the sampled voltage values comprise at least four groups.
5. The derivative algorithm-based power grid peak sampling method according to any one of claims 1 to 4, wherein before the step S2 of sampling two sets of data on the left and right sides of the maximum and fitting the first order function respectively, the method comprises: judging whether the second derivative is smaller than zero, if the second derivative is not smaller than zero, recording data sets invalid, resampling at least four sets of voltage values, if the second derivative is smaller than zero, acquiring a maximum value according to the fact that the first derivative of the third-order function is equal to zero, sampling two sets of data on the left side and the right side of the maximum value, and fitting the first-order function respectively.
6. The derivative algorithm-based power grid peak sampling method according to claim 5, wherein the two sets of data include at least two sets of voltage values, respectively.
7. The derivative algorithm-based power grid peak sampling method according to claim 6, wherein in S3, finding a first maximum value and a second maximum value from the two sets of data, and taking an average value as a power grid peak further includes: judging whether the product of the two groups of first derivatives is smaller than zero, if not, the recorded data groups are invalid, resampling at least four groups of voltage values, if so, finding out a first maximum value and a second maximum value from the two groups of data, and taking the average value as a power grid peak value.
8. The derivative algorithm-based power grid peak sampling method according to claim 7, wherein the calculation formula of the power grid peak is:
umax=k (vmax1+vmax2)/2, where k is the grid scaling factor, umax is the grid peak, vmax1 is the first maximum, vmax2 is the second maximum.
9. The derivative algorithm-based power grid peak sampling method according to claim 8, further comprising calculating an instantaneous value U at any moment according to a sinusoidal ac voltage formula after obtaining a power grid peak:
U=Umax*sin(ωt+τu)
wherein U is a voltage instantaneous value, umax is a power grid peak value, ω is an angular velocity, t is time, and τu is an angular frequency.
10. The derivative algorithm-based power grid peak sampling method according to claim 2, wherein the step of reducing the power grid voltage by an inverse proportionality coefficient 1/k adopts a circuit which comprises a diode D1, a first resistor R1, a second resistor R2, a third resistor R3 and a capacitor C1, wherein the diode D1, the first resistor R1 and the second resistor R2 are sequentially connected in series between a power grid live wire and a zero line, a common connection end between the first resistor R1 and the second resistor R2 is connected with one end of the third resistor R3, the other end of the third resistor R3 is connected with one end of the capacitor C1, the other end of the capacitor C1 is connected with the zero line of the power grid, and a common connection end of the third resistor R3 and the capacitor C1 is connected with a voltage sampling AD port.
CN202010903523.2A 2020-09-01 2020-09-01 Power grid peak value sampling method based on derivative algorithm Active CN112114185B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010903523.2A CN112114185B (en) 2020-09-01 2020-09-01 Power grid peak value sampling method based on derivative algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010903523.2A CN112114185B (en) 2020-09-01 2020-09-01 Power grid peak value sampling method based on derivative algorithm

Publications (2)

Publication Number Publication Date
CN112114185A CN112114185A (en) 2020-12-22
CN112114185B true CN112114185B (en) 2024-02-27

Family

ID=73803893

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010903523.2A Active CN112114185B (en) 2020-09-01 2020-09-01 Power grid peak value sampling method based on derivative algorithm

Country Status (1)

Country Link
CN (1) CN112114185B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112485511A (en) * 2020-12-11 2021-03-12 国网辽宁省电力有限公司阜新供电公司 Alternating current sampling device based on tracking compensation algorithm and sampling compensation method thereof
CN113447701B (en) * 2021-05-18 2023-09-01 熊秀 Lightning current peak value calibration method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102010052346A1 (en) * 2010-11-25 2012-05-31 Dipl.-Ing. H. Horstmann Gmbh Measuring unit e.g. microcomputer for measuring peak voltage in electricity distribution network, measures line voltage by evaluating divider voltages measured at different switching state, with consideration of values of impedances
CN105974196A (en) * 2016-06-14 2016-09-28 吉林大学 High-precision power grid harmonic wave measurement system and high-precision power grid harmonic wave measurement method
CN108761222A (en) * 2018-05-21 2018-11-06 南京工程学院 It is a kind of imbalance operating mode under network voltage order components quick extraction system and method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102010052346A1 (en) * 2010-11-25 2012-05-31 Dipl.-Ing. H. Horstmann Gmbh Measuring unit e.g. microcomputer for measuring peak voltage in electricity distribution network, measures line voltage by evaluating divider voltages measured at different switching state, with consideration of values of impedances
CN105974196A (en) * 2016-06-14 2016-09-28 吉林大学 High-precision power grid harmonic wave measurement system and high-precision power grid harmonic wave measurement method
CN108761222A (en) * 2018-05-21 2018-11-06 南京工程学院 It is a kind of imbalance operating mode under network voltage order components quick extraction system and method

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
一种基于导数的实时频率跟踪算法;张超;谭建成;;电力自动化设备(第04期);全文 *
基于幅值计算的电网电压同步信号检测;肖静;杨艺云;张阁;肖园园;;电测与仪表(第10期);全文 *
基于曲线拟合法的新型定制电力设备快速检测算法;刘兵;阮江军;罗湘;袁翔;余世峰;;电力自动化设备(第09期);全文 *
电网信号谐波分析算法计算性能比较研究;彭丽;赵伟;陈垒;黄松岭;;电测与仪表(第01期);全文 *
过电压限制下分布式光伏电源最大允许接入峰值容量的计算;范元亮;赵波;江全元;曹一家;;电力系统自动化(第17期);全文 *

Also Published As

Publication number Publication date
CN112114185A (en) 2020-12-22

Similar Documents

Publication Publication Date Title
CN112114185B (en) Power grid peak value sampling method based on derivative algorithm
CN109167545B (en) Permanent magnet synchronous generator flux linkage online identification method and system
CN102545749A (en) Wide-speed-regulation-range brushless direct current motor position sensorless control device and method
CN112858924B (en) Power battery remaining energy estimation method, device, vehicle and storage medium
CN105301522A (en) Detection method of three-phase mains supply power failure
CN113992075A (en) Compensation circuit for phase delay of brushless direct current motor and control method
CN112180313B (en) Automatic correction method, control device and energy storage equipment for current transformer
CN110108928A (en) A kind of alternating voltage zero-crossing detection method based on ac voltage detection circuit
CN112383309A (en) Analog-to-digital conversion circuit of magnetoelectric revolution speed sensor
CN116599185A (en) Starting method, system, control circuit and storage medium of vehicle-mounted charger
CN104655916A (en) Alternating-current voltage effective value measuring device and method
CN203377584U (en) Three-phase non-midline phase-lack, undervoltage and overvoltage protection circuit
CN214591177U (en) Alternating information detection circuit, power control circuit and water dispenser
CN112398384B (en) Control device for direct current motor
CN109302108B (en) Asynchronous motor power generation control method and system
CN114662265A (en) Lithium battery backup time correction estimation method and computer-readable storage medium
CN109038505B (en) Power supply short-circuit protection method and inverter
JP6102761B2 (en) Charging apparatus and charging method
CN113447737A (en) Electrolytic capacitor monitoring method in air conditioner variable frequency controller
CN111555685A (en) Fan starting control circuit and control method thereof
CN210981296U (en) Two-wire system non-polar encoder
CN110440944A (en) Motor temperature measurement method of the electric machine controller based on Hall sensor temperature profile
CN212675026U (en) Voltage detection circuit
CN110261676B (en) Method for metering electric quantity of exponential time domain function with uncertain initial time
CN208836040U (en) A kind of doubly-salient brushless DC generator phase current chopper circuit

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant