Current sensor linearity testing system and calibration method

文档序号:905237 发布日期:2021-02-26 浏览:2次 中文

阅读说明:本技术 一种电流传感器线性度测试系统及校准方法 (Current sensor linearity testing system and calibration method ) 是由 刘玉正 唐新颖 于 2020-12-15 设计创作,主要内容包括:一种电流传感器线性度测试系统及校准方法,包括程控数字恒流源以及PC上位机,所述程控数字恒流源用于为待校准电流传感器提供恒流输出的基准参考电流Y_i,所述PC上位机与所述程控数字恒流源电连接,用于为其设置输出参数,所述PC上位机还与待校准电流传感器电连接,用于获取当前工作电流,并为其进行线性度校准。(The system comprises a program-controlled digital constant current source and a PC upper computer, wherein the program-controlled digital constant current source is used for providing a reference current Y output by constant current for a current sensor to be calibrated i The PC upper computer is electrically connected with the program-controlled digital constant current source and used for setting output parameters for the program-controlled digital constant current source, and is also electrically connected with the current sensor to be calibrated and used for acquiring the current working current and calibrating the linearity for the current working current.)

1. A current sensor linearity test system is characterized in that: the calibration device comprises a program-controlled digital constant current source (101) and a PC upper computer (102), wherein the program-controlled digital constant current source (101) is used for providing a reference current Y with constant current output for a current sensor (104) to be calibratediThe PC upper computer (102) is electrically connected with the program-controlled digital constant current source (101) and used for setting output parameters for the program-controlled digital constant current source, and the PC upper computer (102) is also electrically connected with the current sensor (104) to be calibrated and used for acquiring the current working current and calibrating the linearity of the current working current.

2. A current sensor linearity testing system as claimed in claim 1, wherein: the calibration device also comprises a communication interface converter (103) arranged between the PC upper computer (102) and the current sensor (104) to be calibrated.

3. A current sensor linearity calibration method based on the current sensor linearity test system of any one of claims 1-2, characterized in that: comprises the following steps;

s1, selecting the model of a constant current source, and selecting the model of a current sensor (104) to be calibrated;

s2, after the PC upper computer (102) receives the calibration signal, the program-controlled digital constant current source (101) sequentially outputs N groups of reference currents YiTo the current sensors (104) to be calibrated, and simultaneously acquiring reference currents Y of the N groups of current sensors (104) to be calibrated through the communication interface converter (103)iCorresponding measured values X in successioniWherein N is an odd number greater than 2;

s3, the obtained N groups are arranged into paired data (X)i,Yi) Calculating the slope k and the intercept b of a least square regression fitting straight line;

s4, the PC host computer (102) obtains the slope k and the intercept b obtained in the step S3 to obtain a formula 1: y ═ kX + b;

s5, the formula 1 is sent to the current sensor to be calibrated (104) through the PC upper computer (102), the current sensor to be calibrated (104) stores the slope k and the intercept b into the EEPROM, and the measured value of the current sensor to be calibrated (104) is calibrated and corrected according to the slope k and the intercept b.

4. A method of calibrating linearity of a current sensor according to claim 3, wherein: the step S3 includes the following steps;

s301, solving the formula 2 by using the sum of squared deviations:

s302, respectively solving a first-order partial derivative of the function Q for the slope k and the intercept b, wherein the value after zero partial derivative is zero, and obtaining a formula 3 and a formula 4;

equation 3:

equation 4:

s303, carrying out transformation solving on the formula 2, the formula 3 and the formula 4 to obtain a formula 5 and a formula 6 of a slope k and an intercept b;

equation 5:

equation 6:

s304, converting the N groups of reference currents YiAnd the measured value XiThe values of (a) are substituted into equations 5 and 6 to obtain the slope k and the intercept b.

5. A current sensor linearity calibration as claimed in claim 4The method is characterized in that: n is 19, and the reference current Yi10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%, 90%, 80%, 70%, 60%, 50%, 40%, 30%, 20%, 10% of the full scale current of the sensor (104) to be measured, respectively.

6. The method of claim 5, wherein the step of calibrating the linearity of the current sensor comprises the steps of: the communication interface converter (103) is one of CAN, RS485 or RS 232.

