CN115510373A - Power supply calibration method based on least square quadratic polynomial fitting - Google Patents

Power supply calibration method based on least square quadratic polynomial fitting Download PDF

Info

Publication number
CN115510373A
CN115510373A CN202211156876.6A CN202211156876A CN115510373A CN 115510373 A CN115510373 A CN 115510373A CN 202211156876 A CN202211156876 A CN 202211156876A CN 115510373 A CN115510373 A CN 115510373A
Authority
CN
China
Prior art keywords
calibration
value
sampling
quadratic
power supply
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.)
Pending
Application number
CN202211156876.6A
Other languages
Chinese (zh)
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.)
Suzhou Harmontronics Automation Technology Co Ltd
Original Assignee
Suzhou Harmontronics Automation Technology 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 Suzhou Harmontronics Automation Technology Co Ltd filed Critical Suzhou Harmontronics Automation Technology Co Ltd
Priority to CN202211156876.6A priority Critical patent/CN115510373A/en
Publication of CN115510373A publication Critical patent/CN115510373A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/11Complex mathematical operations for solving equations, e.g. nonlinear equations, general mathematical optimization problems

Abstract

The invention relates to a power supply calibration method based on least square quadratic polynomial fitting, and belongs to the field of computers. In the method, a quadratic fitting curve Y = aX 2 The + bX + c replaces a multi-interval method of 'replacing curves with straight' on the overall characteristic, and other errors can be well compensated. In addition, no matter how many calibration intervals exist, the data volume of the calibration process keeps a fixed value all the time, the data volume is only equal to two groups of KB value calibration parameters in the traditional scheme, and the communication data volume is greatly reduced. Under the condition of extremely large number of calibration points, the multi-interval complex coding logic is replaced by a characteristic formula, and the coding, debugging and maintenance of software are undoubtedly facilitated.

Description