7. The method of claim 5, wherein the step of calibrating the linearity of the current sensor comprises the steps of: further comprising step S6;

data (X) pairing N sets of sequencesi,Yi) Substituting the obtained fitting values into formula 1 to obtain N groups of fitted fitting values, and adding the fitting values and the reference current YiAnd comparing the deviation value after fitting with the full-scale current to obtain linearity data.

Technical Field

The invention relates to the field of sensor testing and calibration, in particular to a system and a method for testing linearity of a current sensor.

Background

The current detection technology is widely applied to the fields of industrial automation, electric vehicles, power transmission, monitoring and maintenance of electrical equipment and the like. At present, the common current sensors mainly comprise a Hall current sensor and a fluxgate current sensor, both the Hall current sensor and the fluxgate current sensor measure current by using an 'electric-magnetic-electric' conversion method, and finally, the output quantity (voltage or current) of the sensor and the measured current are in a linear direct proportion relation, so that the sensor has the advantages of high test precision, good linearity, short response time and the like. The main indicators of the current sensor are: measurement accuracy, linearity, sensitivity, hysteresis, consistency, drift parameters, etc. Therefore, as one of the most important indexes for measuring the current sensor, the linearity test and calibration are indispensable links before product shipment.

The linearity is the degree of deviation of an actual relation curve between the output quantity and the input quantity of the sensor from a fitting straight line, and is defined as the ratio of the maximum deviation value between an actual characteristic curve and the fitting straight line in a full-scale range to a full-scale output value. The linearity is one of the most important indexes for measuring the current sensor, and the testing and calibration before product shipment are indispensable steps.

Theoretically, the final output quantity (voltage or current) of the current sensor and the measured current are in a linear direct proportion relationship, but due to the reasons of components, magnetic cores, winding processes and the like, in actual measurement, the linearity of part of the current sensors is poor, and products with poor linearity influence the measurement precision and the consistency of the products, so that the product yield is low, the overall cost of the products is increased, and the waste of resources is caused.

At present, a method for processing linearity of a current sensor manufacturer mainly comprises the steps of testing the linearity of the current sensor before delivery, eliminating unqualified products with the linearity not up to standard, but increasing the overall cost of the products and wasting resources, saving the cost by individual manufacturers, and not testing the linearity of the products, so that the unqualified products flow into the market, and great loss is caused to engineering application.

Disclosure of Invention

In order to solve the above problems, the present technical solution provides a current sensor linearity testing system and a calibration method.

In order to achieve the purpose, the technical scheme is as follows:

the system for testing the linearity of the current sensor comprises a program-controlled digital constant current source and a PC upper computer, wherein the program-controlled digital constant current source is used for providing a reference current Y output by constant current for the current sensor to be calibratediThe PC upper computer is electrically connected with the program-controlled digital constant current source and used for setting output parameters for the program-controlled digital constant current source, and is also electrically connected with the current sensor to be calibrated and used for acquiring the current working current and calibrating the linearity for the current working current.

In some embodiments, the device further comprises a communication interface converter arranged between the PC upper computer and the current sensor to be calibrated.

The application also provides a current sensor linearity calibration method, which comprises the following steps;

s1, selecting the model of the constant current source and the model of the current sensor to be calibrated;

s2, clicking and calibrating on the PC, and sequentially outputting N groups of reference currents Y by the program-controlled digital constant current sourceiTo the current sensor to be calibrated, and simultaneously obtaining the measured values X of N groups of current sensors to be calibrated through a communication interface converteriN is an odd number greater than 2;

s3, the obtained N groups are arranged into paired data (X)i,Yi) Calculating the slope k and the intercept b of a least square regression fitting straight line;

s4, the PC upper computer obtains the formula 1 by the obtained slope k and intercept b: y ═ kX + b;

and S5, sending the formula 1 to the current sensor to be calibrated through the PC upper computer, storing the slope k and the intercept b to the EEPROM by the current sensor to be calibrated, and calibrating and correcting the measured value of the current sensor to be calibrated according to the slope k and the intercept b.

In some embodiments, the step S3 includes the following steps;

s301, solving the formula 2 by using the sum of squared deviations:

s302, respectively solving a first-order partial derivative of the function Q for the slope k and the intercept b, wherein the value after zero partial derivative is zero, and obtaining a formula 3 and a formula 4;

equation 3:

equation 4:

s303, carrying out transformation solving on the formula 2, the formula 3 and the formula 4 to obtain a formula 5 and a formula 6 of a slope k and an intercept b;

equation 5:

equation 6:

s304, converting the N groups of reference currents YiAnd the measured value XiThe values of (a) are substituted into equations 5 and 6 to obtain the slope k and the intercept b.

In some embodiments, N is 19 and the reference current Y isi10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%, 90%, 80%, 70%, 60%, 50%, 40%, 30%, 20%, 10% of the full scale current of the sensor (104) to be measured, respectively.

In some embodiments, the communication interface converter is one of CAN, RS485, or RS 232.

In some embodiments, step S6 is further included;

data (X) pairing N sets of sequencesi,Yi) Substituting the obtained fitting values into formula 1 to obtain N groups of fitted fitting values, and adding the fitting values and the reference current YiAnd comparing the deviation value after fitting with the full-scale current to obtain linearity data.

The beneficial effect of this application does:

1. the invention can improve the linearity of the current sensor by about 1 time by testing and calibrating the linearity of the current sensor, has simple and easy realization method, and can greatly improve the production efficiency and the product qualification rate of products.

2. On the basis of not increasing or slightly increasing the hardware cost, the finished product qualification rate of the product is improved, and the cost of the product is reduced.

3. The invention has the advantages of simple realization and easy operation of the test and calibration of the linearity of the current sensor, and can greatly improve the production and test efficiency of the current sensor.

Drawings

In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below.

FIG. 1 is a first schematic flow chart diagram according to an embodiment of the present invention;

FIG. 2 is a flow diagram illustrating a second embodiment of the present invention;

FIG. 3 is a block diagram of an embodiment of the invention;

FIG. 4 is a table of unfit data for an embodiment of the invention;

FIG. 5 is a table of fitted data for an embodiment of the invention.

Detailed Description

In order to make the technical problems, technical solutions and advantageous effects solved by the present invention more clearly apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

Referring to fig. 1 to 5, a current sensor linearity testing system includes a program-controlled digital constant current source 101 and a PC upper computer 102, where the program-controlled digital constant current source 101 is used for providing a reference current Y of constant current output for a current sensor 104 to be calibratediThe PC upper computer 102 is electrically connected to the program-controlled digital constant current source 101, and is configured to set an output parameter for the PC upper computer 102, and is further electrically connected to the current sensor 104 to be calibrated, and is configured to obtain a current working current and perform linearity calibration for the current working current, the program-controlled digital constant current source 101 may provide a high-precision continuously adjustable constant current power supply, and provide a reference for constant current output for current measurement of the current sensor to be calibrated, and the PC upper computer 102 mainly performs three functions, 1: setting a high digital program-controlled constant current source, namely 101 voltage and current output parameters, and providing constant reference measurement current for a current sensor to be calibrated; 2, communicating with a current sensor 104 to be calibrated through a communication interface converter 103, and reading a measured current; 3, outputting a reference current Y to the digital program-controlled constant current source 101 by using a least square linear regression methodiAnd measuring current value X by the current sensor to be calibratediPerforming linear fitting calculation, and sending the calculation result to the current sensor to be calibratedAnd (5) calibrating the line linearity.

Preferably, the PC upper computer 102 is implemented by a PC and an upper computer software 102.

In this embodiment, the device further comprises a communication interface converter 103 arranged between the PC upper computer 102 and the current sensor 104 to be calibrated, the current sensor 104 to be calibrated is a current sensor which needs to be subjected to linearity test and calibration, the MCU is internally provided with a data communication interface, the digital current sensor has an EEPROM data storage function, and sends measured current data to the PC upper computer software through the communication interface and can receive calibration data sent by the PC upper computer.

The application also provides a current sensor linearity calibration method, which comprises the following steps;

s1, selecting the type of the constant current source, selecting the type of the current sensor to be calibrated 104, opening the test calibration software of the upper computer of the current sensor, communicating the upper computer of the PC with the current sensor to be calibrated, and outputting through the program control digital constant current source;