Power supply calibration method based on least square quadratic polynomial fitting
Technical Field
The invention belongs to the field of computers, and relates to a power supply calibration method based on least square quadratic polynomial fitting.
Background
In the process flow of the formation power supply, power supply data is acquired through ADC, and in the process of acquiring the data, current/voltage set by a user and actually output by a hardware circuit are inconsistent due to the existence of offset error, gain error, linear error and the like.
The current calibration scheme is a multipoint calibration method: the input range is divided into different intervals, and the offset error and the gain error in each interval are compensated by a two-point calibration method, so that the purpose of error correction is achieved. The division of multiple intervals utilizes the idea of 'replacing curve with straight', and reduces the linear error to a certain extent.
The compensation calculation process for the old scheme is as follows:
(1) two calibrationsThe points form a straight line and are an interval, and sampling values x at two ends of the interval are obtained L And x H And the actual output value y of the hardware circuit L And y H 。x L Representing a sampling value with smaller calibration points at two ends of the straight line; x is the number of H Representing a sampling value with larger calibration points at two ends of the straight line; y is L Representing the smaller actual output value of the calibration points at the two ends of the straight line; y is H Representing the larger actual output value of the calibration points at the two ends of the straight line;
(2) using the equation y = kx + b and a known reference value (x) L ,y L ) And (x) H ,y H ) Calculating gain compensation k = (y) H -y L )/(x H -x L ) And offset compensation b = y L -x L ×k。
(3) And applying the obtained gain compensation and offset compensation to other input values of the interval to realize the correction of the interval. One interval has first and last calibration points, and the numerical value is just between the two calibration points.
The single interval compensation schematic is shown in fig. 1.
Ideally, after calibration, Y '= KK' Y + KB '+ B, as can be seen from the error function X' = K 'Y + B' and the compensation function Y '= KX' + B. When KK ' =1,kb ' + B =0, then Y ' = Y. After PID reciprocating adjustment, Y 'gradually tends to X, and the deviation of X and Y' fluctuates above and below a zero point. At this time, Y' ≈ X, i.e., Y ≈ X.
Wherein, X ' represents ADC sampling value, Y represents actual output value of hardware circuit, K ' represents slope of error function, and B ' represents intercept of error function. Y' represents the output value (PID adjustment input value) of the ADC sampling value after compensation operation, K represents the slope of the compensation function, and B represents the intercept of the compensation function.
The calibration by the multipoint calibration method has the following defects:
1. under the influence of linear errors, calibration by the multipoint calibration method needs to take a plurality of intervals to compensate the errors. With the increase of the measurement range, the calibration interval inevitably increases. The difficulty in improving the calibration accuracy is to select the calibration interval reasonably and adapt to different characteristic curves.
2. The increase of the calibration interval firstly brings about the increase of the data volume in the data transmission process, which has certain influence on the real-time performance and accuracy of the communication between the devices and also occupies more data storage space of the devices.
3. Secondly, the code amount of the lower power computer is undoubtedly increased, so that the coding, debugging and maintenance difficulty of software developers is directly increased, and furthermore, the processing time of sampling and correcting data each time is longer due to complicated judgment.
Disclosure of Invention
In view of the above, the present invention is directed to a power calibration method based on least square quadratic polynomial fitting.
In order to achieve the purpose, the invention provides the following technical scheme:
a power supply calibration method based on least square quadratic polynomial fitting comprises the following steps:
s1: let the quadratic fit curve function be Y = aX 2 + bX + c, where a is a quadratic term power coefficient, b is a first order term power coefficient, c is a constant term coefficient, X represents an input value, and Y represents an output value;
s2: in the process flow of forming the power supply, during calibration, a plurality of calibration points are known, the sampling values and actual values of the calibration points are determined, three coefficients of a, b and c are determined according to a least square formula, and a quadratic fitting curve equation, namely a compensation function, is finally determined through the three coefficients; at the moment, under the same sampling value, the sum of squares of the errors from the actual value of each calibration point to the fitting curve is minimum, and the fitting curve at the moment is closer to the actual power supply characteristic curve, namely the characteristic function;
s3: after calibration, Y '= G (F (Y)) is known from the error function X' = F (Y) and the compensation function Y '= G (X'); considering the calibrated compensation function and the error function as inverse functions, i.e. G (X) = F -1 (X), when Y' = Y; after PID reciprocating adjustment, Y 'gradually tends to X, and the deviation of X and Y' fluctuates up and down at a zero point; y' is approximately equal to X, namely Y is approximately equal to X, so that the hardware circuit outputs a value set by a user;
wherein, X' represents the sampling value of the ADC; f represents the function mapping relation from the actual value of the hardware circuit to the ADC sampling value; y represents the actual value of the hardware circuit; y' represents a proportional-integral-derivative PID regulation input value, namely a value after ADC sampling compensation; g represents a compensation function mapping relation; x represents a set value.
Optionally, the number of calibration points is 5.
Optionally, the sampling value and the actual value are specifically:
the sampling value of the calibration point 1 is 500, and the actual value is 831.4229;
the sampling value of the calibration point 2 is 1000, and the actual value is 1357.3626;
the sampling value of the calibration point 3 is 1500, and the actual value is 1493.4838;
the sampling value of the calibration point 4 is 2000, and the actual value is 1760.4051;
the sampling value of the calibration point 5 is 2500, and the actual value is 2135.3449;
optionally, the derivation formula of the three coefficients in the quadratic fit curve equation is:
Figure BDA0003856912170000031
n denotes the total number of calibration points, i denotes the calibration point, i ∈ N.
The invention has the beneficial effects that: quadratic fit curve Y = aX 2 The + bX + c replaces a multi-interval method of 'replacing curves with straight' on the overall characteristic, and other errors can be well compensated. In addition, no matter how many calibration intervals exist, the data volume of the calibration process keeps a fixed value all the time, the data volume is only equal to two groups of KB value calibration parameters in the traditional scheme, and the communication data volume is greatly reduced. Under the condition of extremely large number of calibration points, the multi-interval complex coding logic is replaced by a characteristic formula, and the coding, debugging and maintenance of software are undoubtedly facilitated.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention. The objectives and other advantages of the invention may be realized and attained by the means of the instrumentalities and combinations particularly pointed out hereinafter.
Drawings
For the purposes of promoting a better understanding of the objects, aspects and advantages of the invention, reference will now be made to the following detailed description taken in conjunction with the accompanying drawings in which:
FIG. 1 is a flow chart of the conventional KB value single interval error compensation principle of a lower computer of a power supply;
FIG. 2 is a flow chart of a power supply lower computer quadratic polynomial fitting full scale compensation principle;
FIG. 3 is a schematic diagram of 5-point calibration point quadratic fit and error;
FIG. 4 is a comparison graph of the data volume of the new and old communication protocols;
FIG. 5 is a simple calibration flow chart for calibrating an upper computer;
fig. 6 is a diagram of verifying the accuracy of the secondary fitting calibration charging current of the power board 1;
fig. 7 is a diagram of verifying the accuracy of the quadratic fitting calibration charging current of the power board 2;
FIG. 8 is a diagram illustrating verification of the accuracy of the quadratic fitting calibration discharge current of the power board 1;
fig. 9 is a verification diagram of the accuracy of the quadratic fitting calibration discharge current of the power board 2;
Detailed Description
The embodiments of the present invention are described below with reference to specific embodiments, and other advantages and effects of the present invention will be easily understood by those skilled in the art from the disclosure of the present specification. The invention is capable of other and different embodiments and of being practiced or of being carried out in various ways, and its several details are capable of modification in various respects, all without departing from the spirit and scope of the present invention. It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present invention in a schematic way, and the features in the following embodiments and examples may be combined with each other without conflict.
Wherein the showings are for the purpose of illustrating the invention only and not for the purpose of limiting the same, and in which there is shown by way of illustration only and not in the drawings in which there is no intention to limit the invention thereto; to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product; it will be understood by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.
The same or similar reference numerals in the drawings of the embodiments of the present invention correspond to the same or similar components; in the description of the present invention, it should be understood that if there is an orientation or positional relationship indicated by terms such as "upper", "lower", "left", "right", "front", "rear", etc., based on the orientation or positional relationship shown in the drawings, it is only for convenience of description and simplification of description, but it is not an indication or suggestion that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes, and are not to be construed as limiting the present invention, and the specific meaning of the terms may be understood by those skilled in the art according to specific situations.
Fig. 2 is a flow chart of the principle of the power supply lower computer quadratic polynomial fitting full scale compensation.
Based on the principle of least squares, a quadratic fit is performed on the multiple calibration point data, and the optimal compensation function for the calibration error is found by minimizing the sum of squares of the errors.
The compensation process of the lower power supply computer specifically comprises the following steps:
after calibration, X '= F (Y) and Y' = G (X '), whereby Y' = G (F (Y)). If the calibrated compensation function and the error function are inverse functions, i.e. G (X) = F -1 (X), when Y' = Y. After PID reciprocating adjustment, Y 'gradually tends to X, and the deviation of X and Y' fluctuates around the zero point. At this time, Y' ≈ X, i.e., Y ≈ X.
Since perfect compensation is practically impossible, the compensation curve is as close as possible to the actual characteristic curve.
Taking fig. 3 as an example, let the quadratic fit curve Y = aX 2 + bX + c, the known number of calibration points is 5,and the sampled and actual values of 5 points are determined, how are the coefficients determined so that the sum of the squares of the error of each calibration point to the fitted curve is minimal? And (3) calculating three coefficients of a, b and c according to a least square formula, wherein the quadratic fit curve can be as close to an actual power supply characteristic curve as possible.
The sampled and actual values for each point in fig. 3 are shown in the table below.
Sampling values and actual values of points in FIG. 3
Calibration point (N) Sampling value (X) Actual value (Y)
1 500 831.4229
2 1000 1357.3626
3 1500 1493.4838
4 2000 1760.4051
5 2500 2135.3449
According to the least square method, the derivation formula of three coefficients in the quadratic fitting curve equation is as follows:
Figure BDA0003856912170000051
substituting the table data into the equation system to obtain
Formula 1:
500 2 *(a*500 2 +b*500+c-831.4229)+1000 2 *(a*1000 2 +b*1000+c-1357.3626)+1500 2 *(a*1500 2 +b*1500+c-1493.4838)+2000 2 *(a*2000 2 +b*2000+c-1760.4051)+2500 2 *(a*2500 2 +b*2500+c-2135.3449)=0
formula 2:
500*(a*500 2 +b*500+c-831.4229)+1000*(a*1000 2 +b*1000+c-1357.3626)+1500*(a*1500 2 +b*1500+c-1493.4838)+2000*(a*2000 2 +b*2000+c-1760.4051)+2500*(a*2500 2 +b*2500+c-2135.3449)=0
formula 3:
(a*500 2 +b*500+c-831.4229)+(a*1000 2 +b*1000+c-1357.3626)+(a*1500 2 +b*1500+c-1493.4838)+(a*2000 2 +b*2000+c-1760.4051)+(a*2500 2 +b*2500+c-2135.3449)=0
the method is simple and can be used for simplifying the process,
formula 1:61187500000000 a +28125000000 b +13750000 c-25313082900=0
Formula 2:28125000000 a +13750000 b +7500 c-12872472.2=0
Formula 3:13750000 a +7500 c-7578.0193=0
The solution is obtained, a is approximately equal to-4.8914 e-05, b is approximately equal to 0.74892, c is approximately equal to 526.7381.
It can be determined that the quadratic fit curve in fig. 3 has a functional formula of Y = -4.8914e-05 x 2 +0.74892 x +526.7381, consistent with fig. 3.
In fig. 3, 5 calibration points are taken and fitted a second time. This figure shows the error of each calibration point on the fitted curve for the same sample value and the quadratic fitted curve drawn according to the sum of the squares of the minimum errors.
In fig. 4, the protocols under calibration of KB values (old scheme) are on the left, and the protocols under quadratic fit (new scheme) are on the right. Left and right comparisons show that the amount of data required for the quadratic fit is only equivalent to the amount of data for the two sets of calibration parameters under KB value calibration.
Fig. 5 shows a simple process from how the sampling values and actual values are obtained to calculating the quadratic fitting coefficients by the calibration host computer.
As can be seen from fig. 6, after the quadratic fitting calibration, the charging current of the power board 1 is sampled 50 times at each sampling point from 0 to 100A, and the error range is within 10mA, that is, the calibration accuracy satisfies 0.01%. The power supply precision requirement is 0.05%, so the calibration precision meets the requirement. And (3) making standard deviation on the 50-time data of each sampling point, and reflecting the size of the data fluctuation range of each sampling point, wherein the smaller the numerical value is, the smaller the fluctuation range is. The standard deviation of all sampling points is subjected to normal distribution statistics, and the mean value of the standard deviation of each sampling point of the system is about 0.0007, and the standard deviation is about 0.0007 due to the influence of other factors.
As can be seen from fig. 7, after the quadratic fitting calibration, the charging current of the power board 2 is sampled 50 times at each sampling point from 0 to 100A, and the error range is within 10mA, that is, the calibration accuracy satisfies 0.01%. The power supply precision requirement is 0.05%, so the calibration precision meets the requirement. And (3) making a standard deviation on the data of 50 times of each sampling point to reflect the size of the data fluctuation range of each sampling point, wherein the smaller the numerical value is, the smaller the fluctuation range is. The standard deviation of all sampling points is subjected to normal distribution statistics, and the mean value of the standard deviation of each sampling point of the system is about 0.0008, and the standard deviation is about 0.0008 due to the influence of other factors.
As can be seen from fig. 8, after the quadratic fitting calibration, the discharge current of the power board 1 is sampled 50 times at each sampling point from 0 to 100A, and the error range is within 10mA, that is, the calibration accuracy satisfies 0.01%. The power supply precision requirement is 0.05%, so the calibration precision meets the requirement. And (3) making a standard deviation on the data of 50 times of each sampling point to reflect the size of the data fluctuation range of each sampling point, wherein the smaller the numerical value is, the smaller the fluctuation range is. The standard deviation of all sampling points is subjected to normal distribution statistics, and the fact that the mean value of the standard deviation of each sampling point of the system is about 0.0013 can be seen, and the standard deviation is about 0.0013 due to the influence of other factors.
As can be seen from fig. 9, after the quadratic fitting calibration, the discharge current of the power board 2 is sampled 50 times at each sampling point from 0 to 100A, and the error range is within 10mA, that is, the calibration accuracy satisfies 0.01%. The power supply precision requirement is 0.05%, so the calibration precision meets the requirement. And (3) making standard deviation on the 50-time data of each sampling point, and reflecting the size of the data fluctuation range of each sampling point, wherein the smaller the numerical value is, the smaller the fluctuation range is. The standard deviation of all sampling points is subjected to normal distribution statistics, and the fact that the mean value of the standard deviation of each sampling point of the system is about 0.0013 can be seen, and the standard deviation is about 0.0013 due to the influence of other factors.
Finally, the above embodiments are only intended to illustrate the technical solutions of the present invention and not to limit the present invention, and although the present invention has been described in detail with reference to the preferred embodiments, it will be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions, and all of them should be covered by the claims of the present invention.

Claims (4)

1. A power supply calibration method based on least square quadratic polynomial fitting is characterized in that: the method comprises the following steps:
s1: let the quadratic fit curve function be Y = aX 2 + bX + c, where a is a quadratic term power coefficient, b is a first order term power coefficient, c is a constant term coefficient, X represents an input value, and Y represents an output value;
s2: in the process flow of forming the power supply, during calibration, a plurality of calibration points are known, the sampling values and actual values of the calibration points are determined, three coefficients of a, b and c are determined according to a least square formula, and a quadratic fitting curve equation, namely a compensation function, is finally determined through the three coefficients; at the moment, under the same sampling value, the sum of squares of the errors from the actual value of each calibration point to the fitting curve is minimum, and the fitting curve at the moment is closer to the actual power supply characteristic curve, namely the characteristic function;
s3: after calibration, Y '= G (F (Y)) is known from the error function X' = F (Y) and the compensation function Y '= G (X'); consider the calibrated compensation function and the error function as inverse functions of each other, i.e., G (X) = F -1 (X), when Y' = Y; after PID reciprocating adjustment, Y 'gradually tends to X, and the deviation of X and Y' fluctuates up and down at a zero point; y' is approximately equal to X, namely Y is approximately equal to X, so that the hardware circuit outputs a value set by a user;
wherein, X' represents the sampling value of the ADC; f represents the function mapping relation from the actual value of the hardware circuit to the ADC sampling value; y represents the actual value of the hardware circuit; y' represents a proportional-integral-derivative PID regulation input value, namely a value after ADC sampling compensation; g represents a compensation function mapping relation; x represents a set value.
2. The power supply calibration method based on least square quadratic polynomial fitting of claim 1, wherein: the number of calibration points is 5.
3. The method of claim 2, wherein the power calibration based on least squares quadratic polynomial fitting comprises: the sampling value and the actual value are specifically as follows:
the sampling value of the calibration point 1 is 500, and the actual value is 831.4229;
the sampling value of the calibration point 2 is 1000, and the actual value is 1357.3626;
the sampling value of the calibration point 3 is 1500, and the actual value is 1493.4838;
the sampling value of the calibration point 4 is 2000, and the actual value is 1760.4051;
the calibration point 5 has a sampling value of 2500 and an actual value of 2135.3449.
4. The method of claim 3 for power supply calibration based on least squares quadratic polynomial fitting, wherein: the derivation formula of three coefficients in the quadratic fitting curve equation is as follows:
Figure FDA0003856912160000011
n denotes the total number of calibration points, i denotes the calibration point, i ∈ N.
CN202211156876.6A 2022-09-21 2022-09-21 Power supply calibration method based on least square quadratic polynomial fitting Pending CN115510373A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211156876.6A CN115510373A (en) 2022-09-21 2022-09-21 Power supply calibration method based on least square quadratic polynomial fitting

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211156876.6A CN115510373A (en) 2022-09-21 2022-09-21 Power supply calibration method based on least square quadratic polynomial fitting