s2, clicking on the PC upper computer 102 for calibration, and sequentially outputting N groups of reference currents Y by the program-controlled digital constant current source 101iTo the current sensor 104 to be calibrated, and simultaneously obtain the measured values X of the N groups of current sensors 104 to be calibrated through the communication interface converter 103iAnd N is an odd number greater than 2, for better illustration of the present application, the present application provides an embodiment with a full scale 500A, as shown in fig. 4, inputting 19 sets of reference values YiAnd acquiring 19 sets of measurements XiReference value YiAnd the actual measured value XiThe phase difference is a deviation, and the deviation is divided by the full scale to obtain 19 sets of linearity, and the linearity (non-linearity error) before calibration is 0.1676% as can be seen from the table;

s3, the obtained N groups are arranged into paired data (X)i,Yi) Calculating the slope k and the intercept b of a least square regression fitting straight line, wherein the slope k is 0.99895 and the intercept b is 129.508 by calculation;

s4, the PC upper computer 102 obtains the formula 1 from the obtained slope k and intercept b: obtaining a fitting mathematical formula Y of a least square linear regression algorithm by calculation, wherein the fitting mathematical formula Y is 0.99895X +129.508, and the formula is output to the current sensor to be calibrated;

s5, sending the formula 1 to the current sensor 104 to be calibrated through the PC upper computer 102, storing the slope k and the intercept b to the EEPROM by the current sensor 104 to be calibrated, calibrating and correcting the measurement value of the current sensor 104 to be calibrated according to the slope k and the intercept b, automatically adjusting and calibrating the current sensor to be calibrated after acquiring the formula, and obtaining 19 groups of measurement values XiThe output current of the linear motor can be changed by substituting the linear motor into a fitting mathematical formula, 19 groups of latest fitting values are produced, the linear degree after the linear motor and the linear motor are combined can be obtained after the deviation is calculated, the linear degree (nonlinear error) after the linear motor and the linear motor are calibrated can be known to be 0.098826% from a table, and the linear degree can be improved by nearly 1 time after the least square linear regression algorithm is adopted to carry out the linear degree calibration.

In this embodiment, the step S3 includes the following steps;

s301, further,for the dispersion between the reference standard value and the regression line fitting predicted value, the smaller the total dispersion composed of n dispersions is, the better it is, however, because the dispersions have positive or negative values, the direct addition can cancel each other out, so the proximity degree of the data can not be reflected, namely the total dispersion can not be represented by the sum of n dispersions, and the general method is that we use the square sum of the dispersions;

solving equation 2 by using the sum of squared deviations:

s302, further, to minimize the value of the equation Q, the first-order partial derivatives of the function Q for k and b need to be obtained, and the value after zero partial derivative is 0, so as to obtain formula 3 and formula 4;

equation 3:

equation 4:

s303, finally, carrying out transformation solving on the formula 2, the formula 3 and the formula 4 to obtain a formula 5 and a formula 6 of a slope k and an intercept b;

equation 5:

equation 6:

s304, converting the N groups of reference currents YiAnd the measured value XiThe values of (a) are substituted into equations 5 and 6 to obtain the slope k and intercept b, illustrated in the table of fig. 4, n-19, substituting these values into equations 5 and 6 yields: and k is 0.99895, and b is 129.508, and the K, b value is substituted into the formula 1 to obtain a fitting mathematical formula of the least square linear regression algorithm.

In this embodiment, N is 19, and the reference current Yi10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%, 90%, 80%, 70%, 60%, 50%, 40%, 30%, 20%, 10% of the full scale current of the sensor 104 to be measured, respectively.

In this embodiment, the communication interface converter 103 is one of CAN, RS485 or RS 232.

In this embodiment, step S6 is further included;

data (X) pairing N sets of sequencesi,Yi) Substituting the obtained fitting values into formula 1 to obtain N groups of fitted fitting values, and adding the fitting values and the reference current YiAnd comparing the deviation value after fitting with the full-scale current to obtain linearity data.

The above description is only for the purpose of illustrating the preferred embodiments of the present application and is not intended to limit the scope of the present application, which is within the scope of the present application, except that the same or similar principles and basic structures as the present application may be used.

13页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种水轮发电机组在线状态监测系统现场校验装置和方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!