Publications (1)

Publication Number Publication Date
CN115510373A true CN115510373A (en) 2022-12-23

Family

ID=84505814

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211156876.6A Pending CN115510373A (en) 2022-09-21 2022-09-21 Power supply calibration method based on least square quadratic polynomial fitting

Country Status (1)

Country Link
CN (1) CN115510373A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115792653A (en) * 2023-02-02 2023-03-14 斯润天朗(北京)科技有限公司 Regression fitting method and device for lithium battery voltage curve and computer equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115792653A (en) * 2023-02-02 2023-03-14 斯润天朗(北京)科技有限公司 Regression fitting method and device for lithium battery voltage curve and computer equipment

Similar Documents

Publication Publication Date Title
CN101089574A (en) Error correcting method for pressure sensor
CN115510373A (en) Power supply calibration method based on least square quadratic polynomial fitting
CN104678896B (en) Means for correcting, method and the digital control system of digital analog converter
CN113900473B (en) High-precision reference generation method and system
CN113029512B (en) Air flow field model correction control method for temporary transonic wind tunnel
CN112904266A (en) Method and device for predicting service life of electric energy meter
CN109901099A (en) A kind of voltage change automatic compensating method of electric energy meter
CN114485370B (en) Temperature drift correction method and device for displacement sensor and storage medium
CN110568397A (en) Electric energy meter correction method and system based on MCU software
CN109781342A (en) Barometer calibration method and device
CN108508385A (en) A kind of low-cost and high-precision auto-correction method
CN112285635B (en) Terminal correction method and system of external current transformer
CN101446503A (en) Method for indicating values of corrector and device thereof
CN108051458A (en) A kind of X-ray energy spectrum method of estimation based on rational fraction fitting multipotency drop shadow curve
CN116412937A (en) Temperature sensor calibration method, terminal equipment and storage medium
CN207675368U (en) A kind of sputtering coating equipment vacuum meter rectifier
CN113936823B (en) Method, system, device and storage medium for acquiring scale coefficients of off-pile detector
CN106788436B (en) Voltage coefficient calibration method applied to PIP capacitor array in SARADC
CN109724748A (en) Barometer calibration system
CN115931178A (en) BJT-based intelligent temperature sensor correction method
CN116090612A (en) Prophet model-based power distribution network line peak load prediction method
CN112465917B (en) Distortion calibration method, system, equipment and storage medium of lens module
WO2022012416A1 (en) Method and system for eccentric load error correction
CN114567324A (en) Digital-to-analog conversion error correction method and related device
CN109470939A (en) A kind of line loss point detection system and method

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