CN118171530A - Conductor eccentricity self-adaptive correction method of array type single-axis TMR current sensor - Google Patents
Conductor eccentricity self-adaptive correction method of array type single-axis TMR current sensor Download PDFInfo
- Publication number
- CN118171530A CN118171530A CN202410370231.5A CN202410370231A CN118171530A CN 118171530 A CN118171530 A CN 118171530A CN 202410370231 A CN202410370231 A CN 202410370231A CN 118171530 A CN118171530 A CN 118171530A
- Authority
- CN
- China
- Prior art keywords
- tmr
- conductor
- eccentricity
- error
- correction
- 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
Links
- 238000012937 correction Methods 0.000 title claims abstract description 104
- 239000004020 conductor Substances 0.000 title claims abstract description 89
- 238000000034 method Methods 0.000 title claims abstract description 53
- 238000013528 artificial neural network Methods 0.000 claims abstract description 78
- 238000005259 measurement Methods 0.000 claims abstract description 71
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 44
- 238000012549 training Methods 0.000 claims abstract description 37
- 238000004458 analytical method Methods 0.000 claims abstract description 23
- 238000004088 simulation Methods 0.000 claims abstract description 20
- 238000012795 verification Methods 0.000 claims abstract description 11
- 230000008859 change Effects 0.000 claims abstract description 10
- 230000005291 magnetic effect Effects 0.000 claims description 99
- 230000006698 induction Effects 0.000 claims description 33
- 230000008569 process Effects 0.000 claims description 24
- 238000010586 diagram Methods 0.000 claims description 20
- 230000000694 effects Effects 0.000 claims description 20
- 230000003044 adaptive effect Effects 0.000 claims description 16
- 238000012360 testing method Methods 0.000 claims description 16
- 230000006870 function Effects 0.000 claims description 15
- 230000035945 sensitivity Effects 0.000 claims description 10
- 238000009826 distribution Methods 0.000 claims description 9
- 238000013461 design Methods 0.000 claims description 8
- 230000004913 activation Effects 0.000 claims description 6
- 230000003321 amplification Effects 0.000 claims description 6
- 230000005415 magnetization Effects 0.000 claims description 6
- 238000003199 nucleic acid amplification method Methods 0.000 claims description 6
- 230000035699 permeability Effects 0.000 claims description 6
- 230000005540 biological transmission Effects 0.000 claims description 5
- 239000003302 ferromagnetic material Substances 0.000 claims description 5
- 238000011156 evaluation Methods 0.000 claims description 4
- 238000012935 Averaging Methods 0.000 claims description 3
- 101001095088 Homo sapiens Melanoma antigen preferentially expressed in tumors Proteins 0.000 claims description 3
- 102100037020 Melanoma antigen preferentially expressed in tumors Human genes 0.000 claims description 3
- NIXOWILDQLNWCW-UHFFFAOYSA-N acrylic acid group Chemical group C(C=C)(=O)O NIXOWILDQLNWCW-UHFFFAOYSA-N 0.000 claims description 3
- 238000004364 calculation method Methods 0.000 claims description 3
- 230000003750 conditioning effect Effects 0.000 claims description 3
- 238000000354 decomposition reaction Methods 0.000 claims description 3
- 238000002474 experimental method Methods 0.000 claims description 3
- 238000013178 mathematical model Methods 0.000 claims description 3
- 230000007246 mechanism Effects 0.000 claims description 3
- 238000003062 neural network model Methods 0.000 claims description 3
- 238000012545 processing Methods 0.000 claims description 3
- 238000010200 validation analysis Methods 0.000 claims description 3
- 102100039250 Essential MCU regulator, mitochondrial Human genes 0.000 claims description 2
- 101000813097 Homo sapiens Essential MCU regulator, mitochondrial Proteins 0.000 claims description 2
- 230000008676 import Effects 0.000 claims description 2
- 238000009827 uniform distribution Methods 0.000 claims description 2
- 241000287127 Passeridae Species 0.000 abstract description 21
- 238000010845 search algorithm Methods 0.000 abstract description 9
- 238000005457 optimization Methods 0.000 description 4
- 244000062645 predators Species 0.000 description 4
- 230000004044 response Effects 0.000 description 3
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 2
- 230000006399 behavior Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000013507 mapping Methods 0.000 description 2
- 238000000691 measurement method Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000001052 transient effect Effects 0.000 description 2
- 230000005355 Hall effect Effects 0.000 description 1
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 101100233916 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) KAR5 gene Proteins 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 230000003162 anti-predator Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000009795 derivation Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000005674 electromagnetic induction Effects 0.000 description 1
- 230000002431 foraging effect Effects 0.000 description 1
- 238000011478 gradient descent method Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 230000005389 magnetism Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
- G06F30/23—Design optimisation, verification or simulation using finite element methods [FEM] or finite difference methods [FDM]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
- G06F30/27—Design optimisation, verification or simulation using machine learning, e.g. artificial intelligence, neural networks, support vector machines [SVM] or training a model
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
- G06N3/084—Backpropagation, e.g. using gradient descent
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Evolutionary Computation (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Geometry (AREA)
- Computer Hardware Design (AREA)
- Artificial Intelligence (AREA)
- Software Systems (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Data Mining & Analysis (AREA)
- Computational Linguistics (AREA)
- Mathematical Physics (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Medical Informatics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Health & Medical Sciences (AREA)
- Measuring Magnetic Variables (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及电力系统技术领域,尤其涉及一种阵列式单轴TMR电流传感器的导体偏心自适应校正方法。The present invention relates to the technical field of power systems, and in particular to a conductor eccentricity adaptive correction method for an array-type single-axis TMR current sensor.
背景技术Background technique
随着电力系统的不断现代化,依赖于实时、准确的电流信息的智能电网成为了现代电力系统的发展目标,而高精度电流测量在其中扮演着不可或缺的角色。With the continuous modernization of power systems, smart grids that rely on real-time and accurate current information have become the development goal of modern power systems, and high-precision current measurement plays an indispensable role in it.
传统的电磁感应式电流传感器通过磁芯聚磁提高抗干扰能力,但是在电力系统发生故障时,电流突增使磁芯饱和,限制电流的测量范围造成暂态性能较差,同时也存在重量和体积较大的问题无法在不同环境的电力系统中广泛应用。Traditional electromagnetic induction current sensors improve their anti-interference ability by concentrating magnetism through the magnetic core. However, when a fault occurs in the power system, the sudden increase in current causes the magnetic core to saturate, limiting the current measurement range and resulting in poor transient performance. They also have the problems of large weight and volume, which prevents them from being widely used in power systems in different environments.
近年来,随着集成电路中微型磁传感器技术的更新迭代,涌现了霍尔效应(HallEffect)、各向异性磁阻(AMR)效应、巨磁阻(GMR)效应以及最新一代隧道磁阻(TMR)效应电流传感器。比起上三代磁传感器,TMR电流传感器有非常高的灵敏度,能够感测微小的磁场变化,这使得它在低电流测量和高精度应用中表现出色;同时具有快速的响应时间,适用于需要实时监测和控制的应用,例如在电力系统中的故障检测和快速响应。TMR电流传感器分为闭环和开环两类,由于开环TMR电流传感器没有反馈环节具有较快的响应时间,且无铁芯结构不存在饱和问题大大提高瞬态性能,因此在输电线路上常常使用开环TMR电流传感器。In recent years, with the update and iteration of micro magnetic sensor technology in integrated circuits, Hall Effect, Anisotropic Magnetoresistance (AMR), Giant Magnetoresistance (GMR) and the latest generation of Tunnel Magnetoresistance (TMR) effect current sensors have emerged. Compared with the previous three generations of magnetic sensors, TMR current sensors have very high sensitivity and can sense tiny magnetic field changes, which makes them perform well in low current measurement and high-precision applications; at the same time, they have fast response time and are suitable for applications that require real-time monitoring and control, such as fault detection and fast response in power systems. TMR current sensors are divided into closed-loop and open-loop categories. Since open-loop TMR current sensors have no feedback link and have a faster response time, and the coreless structure does not have saturation problems, which greatly improves transient performance, open-loop TMR current sensors are often used on transmission lines.
基于聚磁环的开环电流传感器在测量激变大电流和直流时往往存在磁芯饱和、直流偏激等问题,为了解决这一问题1990年J.T.Scoville首次提出了阵列式电流传感器的方案。通过多个磁传感器布置在通电导体的闭合回路上,磁传感器的加和模拟通电导体产生的磁场在闭合回路上的积分,再通过安培环路定律反演得到被测电流。Open-loop current sensors based on magnetic rings often have problems such as core saturation and DC bias when measuring large currents and DC. In order to solve this problem, J.T.Scoville first proposed an array current sensor solution in 1990. Multiple magnetic sensors are arranged in a closed loop of a current-carrying conductor. The sum of the magnetic sensors simulates the integral of the magnetic field generated by the current-carrying conductor in the closed loop, and then the measured current is obtained by inverting Ampere's loop law.
在分析实际应用中阵列式TMR电流传感器存在的测量误差时,除了温度漂移和串扰影响外,导体位置偏心是主要的误差来源。但在实际运用中,由于多轴传感器元件之间存在一定的距离无法准确测量同一点的场强强度,不能完全消除导体偏心误差。When analyzing the measurement errors of array TMR current sensors in practical applications, in addition to temperature drift and crosstalk, conductor position eccentricity is the main source of error. However, in practical applications, due to the certain distance between multi-axis sensor elements, the field strength at the same point cannot be accurately measured, and the conductor eccentricity error cannot be completely eliminated.
发明内容Summary of the invention
本发明的目的在于提供一种阵列式单轴TMR电流传感器的导体偏心自适应校正方法,解决背景技术中提到的技术问题。The object of the present invention is to provide a conductor eccentricity adaptive correction method for an array-type single-axis TMR current sensor to solve the technical problems mentioned in the background technology.
就导体位置偏心问题进行理论和误差分析,提出一种基于阵列式单轴TMR传感器测量方法,通过麻雀算法优化BP神经网络(SSA-BP)寻找导体偏心位置与传感器输出之间变比的关系进而反馈校正因子消除导体的偏心误差,并给出该电流测量方法的理论仿真和实验验证。Theoretical and error analysis are carried out on the problem of conductor eccentricity, and a measurement method based on array single-axis TMR sensor is proposed. The relationship between the eccentric position of the conductor and the transformation ratio of the sensor output is found by optimizing the BP neural network (SSA-BP) through the sparrow algorithm, and then the correction factor is fed back to eliminate the eccentricity error of the conductor. The theoretical simulation and experimental verification of the current measurement method are given.
为了实现上述目的,本发明采用的技术方案如下:In order to achieve the above object, the technical solution adopted by the present invention is as follows:
一种阵列式单轴TMR电流传感器的导体偏心自适应校正方法,所述方法包括如下步骤:A conductor eccentricity adaptive correction method for an array-type single-axis TMR current sensor, the method comprising the following steps:
步骤1:对TMR电流传感器的原理和误差进行分析;Step 1: Analyze the principle and error of TMR current sensor;
步骤2:建立自校正算法模型;Step 2: Establish a self-correction algorithm model;
步骤3:基于comsol的有限元仿真分析;Step 3: Finite element simulation analysis based on comsol;
步骤4:设置实验平台进行验证。Step 4: Set up the experimental platform for verification.
进一步地,步骤1的具体过程为:Furthermore, the specific process of step 1 is:
步骤1.1:TMR电流传感器原理分析,TMR元件的磁性隧道结基本结构为一个三角形结构,有两个铁磁性材料层夹着非磁性的绝缘层组成,两个铁磁性材料层为自由层和被钉扎层,固定大小的磁场下被钉扎层的磁化方向保持不变,而自由层的磁化方向受磁场的影响发生转动,当两个磁性层的磁矩方向平行时,电阻较小,当方向反平行时,电阻较大,通过TMR磁电阻的变化反映外加磁场对TMR结构的影响,引起惠斯通电桥不平衡来输出差分变化的信号电压来实现测量电流;Step 1.1: Analysis of the principle of TMR current sensor. The basic structure of the magnetic tunnel junction of the TMR element is a triangular structure, which consists of two ferromagnetic material layers sandwiching a non-magnetic insulating layer. The two ferromagnetic material layers are the free layer and the pinned layer. The magnetization direction of the pinned layer remains unchanged under a fixed magnetic field, while the magnetization direction of the free layer rotates under the influence of the magnetic field. When the magnetic moments of the two magnetic layers are parallel, the resistance is small, and when the directions are anti-parallel, the resistance is large. The change of TMR magnetoresistance reflects the influence of the external magnetic field on the TMR structure, causing the imbalance of the Wheatstone bridge to output the differential signal voltage to achieve current measurement;
建立等效惠斯通电桥式模型,R1、R2、R3和R4为磁电阻,R1和R3磁矩方向相同,R2和R4磁矩方向相同,当无外界磁场时,桥路上的磁电阻值相等即R1=R2=R3=R4,则电桥输出信号为0,当外界磁场作用时,磁电阻受到磁场的作用阻值发生等量的变化,R1、R3与R2、R4方向相反,将磁信号转换为差分电压信号,电桥输出的电压需要经过信号调理电路放大,表示为:An equivalent Wheatstone bridge model is established. R1, R2, R3 and R4 are magnetoresistances. The directions of the magnetic moments of R1 and R3 are the same, and the directions of the magnetic moments of R2 and R4 are the same. When there is no external magnetic field, the magnetoresistance values on the bridge are equal, that is, R1=R2=R3=R4, and the output signal of the bridge is 0. When an external magnetic field acts, the magnetoresistance changes by the same amount due to the effect of the magnetic field. The directions of R1 and R3 are opposite to those of R2 and R4, and the magnetic signal is converted into a differential voltage signal. The voltage output by the bridge needs to be amplified by the signal conditioning circuit, which is expressed as:
Vout=Gop·Vtmr (1)V out =G op ·V tmr (1)
其中Vout表示差分放大后的输出电压,Gop是运算放大器的放大倍数,Vtmr是单个TMR传感器的输出电压;Where V out represents the output voltage after differential amplification, G op is the amplification factor of the operational amplifier, and V tmr is the output voltage of a single TMR sensor;
步骤1.2:环形TMR阵列测量原理分析,根据安培环路定律磁感应强度B沿闭合路径的线积分等于该路径所包围的各个电流的代数和乘以磁导率,故可通过环形TMR阵列形成封闭环路近似路径的线积分;Step 1.2: Analysis of the measurement principle of the annular TMR array. According to Ampere's loop law, the line integral of the magnetic induction intensity B along a closed path is equal to the algebraic sum of the currents enclosed by the path multiplied by the magnetic permeability. Therefore, the line integral of the closed loop approximate path can be formed by the annular TMR array.
∫lBdl=μ0∑I (3)∫ l Bdl=μ 0 ∑I (3)
其中μ0为真空磁导率,通常取4π*10-7,同时由于输电线路可近似为无限长直导体,根据毕奥萨伐尔定律,TMR传感器输出Vtmr:Where μ 0 is the vacuum magnetic permeability, usually 4π*10 -7 . At the same time, since the transmission line can be approximated as an infinitely long straight conductor, according to the Biot-Savart law, the TMR sensor output V tmr is:
其中ks和Bs分别是TMR传感器的灵敏度和磁感应强度测量值,为导体产生的磁场在传感器的磁感应强度向量,/>为流过导体的电流向量,/>为传感器敏感轴单位向量,/>为导线中心到传感器中心的半径向量,N个传感器总输出如下:Where k s and B s are the sensitivity and magnetic induction intensity measurement value of the TMR sensor, respectively. is the magnetic induction intensity vector of the magnetic field generated by the conductor at the sensor,/> is the current vector flowing through the conductor, /> is the sensor sensitive axis unit vector, /> is the radius vector from the center of the wire to the center of the sensor. The total output of N sensors is as follows:
阵列传感器输出的平均值Vmean:The average value V mean of the array sensor output is:
联立公式(3)-(6)反演出导体电流的测量值Im:The measured value of the conductor current Im is obtained by combining equations (3)-(6):
步骤1.3:偏心误差分析,载流导体与阵列式TMR电流传感器的交点不在中心点上,产生测量误差,被测电流I0垂直于xy平面由内向外流出,方位角α是y轴和偏心导体的偏心距离向量的夹角,β是传感器S1处产生的磁感应强度/>和敏感轴/>的夹角,由式(4)可知,TMR传感器输出电压与导体在传感器上生成的磁感应强度向量和敏感轴单位方向向量的点乘有关,通过几何关系分解可得:Step 1.3: Eccentricity error analysis. The intersection of the current-carrying conductor and the array TMR current sensor is not at the center point, resulting in measurement error. The measured current I0 flows perpendicular to the xy plane from inside to outside. The azimuth angle α is the eccentric distance vector between the y-axis and the eccentric conductor. The angle between the two, β is the magnetic induction intensity generated at the sensor S1/> and sensitive axis/> From formula (4), we can know that the output voltage of the TMR sensor is related to the dot product of the magnetic induction intensity vector generated by the conductor on the sensor and the unit direction vector of the sensitive axis. Through geometric decomposition, we can get:
由余弦定理可得:From the cosine theorem we can get:
r1 2=r0 2+d2-2r0dcosα (10)r 1 2 = r 0 2 + d 2 - 2r 0 dcos α (10)
联立式子(4)、(8)、(9)和(10)可得:Combining equations (4), (8), (9) and (10) we can obtain:
继续推导可得传感器Si的输出电压Vi:Continuing to deduce, we can get the output voltage V i of sensor S i :
进行加和平均Vmean后可求出偏心电流测量值Im:After adding and averaging V mean , the eccentric current measurement value Im can be obtained:
其中N=3,已知,进一步可得到偏心造成的测量相对误差εu:Where N = 3, It is known that the relative measurement error ε u caused by eccentricity can be further obtained:
由上式可知,测量误差的大小与偏心距离d和方位角α两个偏心变量有关,与被测电流值的大小等因素无关。使用matlab进行数值仿真,定义tp为导体偏心距离和阵列半径的比值,即:From the above formula, we can know that the measurement error is related to the two eccentric variables, eccentric distance d and azimuth angle α, and has nothing to do with the magnitude of the measured current. Using MATLAB for numerical simulation, tp is defined as the ratio of the conductor eccentric distance to the array radius, that is:
改变tp并取方位角α作为坐标轴,可得到导体偏心误差的关系。By changing t p and taking the azimuth angle α as the coordinate axis, the relationship of the conductor eccentricity error can be obtained.
进一步地,步骤2的具体过程为:Furthermore, the specific process of step 2 is:
步骤2.1:建立BP神经网络和SSA算法;Step 2.1: Establish BP neural network and SSA algorithm;
步骤2.2:根据BP神经网络和SSA算法建立SSA-BP的自校正算法;Step 2.2: Establish the SSA-BP self-correction algorithm based on the BP neural network and the SSA algorithm;
步骤2.3:建立SSA-BP神经网络。Step 2.3: Establish SSA-BP neural network.
进一步地,步骤2.2的具体过程为:Furthermore, the specific process of step 2.2 is:
由于偏心使每个TMR传感器与导体的距离r和方位角αi发生变化,各TMR传感器的测量值不再相等,同时使各TMR传感器输出之间的变比发生相应的变化,设置使不同位置的TMR传感器的磁感应强度测量值之间变比作为神经网络的输入,如下式:Since the eccentricity causes the distance r and azimuth angle α i of each TMR sensor to change from the conductor, the measured values of each TMR sensor are no longer equal, and the ratio between the outputs of each TMR sensor changes accordingly. The ratio between the measured values of the magnetic induction intensity of TMR sensors at different positions is set as the input of the neural network, as shown in the following formula:
其中BS1、BS2和BS3分别是TMR传感器S1、S2和S3的磁感应强度测量值,BP神经网络生成的过程中需要标准的输出进行训练,通过无偏心时导体在TMR传感器上生成的磁感应强度Bt与传感器测量值BSi的变比为理论的校正因子kti作为训练过程的输出:Among them, BS1 , BS2 and BS3 are the magnetic induction intensity measurement values of TMR sensors S1, S2 and S3 respectively. The BP neural network generation process requires standard output for training. The ratio of the magnetic induction intensity Bt generated by the conductor on the TMR sensor when there is no eccentricity to the sensor measurement value BSi is the theoretical correction factor kti as the output of the training process:
以x1、x2和x3为输入kt1、kt2和kt3为输出训练生成BP神经网络,移植网络获得校正因子k1、k2和k3的输出以消除偏心误差,从而获得经过校正后的测量电流值Ia:The BP neural network is trained with x 1 , x 2 and x 3 as input and k t1 , k t2 and k t3 as output. The network is transplanted to obtain the output of correction factors k 1 , k 2 and k 3 to eliminate the eccentricity error, thereby obtaining the corrected measured current value I a :
将BP神经网络的误差值作为SSA算法的适应度函数,通过融合全局搜索和局部搜索的机制直接确定BP神经网络模型中的最优权值与阈值。The error value of BP neural network is used as the fitness function of SSA algorithm, and the optimal weight and threshold in BP neural network model are directly determined by integrating global search and local search mechanism.
进一步地,步骤2.3的具体过程为:Furthermore, the specific process of step 2.3 is:
采用理论推导出的导体不同位置的输入输出数据作为网络的训练集,首先设置被测电流I0=100A,环形阵列半径r0=50mm,再联立式4和式12求出在环形阵列内均匀分布的不同位置下3个TMR传感器的磁感应强度的测量值,最后按步骤2.3的方法建立训练的数据集400份;The input and output data of different positions of the conductor derived from the theory are used as the training set of the network. First, the measured current I 0 = 100A and the radius of the ring array r 0 = 50mm are set. Then, equation 4 and equation 12 are combined to obtain the measured values of the magnetic induction intensity of the three TMR sensors at different positions evenly distributed in the ring array. Finally, 400 training data sets are established according to the method in step 2.3.
进行神经网络参数设置,建立3输入3输出BP神经网络拓扑结构,隐藏层激活函数采用logsig函数,输出层激活函数采用pureline函数,循环隐含层节点与训练误差的情况确定最佳的隐含层节点,进行网络参数设置,神经网络最大训练数为100次,学习速率设置0.01,训练目标最小误差1e-10,其他参数均设为默认值,初始化SSA算法初始参数,初始种群规模为50,最大迭代数为10,自变量上下限分别为5和-5,安全值ST设为0.8。The neural network parameters were set, and a 3-input 3-output BP neural network topology was established. The hidden layer activation function used the logsig function, and the output layer activation function used the pureline function. The hidden layer nodes and the training error were cyclically analyzed to determine the best hidden layer nodes. The network parameters were set, the maximum number of neural network training times was 100, the learning rate was set to 0.01, the minimum training target error was 1e-10, and other parameters were set to default values. The initial parameters of the SSA algorithm were initialized, the initial population size was 50, the maximum number of iterations was 10, the upper and lower limits of the independent variables were 5 and -5 respectively, and the safety value ST was set to 0.8.
进行网络训练学习,网络在57次训练后达到最佳,其均方误差MSE为0.00072接近于0;After 57 trainings, the network reached the best performance, with a mean square error (MSE) of 0.00072, close to 0.
神经网络自动计算并绘图目标值和预测值的相关系数R其拟合效果,将数据分为四个部分:训练、验证、测试和整体,横纵坐标分别代表样本实际值和网络的输出值,相关系数R越接近1表示线性化程度越高,训练效果越好,散点贴合回归线且整体相关系数R为0.9886,说明网络性能优良;The neural network automatically calculates and plots the correlation coefficient R between the target value and the predicted value and its fitting effect. The data is divided into four parts: training, validation, testing and overall. The horizontal and vertical axes represent the actual value of the sample and the output value of the network respectively. The closer the correlation coefficient R is to 1, the higher the degree of linearization and the better the training effect. The scattered points fit the regression line and the overall correlation coefficient R is 0.9886, indicating that the network performance is excellent.
将BP神经网络和SSA-BP神经网络的学习结果评价指标进行对比,BP和SSA-BP预测模型的平均绝对误差EMAE分别为0.0062和0.0048,均方根误差ERMSE分别为0.0532和0.0268,平均绝对百分比误差EMAPE分别为0.5568%和0.4446%,由此可知SSA-BP预测效果更优越。The learning result evaluation indicators of BP neural network and SSA-BP neural network are compared. The mean absolute error E MAE of BP and SSA-BP prediction models are 0.0062 and 0.0048, the root mean square error E RMSE is 0.0532 and 0.0268, and the mean absolute percentage error E MAPE is 0.5568% and 0.4446%, respectively. It can be seen that the prediction effect of SSA-BP is superior.
进一步地,步骤3的具体过程为:Furthermore, the specific process of step 3 is:
步骤3.1:使用comsol有限元仿真软件对TMR环形阵列电流传感器进行磁场仿真,TMR传感单元圆周半径为50mm,载流导体半径10mm,长为200mm,施加直流电流100A,需要注意的是TMR传感单元仅对圆周切线方向上的磁场分量敏感,对导体在环形阵列内均匀取不同的偏心位置进行磁场仿真,分别收集3个TMR传感单元的磁感应强度值BSi,整理建立仿真测试数据集导入步骤2.4建立的神经网络进行测试验证。Step 3.1: Use Comsol finite element simulation software to simulate the magnetic field of the TMR annular array current sensor. The circumferential radius of the TMR sensing unit is 50 mm, the radius of the current-carrying conductor is 10 mm, the length is 200 mm, and a DC current of 100 A is applied. It should be noted that the TMR sensing unit is only sensitive to the magnetic field component in the tangential direction of the circle. The magnetic field simulation is performed on the conductor at different eccentric positions uniformly in the annular array. The magnetic induction intensity values B Si of the three TMR sensing units are collected respectively, and the simulation test data set is organized and imported into the neural network established in step 2.4 for test verification.
步骤3.2:将神经网络输出的校正因子ki代入式21可得到校正后导体电流的测量值Ia,计算出校正后的测量误差进行效果分析,将校正前和经过基于SSA-BP的自校正算法校正后的偏心误差分布图作比较,SSA-BP校正后呈现出均匀的、接近0的分布,其误差最大值从校正前的33.86%降到了0.92%,自适应校正算法对于偏心情况都能够进行预测测量;Step 3.2: Substituting the correction factor k i output by the neural network into equation 21, the measured value of the conductor current after correction I a can be obtained. The measurement error after correction is calculated for effect analysis. The distribution diagram of the eccentricity error before correction and after correction by the self-correction algorithm based on SSA-BP is compared. After SSA-BP correction, it presents a uniform distribution close to 0, and its maximum error is reduced from 33.86% before correction to 0.92%. The adaptive correction algorithm can perform predictive measurement for eccentricity conditions;
偏心误差εu随导体偏心距离d的变大而增大,同时随方位角α周期性变化,故令偏心比tp=0.4,方位角α步长为10°,将未校正、BP神经网络校正和SSA-BP神经网络校正后的测量误差进行比较,加入自校正算法后能够有效降低偏心误差,同时SSA-BP神经网络校正后的测量值鲁棒性比BP神经网络更好。The eccentricity error ε u increases with the increase of the conductor eccentricity distance d, and changes periodically with the azimuth angle α. Therefore, the eccentricity ratio t p = 0.4 and the step size of the azimuth angle α are set to 10°. The measurement errors without correction, after BP neural network correction and after SSA-BP neural network correction are compared. The addition of the self-correction algorithm can effectively reduce the eccentricity error. At the same time, the measurement value after SSA-BP neural network correction has better robustness than that of BP neural network.
进一步地,步骤4的具体过程为:Furthermore, the specific process of step 4 is:
步骤4.1:实验平台设计,设计开口式基于单轴TMR2901的阵列式电流传感器,环形阵列半径r=50mm,3个单轴TMR电流传感器在xy轴上以120°均匀固定在亚克力板上;Step 4.1: Experimental platform design: design an open array current sensor based on uniaxial TMR2901, with a circular array radius of r = 50 mm. Three uniaxial TMR current sensors are evenly fixed on the acrylic board at 120° on the xy axis.
由公式14可知偏心测量值误差与被测电流的大小无关,选用直流电源KPS6020D调整到定电压模式CV输出30V的恒压,与设为2Ω定电阻模式的电子负载仪IT8512A串联输出15A的直流电,通过调整导线固定座上移动卡扣改变导体的偏心位置,并在示波器Tektronix MSO56B上采集TMR电流传感器的波形和输出电压的测量值,将收集到的数据集导入计算机进行处理运算;From formula 14, it can be seen that the error of the eccentricity measurement value has nothing to do with the magnitude of the measured current. The DC power supply KPS6020D is selected and adjusted to the constant voltage mode CV to output a constant voltage of 30V. It is connected in series with the electronic load meter IT8512A set to the 2Ω constant resistance mode to output a DC power of 15A. The eccentricity position of the conductor is changed by adjusting the movable buckle on the wire fixing seat. The waveform and output voltage measurement value of the TMR current sensor are collected on the oscilloscope Tektronix MSO56B, and the collected data set is imported into the computer for processing and calculation;
步骤4.2:TMR电流传感器校准,准确测量电流需知道TMR电流传感器的灵敏度ks,故在导体无偏心和无干扰的情况下进行5次基本精度测量实验,将标准输入电流值与TMR电流传感器的输出电压值作最小二乘法拟合,取斜率和截距的平均值可得到传感器的灵敏度ks和偏置电压,消除偏置电压并建立输入电流与传感器输出电压之间的数学模型,从而通过传感器的输出电压可反演得到电流的测量值,当导体电流从0A变化到20A变化时,平均相对误差EMRE为0.14%,其中输入电流为15A时为0.12%,造成误差原因为传感器内部噪声和测量误差;Step 4.2: TMR current sensor calibration. To accurately measure the current, the sensitivity k s of the TMR current sensor must be known. Therefore, 5 basic accuracy measurement experiments were carried out without eccentricity and interference of the conductor. The standard input current value and the output voltage value of the TMR current sensor were fitted by the least square method. The sensitivity k s and bias voltage of the sensor were obtained by taking the average of the slope and intercept. The bias voltage was eliminated and a mathematical model between the input current and the sensor output voltage was established. The measured current value can be inverted through the output voltage of the sensor. When the conductor current changes from 0A to 20A, the average relative error E MRE is 0.14%, of which the input current is 0.12% when it is 15A. The error is caused by the internal noise of the sensor and the measurement error.
步骤4.3:将采集到的TMR电流传感器输出电压值Vi通过公式4转换为相应的磁感应强度测量值Bsi建立实验测试数据集,导入步骤3.4生成的神经网络进而反馈校正因子ki代入公式21得到校正后的电流测量值Ia,进行校正效果分析;Step 4.3: Convert the collected TMR current sensor output voltage value V i into the corresponding magnetic induction intensity measurement value B si through formula 4 to establish an experimental test data set, import the neural network generated in step 3.4, and then feed back the correction factor k i and substitute it into formula 21 to obtain the corrected current measurement value I a , and analyze the correction effect;
实验校正前与理论推导的误差曲线随方位角α变化的趋势一致,同时将测试集导入自校正算法模型后与校正前的测量误差作比较加入BP和SSA-BP自校正算法校正后能够将校正前平均相对误差EMRE的4.03%分别降低到1.02%和0.47%,可知SSA-BP的自校正算法能够消除偏心误差。Before the experimental correction, the error curve derived from the theory shows a trend consistent with that of the azimuth angle α. At the same time, the test set is imported into the self-correction algorithm model and compared with the measurement error before correction. After adding the BP and SSA-BP self-correction algorithms for correction, the average relative error EMRE of 4.03% before correction can be reduced to 1.02% and 0.47% respectively. It can be seen that the SSA-BP self-correction algorithm can eliminate the eccentricity error.
本发明由于采用了上述技术方案,具有以下有益效果:The present invention has the following beneficial effects due to the adoption of the above technical solution:
本发明基于麻雀搜索算法(SSA)优化BP神经网络的TMR电流传感器偏心补偿模型,采用麻雀搜索算法(SSA)优化BP神经网络的权值和阈值进行训练学习,寻找导体偏心位置与传感器输出之间的变化的关系,进而反馈校正因子消除导体偏心影响,通过有限元仿真和实验验证,证明了该方法抵抗偏心误差方面的显著性能,大大提高了电流测量的准确性,这不仅为TMR电流传感器在实际工程应用中的可靠性和稳定性提供了有力支持,也为其他传感器的偏心自适应校正研究提供了一种有效的方法和思路。The present invention is based on a TMR current sensor eccentricity compensation model of a BP neural network optimized by a sparrow search algorithm (SSA). The weights and thresholds of the BP neural network are optimized by the sparrow search algorithm (SSA) for training and learning, and the relationship between the eccentric position of the conductor and the change of the sensor output is found, and then the correction factor is fed back to eliminate the influence of the conductor eccentricity. Through finite element simulation and experimental verification, it is proved that the method has significant performance in resisting eccentricity errors, and the accuracy of current measurement is greatly improved. This not only provides strong support for the reliability and stability of the TMR current sensor in practical engineering applications, but also provides an effective method and idea for the study of eccentricity adaptive correction of other sensors.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本发明等效惠斯通电桥模型图;FIG1 is a diagram of an equivalent Wheatstone bridge model of the present invention;
图2是本发明环形阵列TMR结构图;FIG2 is a structural diagram of the annular array TMR of the present invention;
图3是本发明导体偏心测量误差分析图;FIG3 is a diagram showing an analysis of conductor eccentricity measurement errors according to the present invention;
图4是本发明导体偏心误差的关系图;FIG4 is a diagram showing the relationship between conductor eccentricity errors of the present invention;
图5是本发明Bp神经网络结构拓扑图;FIG5 is a topological diagram of the Bp neural network structure of the present invention;
图6是本发明导体偏心仿真示意图;FIG6 is a schematic diagram of a conductor eccentricity simulation of the present invention;
图7是本发明SSA-BP神经网络流程图;FIG7 is a flow chart of the SSA-BP neural network of the present invention;
图8是本发明SSA-BP神经网络的训练性能图;FIG8 is a training performance diagram of the SSA-BP neural network of the present invention;
图9是本发明SSA-BP神经网络的拟合效果图;FIG9 is a diagram showing the fitting effect of the SSA-BP neural network of the present invention;
图10是本发明comsol模型建立图;FIG10 is a diagram showing the establishment of a comsol model of the present invention;
图11是本发明校正前偏心误差分布图;FIG11 is a distribution diagram of eccentricity error before correction of the present invention;
图12是本发明SSA-BP校正后偏心误差分布图;12 is a distribution diagram of eccentricity error after SSA-BP correction of the present invention;
图13是本发明仿真数据偏心误差分析图;FIG13 is an eccentricity error analysis diagram of simulation data of the present invention;
图14是本发明实验系统示意图;FIG14 is a schematic diagram of an experimental system of the present invention;
图15是本发明实验系统实物图;FIG15 is a physical diagram of the experimental system of the present invention;
图16是本发明TMR电流传感器校准结果图;FIG16 is a diagram showing the calibration results of the TMR current sensor of the present invention;
图17是本发明实验数据偏心误差分析图。FIG. 17 is an analysis diagram of eccentricity error of experimental data of the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案及优点更加清楚明白,以下参照附图并举出优选实施例,对本发明进一步详细说明。然而,需要说明的是,说明书中列出的许多细节仅仅是为了使读者对本发明的一个或多个方面有一个透彻的理解,即便没有这些特定的细节也可以实现本发明的这些方面。In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and preferred embodiments. However, it should be noted that many details listed in the specification are only for the purpose of enabling the reader to have a thorough understanding of one or more aspects of the present invention, and these aspects of the present invention can be implemented even without these specific details.
一种阵列式单轴TMR电流传感器的导体偏心自适应校正方法,所述方法包括如下步骤:A conductor eccentricity adaptive correction method for an array-type single-axis TMR current sensor, the method comprising the following steps:
1基本原理及误差分析1 Basic principles and error analysis
1.1TMR电流传感器原理介绍1.1 Introduction to the principle of TMR current sensor
TMR元件的磁性隧道结基本结构为一个“三明治”结构,有两个铁磁性材料层(自由层和被钉扎层)夹着非磁性的绝缘层(隧道结)组成。一定大小的磁场下被钉扎层的磁化方向保持不变,而自由层的磁化方向受磁场的影响发生转动,当两个磁性层的磁矩方向平行时,电阻较小;当方向反平行时,电阻较大。故而通过TMR磁电阻的变化反映外加磁场对TMR结构的影响,引起惠斯通电桥不平衡来输出差分变化的信号电压来实现测量电流。The basic structure of the magnetic tunnel junction of the TMR element is a "sandwich" structure, which consists of two ferromagnetic material layers (free layer and pinned layer) sandwiching a non-magnetic insulating layer (tunnel junction). Under a certain magnetic field, the magnetization direction of the pinned layer remains unchanged, while the magnetization direction of the free layer rotates under the influence of the magnetic field. When the magnetic moments of the two magnetic layers are parallel, the resistance is small; when the directions are anti-parallel, the resistance is large. Therefore, the change of TMR magnetoresistance reflects the influence of the external magnetic field on the TMR structure, causing the imbalance of the Wheatstone bridge to output the differential change signal voltage to achieve the measurement of current.
等效惠斯通电桥式模型如图1所示,R1、R2、R3和R4为磁电阻,R1和R3磁矩方向相同,R2和R4磁矩方向相同。当无外界磁场时,桥路上的磁电阻值相等即R1=R2=R3=R4,则电桥输出信号为0;当外界磁场作用时,磁电阻受到磁场的作用阻值发生等量的变化,R1、R3与R2、R4方向相反,将磁信号转换为差分电压信号,电桥输出的电压需要经过信号调理电路放大,可表示为:The equivalent Wheatstone bridge model is shown in Figure 1. R1, R2, R3 and R4 are magnetoresistances. The directions of the magnetic moments of R1 and R3 are the same, and the directions of the magnetic moments of R2 and R4 are the same. When there is no external magnetic field, the magnetoresistance values on the bridge are equal, that is, R1 = R2 = R3 = R4, and the output signal of the bridge is 0; when the external magnetic field acts, the magnetoresistance changes by the same amount under the action of the magnetic field. The directions of R1 and R3 are opposite to those of R2 and R4, and the magnetic signal is converted into a differential voltage signal. The voltage output by the bridge needs to be amplified by the signal conditioning circuit, which can be expressed as:
Vout=Gop·Vtmr (1)V out =G op ·V tmr (1)
其中Vout表示差分放大后的输出电压,Gop是运算放大器的放大倍数,Vtmr是单个TMR传感器的输出电压。Where Vout represents the output voltage after differential amplification, Gop is the amplification factor of the operational amplifier, and Vtmr is the output voltage of a single TMR sensor.
1.2环形TMR阵列测量原理1.2 Annular TMR array measurement principle
环形TMR阵列结构如图2所示,根据安培环路定律如式子所示磁感应强度B沿闭合路径的线积分等于该路径所包围的各个电流的代数和乘以磁导率,故可通过环形TMR阵列形成封闭环路近似路径的线积分。The structure of the annular TMR array is shown in FIG2 . According to Ampere's loop law, as shown in the formula, the line integral of the magnetic induction intensity B along the closed path is equal to the algebraic sum of the currents enclosed by the path multiplied by the magnetic permeability. Therefore, the line integral of the closed loop approximate path can be formed by the annular TMR array.
∫lBdl=μ0∑I (3)∫ l Bdl=μ 0 ∑I (3)
其中μ0为真空磁导率,通常取4π*10-7,同时由于输电线路可近似为无限长直导体,根据毕奥萨伐尔定律,TMR传感器输出Vtmr:Where μ 0 is the vacuum magnetic permeability, usually 4π*10 -7 . At the same time, since the transmission line can be approximated as an infinitely long straight conductor, according to the Biot-Savart law, the TMR sensor output V tmr is:
其中ks和Bs分别是TMR传感器的灵敏度和磁感应强度测量值,为导体产生的磁场在传感器的磁感应强度向量,/>为流过导体的电流向量,/>为传感器敏感轴单位向量,/>为导线中心到传感器中心的半径向量。N个传感器总输出如下:Where k s and B s are the sensitivity and magnetic induction intensity measurement value of the TMR sensor, respectively. is the magnetic induction intensity vector of the magnetic field generated by the conductor at the sensor,/> is the current vector flowing through the conductor, /> is the sensor sensitive axis unit vector, /> is the radius vector from the center of the wire to the center of the sensor. The total output of N sensors is as follows:
阵列传感器输出的平均值Vmean:The average value V mean of the array sensor output is:
联立上四式可以反演出导体电流的测量值Im:Combining the above four equations, we can invert the measured value of the conductor current, Im :
1.3偏心误差分析1.3 Eccentricity error analysis
输电线路长时间运作受环境影响或者传感器安装会造成导体偏心问题,即载流导体与阵列式TMR电流传感器的交点不在中心点上,产生较大的测量误差。本节将以传感器S1为例详细分析导体偏心对电流测量的误差影响。The long-term operation of the transmission line will be affected by the environment or the sensor installation will cause the conductor eccentricity problem, that is, the intersection of the current-carrying conductor and the array TMR current sensor is not at the center point, resulting in a large measurement error. This section will take sensor S1 as an example to analyze in detail the error effect of conductor eccentricity on current measurement.
如图3所示被测电流I0垂直于xy平面由内向外流出,方位角α是y轴和偏心导体的偏心距离向量的夹角,β是传感器S1处产生的磁感应强度/>和敏感轴/>的夹角,各个参数定义见表1。As shown in Figure 3, the measured current I0 flows perpendicular to the xy plane from the inside to the outside, and the azimuth angle α is the eccentric distance vector between the y axis and the eccentric conductor. The angle between the two, β is the magnetic induction intensity generated at the sensor S1/> and sensitive axis/> The parameters are defined in Table 1.
表1 图3中参数定义Table 1 Definition of parameters in Figure 3
由式(4)可知,TMR传感器输出电压与导体在传感器上生成的磁感应强度向量和敏感轴单位方向向量的点乘有关,通过几何关系分解可得:It can be seen from formula (4) that the output voltage of the TMR sensor is related to the dot product of the magnetic induction intensity vector generated by the conductor on the sensor and the unit direction vector of the sensitive axis. Through geometric decomposition, it can be obtained:
由余弦定理可得:From the cosine theorem we can get:
r1 2=r0 2+d2-2r0dcosα (10)r 1 2 = r 0 2 + d 2 - 2r 0 dcos α (10)
联立式子(4)、(8)、(9)和(10)可得:Combining equations (4), (8), (9) and (10) we can obtain:
继续推导可得传感器Si的输出电压Vi:Continuing to deduce, we can get the output voltage V i of sensor S i :
进行加和平均Vmean后可求出偏心电流测量值Im:After adding and averaging V mean , the eccentric current measurement value Im can be obtained:
其中N=3,已知,进一步可得到偏心造成的测量相对误差εu:Where N = 3, It is known that the relative measurement error ε u caused by eccentricity can be further obtained:
由上式可知,测量误差的大小与偏心距离d和方位角α两个偏心变量有关,与被测电流值的大小等因素无关。使用matlab进行数值仿真,定义tp为导体偏心距离和阵列半径的比值,即:From the above formula, we can know that the measurement error is related to the two eccentric variables, eccentric distance d and azimuth angle α, and has nothing to do with the magnitude of the measured current. Using MATLAB for numerical simulation, tp is defined as the ratio of the conductor eccentric distance to the array radius, that is:
改变tp并取方位角α作为坐标轴,可得到导体偏心误差的关系如图4所示。By changing t p and taking the azimuth angle α as the coordinate axis, the relationship of the conductor eccentricity error can be obtained as shown in Figure 4.
2自校正算法模型建立2 Self-correction algorithm model establishment
BP神经网络具备学习和存储大量的输入-输出模式映射关系的能力,使其能够直接通过对导体在不同偏心状态下TMR传感单元测量值的网络训练,建立起偏心补偿模型。同时,麻雀优化算法(SSA)则能够调整BP神经网络的超参数,进一步提升模型性能。因此,为了应对由偏心引起的测量误差,本文基于SSA-BP设计了一种偏心自校正算法,为偏心问题提供了一种有效的解决方案。The BP neural network has the ability to learn and store a large number of input-output pattern mapping relationships, so that it can directly establish an eccentricity compensation model by training the network of TMR sensor unit measurements under different eccentricity states of the conductor. At the same time, the sparrow optimization algorithm (SSA) can adjust the hyperparameters of the BP neural network to further improve the model performance. Therefore, in order to deal with the measurement error caused by eccentricity, this paper designs an eccentricity self-correction algorithm based on SSA-BP, which provides an effective solution to the eccentricity problem.
2.1 BP神经网络2.1 BP Neural Network
BP神经网络作为一种基于误差反向传播算法优化权重和偏置参数的多层前馈神经网络,能够最小化网络输出值和目标值之间的误差,常用于处理非线性问题具有较高的精度。As a multi-layer feedforward neural network that optimizes weights and bias parameters based on the error back propagation algorithm, BP neural network can minimize the error between the network output value and the target value. It is often used to deal with nonlinear problems with high accuracy.
2.1麻雀搜索算法(SSA)2.1 Sparrow Search Algorithm (SSA)
尽管BP神经网络具备强大的非线性映射能力,然而其依赖梯度下降法来调整网络连接权重和阈值,并通过误差的反向传播进行优化。这一方法存在一个潜在风险,即网络可能陷入局部最优解,从而降低了预测的准确性,故需要优化BP神经网络的权值和阈值使诊断误差降低。Although the BP neural network has powerful nonlinear mapping capabilities, it relies on the gradient descent method to adjust the network connection weights and thresholds, and optimizes them through the back propagation of errors. This method has a potential risk, that is, the network may fall into a local optimal solution, thereby reducing the accuracy of the prediction, so it is necessary to optimize the weights and thresholds of the BP neural network to reduce the diagnostic error.
SSA算法是一种启发式优化算法,其设计灵感源自自然界中麻雀的捕食和躲避捕食者的群体行为。麻雀在捕食过程中会根据个体自身能量的高低不断调整位置,以保证获取食物的最高效率,该算法具有强大的寻优能力和迅速的收敛速度。整个算法过程将群体分为发现者和加入者两个子群体,以更贴近自然界的群体行为。个体能量较高的个体为发现者,在搜索空间中发挥主导作用,其余部分称为加入者。算法的具体实现步骤如下:The SSA algorithm is a heuristic optimization algorithm, and its design is inspired by the group behavior of sparrows in nature in hunting and avoiding predators. During the hunting process, sparrows will constantly adjust their positions according to the level of their own energy to ensure the highest efficiency in obtaining food. The algorithm has a strong optimization ability and a fast convergence speed. The entire algorithm process divides the group into two sub-groups: discoverers and joiners, to be closer to the group behavior in nature. Individuals with higher individual energy are discoverers and play a leading role in the search space, and the rest are called joiners. The specific implementation steps of the algorithm are as follows:
步骤1:初始化麻雀种群位置与适应度,并把最大迭代次数N、种群大小n、发现者数量PD、感受危险的麻雀数量SD和安全值ST参数设置初始值。Step 1: Initialize the position and fitness of the sparrow population, and set the initial values of the maximum number of iterations N, population size n, number of discoverers PD, number of sparrows that sense danger SD, and safety value ST parameters.
步骤2:开始循环,当迭代次数大于N时跳出并返回值。Step 2: Start the loop and exit when the number of iterations is greater than N and return the value.
步骤3:对种群进行排序分离发现者和加入者,确定当前最优麻雀个体的位置和对应的最佳适应度值。Step 3: Sort the population to separate the discoverers and joiners, and determine the position of the current optimal sparrow individual and the corresponding optimal fitness value.
步骤4:觅食过程中不断更新发现者的位置以最大化能量获取率,警报阈值R2小于安全值AT时则表示周围为安全,反之则发现者发出警告并随机移动到当前最优位置。发现者的位置更新表达式如下:Step 4: During the foraging process, the position of the discoverer is continuously updated to maximize the energy acquisition rate. When the alarm threshold R 2 is less than the safety value AT, it means that the surrounding is safe. Otherwise, the discoverer issues a warning and randomly moves to the current optimal position. The expression for the discoverer's position update is as follows:
其中,Q为随机数(服从正态分布);为单位行向量;a为[0,1]之间的随机数。Among them, Q is a random number (subject to normal distribution); is a unit row vector; a is a random number between [0,1].
步骤5:根据发现者的位置和群体信息,更新加入者位置:Step 5: Update the joiner's location based on the discoverer's location and group information:
式中,Xworst为适应度最低的麻雀位置;Xp为种群迭代过程中的最优位置;为1与-1两个元素随机排列的行向量。Where X worst is the position of the sparrow with the lowest fitness; X p is the optimal position in the population iteration process; A row vector containing two randomly arranged elements, 1 and -1.
步骤6:在反捕食过程中随取选择小部分担任警戒者,当发现危险时它们放弃食物并随机转移地方。当个体适应度fi大于全局最佳适应度fg时,表明处于种群的边缘容易受到捕食者的攻击;两者相等时,说明当中间的麻雀感觉到捕食者的接近时,它们会飞向其他麻雀,以降低自己被捕食者猎杀的风险。位置更新如下:Step 6: In the anti-predator process, a small number of sparrows are randomly selected to serve as sentinels. When they find danger, they abandon food and move randomly. When the individual fitness fi is greater than the global optimal fitness fg , it indicates that the sparrows at the edge of the population are vulnerable to predators; when the two are equal, it means that when the sparrows in the middle feel the approach of predators, they will fly to other sparrows to reduce the risk of being hunted by predators. The position update is as follows:
式中,β是服从正态分布的随机数,以控制更新位置的步长。K是[-1,1]之间的随机数,fw为全局最差适应度。ε是接近0的常数,避免分母为零的情况。In the formula, β is a random number that follows a normal distribution to control the step size of the updated position. K is a random number between [-1,1], fw is the global worst fitness, and ε is a constant close to 0 to avoid the denominator being zero.
步骤7:更新历史最优适应度(相当于适应度的公告板更新)。Step 7: Update the historical optimal fitness (equivalent to updating the fitness bulletin board).
步骤8:执行步骤3-7,达到最大迭代次数N结束循环,并输出最优个体位置Xbest与适应度值。Step 8: Execute steps 3-7, and end the loop when the maximum number of iterations N is reached, and output the optimal individual position X best and fitness value.
2.3基于SSA-BP的自校正算法,从上图6可以发现由于偏心使每个TMR传感器与导体的距离r和方位角αi发生变化,各TMR传感器的测量值不再相等,同时使各TMR传感器输出之间的变比发生相应的变化。通过这一现象我们使不同位置的TMR传感器的磁感应强度测量值之间变比作为神经网络的输入,如下式:2.3 Self-correction algorithm based on SSA-BP. From Figure 6 above, we can see that due to the eccentricity, the distance r and azimuth angle α i between each TMR sensor and the conductor change, and the measured values of each TMR sensor are no longer equal. At the same time, the ratio between the outputs of each TMR sensor changes accordingly. Through this phenomenon, we use the ratio between the magnetic induction intensity measurement values of TMR sensors at different positions as the input of the neural network, as follows:
其中BS1、BS2和BS3分别是TMR传感器S1、S2和S3的磁感应强度测量值。BP神经网络生成的过程中需要标准的输出进行训练,故通过无偏心时导体在TMR传感器上生成的磁感应强度Bt与传感器测量值BSi的变比为理论的校正因子kti作为训练过程的输出:Where BS1 , BS2 and BS3 are the measured values of magnetic induction intensity of TMR sensors S1, S2 and S3 respectively. The BP neural network generation process requires standard output for training, so the ratio of the magnetic induction intensity Bt generated by the conductor on the TMR sensor when there is no eccentricity to the sensor measurement value BSi is the theoretical correction factor kti as the output of the training process:
以x1、x2和x3为输入kt1、kt2和kt3为输出训练生成BP神经网络。在实际应用中,移植此网络可获得校正因子k1、k2和k3的输出以消除偏心误差,从而获得经过校正后的测量电流值Ia:The BP neural network is trained with x 1 , x 2 and x 3 as input and k t1 , k t2 and k t3 as output. In practical applications, transplanting this network can obtain the output of correction factors k 1 , k 2 and k 3 to eliminate the eccentricity error, thereby obtaining the corrected measured current value I a :
将BP神经网络的误差值作为麻雀搜索算法(SSA)的适应度函数,通过融合全局搜索和局部搜索的机制直接确定BP神经网络模型中的最优权值与阈值。SSA算法有助于克服BP神经网络容易陷入局部最优解的问题,从而显著提高了优化的准确性。过程流程图如图7所示。The error value of the BP neural network is used as the fitness function of the sparrow search algorithm (SSA), and the optimal weights and thresholds in the BP neural network model are directly determined by integrating the global search and local search mechanisms. The SSA algorithm helps to overcome the problem that the BP neural network is prone to fall into the local optimal solution, thereby significantly improving the accuracy of optimization. The process flow chart is shown in Figure 7.
2.4SSA-BP神经网络建立2.4SSA-BP neural network establishment
神经网络的建立需要数据集进行训练,为了使网络更精准,采用理论推导出的导体不同位置的输入输出数据作为网络的训练集。首先设置被测电流I0=100A,环形阵列半径r0=50mm,再联立式4和式12求出在环形阵列内均匀分布的不同位置下3个TMR传感器的磁感应强度的测量值,最后按2.3节所述的方法建立训练的数据集400份。The establishment of a neural network requires a data set for training. In order to make the network more accurate, the input and output data of different positions of the conductor derived from the theory are used as the training set of the network. First, the measured current I 0 = 100A and the radius of the circular array r 0 = 50mm are set. Then, equations 4 and 12 are combined to obtain the measured values of the magnetic induction intensity of the three TMR sensors at different positions evenly distributed in the circular array. Finally, 400 training data sets are established according to the method described in Section 2.3.
进行神经网络参数设置。建立3输入3输出BP神经网络拓扑结构;隐藏层激活函数采用logsig函数,输出层激活函数采用pureline函数,循环隐含层节点与训练误差的情况确定最佳的隐含层节点。进行网络参数设置;神经网络最大训练数为100次,学习速率设置0.01,训练目标最小误差1e-10,其他参数均设为默认值。初始化麻雀搜索算法(SSA)初始参数;初始种群规模为50,最大迭代数为10,自变量上下限分别为5和-5,安全值ST设为0.8。Set the neural network parameters. Establish a 3-input 3-output BP neural network topology; the hidden layer activation function uses the logsig function, the output layer activation function uses the pureline function, and the hidden layer nodes and training errors are looped to determine the best hidden layer nodes. Set the network parameters; the maximum number of neural network training is 100 times, the learning rate is set to 0.01, the minimum training target error is 1e-10, and other parameters are set to default values. Initialize the initial parameters of the sparrow search algorithm (SSA); the initial population size is 50, the maximum number of iterations is 10, the upper and lower limits of the independent variable are 5 and -5 respectively, and the safety value ST is set to 0.8.
进行网络训练学习。其训练性能如图8所示。网络在57次训练后达到最佳,其均方误差MSE为0.00072接近于0。The network is trained and learned. Its training performance is shown in Figure 8. The network reaches the best after 57 trainings, and its mean square error MSE is 0.00072, close to 0.
神经网络自动计算并绘图目标值和预测值的相关系数R其拟合效果如图9所示,将数据分为四个部分:训练、验证、测试和整体,横纵坐标分别代表样本实际值和网络的输出值。相关系数R越接近1表示线性化程度越高,训练效果越好,从图中看出散点贴合回归线且整体相关系数R为0.9886,说明该网络性能优良。The neural network automatically calculates and plots the correlation coefficient R between the target value and the predicted value. The fitting effect is shown in Figure 9. The data is divided into four parts: training, validation, testing and overall. The horizontal and vertical axes represent the actual sample values and the output values of the network respectively. The closer the correlation coefficient R is to 1, the higher the degree of linearization and the better the training effect. It can be seen from the figure that the scattered points fit the regression line and the overall correlation coefficient R is 0.9886, indicating that the network has excellent performance.
将BP神经网络和SSA-BP神经网络的学习结果评价指标进行对比,如表2所示。由表可知,BP和SSA-BP预测模型的平均绝对误差EMAE分别为0.0062和0.0048,均方根误差ERMSE分别为0.0532和0.0268,平均绝对百分比误差EMAPE分别为0.5568%和0.4446%,由此可知SSA-BP预测效果更优越。The evaluation indicators of the learning results of the BP neural network and the SSA-BP neural network are compared, as shown in Table 2. As can be seen from the table, the mean absolute error E MAE of the BP and SSA-BP prediction models are 0.0062 and 0.0048, the root mean square error E RMSE are 0.0532 and 0.0268, and the mean absolute percentage error E MAPE are 0.5568% and 0.4446%, respectively. It can be seen that the prediction effect of SSA-BP is superior.
表2 为2种模型评价指标Table 2 shows the evaluation indicators of the two models
3仿真分析3 Simulation Analysis
3.1基于comsol的有限元仿真3.1 Finite element simulation based on Comsol
本文使用comsol有限元仿真软件对TMR环形阵列电流传感器进行磁场仿真,如图10所示TMR传感单元圆周半径为50mm,载流导体半径10mm,长为200mm,施加直流电流100A,需要注意的是TMR传感单元仅对圆周切线方向上的磁场分量敏感。对导体在环形阵列内均匀取不同的偏心位置进行磁场仿真,分别收集3个TMR传感单元的磁感应强度值BSi,整理建立仿真测试数据集导入2.4节建立的神经网络进行测试验证。This paper uses COMSO finite element simulation software to simulate the magnetic field of the TMR annular array current sensor. As shown in Figure 10, the circumferential radius of the TMR sensor unit is 50 mm, the radius of the current-carrying conductor is 10 mm, the length is 200 mm, and the DC current is 100 A. It should be noted that the TMR sensor unit is only sensitive to the magnetic field component in the tangential direction of the circle. The magnetic field simulation is performed on the conductor at different eccentric positions in the annular array, and the magnetic induction intensity values BS i of the three TMR sensor units are collected respectively. The simulation test data set is organized and imported into the neural network established in Section 2.4 for test verification.
3.2结果分析3.2 Results Analysis
将神经网络输出的校正因子ki代入式21可得到校正后导体电流的测量值Ia,计算出校正后的测量误差进行效果分析。如图11和图12所示,将校正前和经过基于SSA-BP的自校正算法校正后的偏心误差分布图作比较,SSA-BP校正后呈现出均匀的、接近0的分布,其误差最大值从校正前的33.86%降到了0.92%,说明该自适应校正算法对于各种偏心情况都能够较好地进行预测测量。Substituting the correction factor k i output by the neural network into equation 21, the measured value I a of the conductor current after correction can be obtained, and the measurement error after correction can be calculated for effect analysis. As shown in Figures 11 and 12, the distribution diagrams of the eccentricity error before correction and after correction by the self-correction algorithm based on SSA-BP are compared. After SSA-BP correction, the distribution is uniform and close to 0, and the maximum error value is reduced from 33.86% before correction to 0.92%, indicating that the adaptive correction algorithm can perform good prediction and measurement for various eccentricity conditions.
由校正前偏心误差分布图可知,偏心误差εu随导体偏心距离d的变大而增大,同时随方位角α周期性变化。故令偏心比tp,方位角α步长为10°进一步详细分析。如表3和图13所示,将未校正、BP神经网络校正和SSA-BP神经网络校正后的测量误差进行比较,由表3可知加入自校正算法后能够有效降低偏心误差,同时由图13可以看出SSA-BP神经网络校正后的测量值鲁棒性比BP神经网络更好。From the distribution diagram of eccentricity error before correction, it can be seen that the eccentricity error εu increases with the increase of conductor eccentricity distance d, and changes periodically with azimuth angle α. Therefore, let the eccentricity ratio tp and azimuth angle α step length be 10° for further detailed analysis. As shown in Table 3 and Figure 13, the measurement errors after uncorrected, BP neural network correction and SSA-BP neural network correction are compared. It can be seen from Table 3 that the addition of self-correction algorithm can effectively reduce the eccentricity error. At the same time, it can be seen from Figure 13 that the measurement value after SSA-BP neural network correction is more robust than BP neural network.
表3 平均相对误差KMRE/%Table 3 Mean relative error K MRE /%
1实验验证1 Experimental verification
4.实验平台设计4. Experimental platform design
4.1本文设计了一种开口式基于单轴TMR2901的阵列式电流传感器。环形阵列半径r=50mm,3个单轴TMR电流传感器在xy轴上以120°均匀固定在亚克力板上。4.1 This paper designs an open array current sensor based on uniaxial TMR2901. The radius of the annular array is r = 50 mm, and three uniaxial TMR current sensors are evenly fixed on the acrylic plate at 120° on the xy axis.
测试系统如图14和图15所示。由上述式14可知偏心测量值误差与被测电流的大小无关,故本文选用直流电源KPS6020D调整到定电压模式CV输出30V的恒压,与设为2Ω定电阻模式的电子负载仪IT8512A串联输出15A的直流电,通过调整导线固定座上移动卡扣改变导体的偏心位置,并在示波器Tektronix MSO56B上采集TMR电流传感器的波形和输出电压的测量值,将收集到的数据集导入计算机进行处理运算。The test system is shown in Figures 14 and 15. From the above formula 14, it can be seen that the eccentricity measurement error has nothing to do with the magnitude of the measured current. Therefore, this paper selects the DC power supply KPS6020D to adjust to the constant voltage mode CV output 30V constant voltage, and connects it in series with the electronic load meter IT8512A set to the 2Ω constant resistance mode to output 15A DC. The eccentric position of the conductor is changed by adjusting the movable buckle on the wire fixing seat, and the waveform and output voltage measurement value of the TMR current sensor are collected on the oscilloscope Tektronix MSO56B, and the collected data set is imported into the computer for processing and calculation.
4.2 TMR电流传感器校准4.2 TMR Current Sensor Calibration
准确测量电流需知道TMR电流传感器的灵敏度ks,故在导体无偏心和无干扰的情况下进行了5次基本精度测量实验。将标准输入电流值与TMR电流传感器的输出电压值作最小二乘法拟合,取斜率和截距的平均值可得到传感器的灵敏度ks和偏置电压,消除偏置电压并建立输入电流与传感器输出电压之间的数学模型,从而通过传感器的输出电压可反演得到电流的测量值。如图16所示,当导体电流从0A变化到20A变化时,平均相对误差EMRE为0.14%,其中输入电流为15A时为0.12%,造成该误差原因主要为传感器内部噪声和测量误差。To accurately measure the current, the sensitivity k s of the TMR current sensor must be known, so five basic accuracy measurement experiments were conducted without eccentricity and interference on the conductor. The standard input current value and the output voltage value of the TMR current sensor were fitted by the least square method, and the average of the slope and intercept was taken to obtain the sensitivity k s and bias voltage of the sensor. The bias voltage was eliminated and a mathematical model between the input current and the sensor output voltage was established, so that the measured current value can be inverted through the output voltage of the sensor. As shown in Figure 16, when the conductor current changes from 0A to 20A, the average relative error E MRE is 0.14%, of which 0.12% when the input current is 15A. The main causes of this error are sensor internal noise and measurement errors.
4.3结果分析4.3 Results Analysis
将采集到的TMR电流传感器输出电压值Vi通过式4转换为相应的磁感应强度测量值Bsi建立实验测试数据集,导入上述3.4节生成的神经网络进而反馈校正因子ki代入式21可得到校正后的电流测量值Ia,从而进行校正效果分析。The collected TMR current sensor output voltage value Vi is converted into the corresponding magnetic induction intensity measurement value Bsi through formula 4 to establish an experimental test data set. The neural network generated in Section 3.4 is imported and the correction factor k is fed back and substituted into formula 21 to obtain the corrected current measurement value Ia , so as to analyze the correction effect.
本文实验讨论偏心比tp=0.4的情况,其偏心误差分析如图17中未校正曲线所示,实验校正前与理论推导的误差曲线(如图5所示)随方位角α变化的趋势一致。同时将测试集导入自校正算法模型后与校正前的测量误差作比较如表4所示,加入BP和SSA-BP自校正算法校正后能够将校正前平均相对误差EMRE的4.03%分别降低到1.02%和0.47%。结合图17和表4,可知基于BP和SSA-BP的自校正算法能够较好的消除偏心误差,但基于SSA-BP的自校正算法具有更好的准确性和稳定性。This paper discusses the case of eccentricity ratio tp = 0.4. The eccentricity error analysis is shown in the uncorrected curve in Figure 17. The error curves before experimental correction and theoretical derivation (as shown in Figure 5) are consistent with the trend of the change of azimuth angle α. At the same time, the test set is imported into the self-correction algorithm model and the measurement error before correction is compared as shown in Table 4. After adding BP and SSA-BP self-correction algorithms, the average relative error E MRE before correction can be reduced from 4.03% to 1.02% and 0.47% respectively. Combined with Figure 17 and Table 4, it can be seen that the self-correction algorithms based on BP and SSA-BP can better eliminate the eccentricity error, but the self-correction algorithm based on SSA-BP has better accuracy and stability.
表4 实验平均相对误差EMRE/%Table 4 Experimental average relative error E MRE /%
提出了一种基于麻雀搜索算法(SSA)优化BP神经网络的TMR电流传感器偏心补偿模型,采用麻雀搜索算法(SSA)优化BP神经网络的权值和阈值进行训练学习,寻找导体偏心位置与传感器输出之间的变化的关系,进而反馈校正因子消除导体偏心影响。通过有限元仿真和实验验证,证明了该方法抵抗偏心误差方面的显著性能,大大提高了电流测量的准确性。这不仅为TMR电流传感器在实际工程应用中的可靠性和稳定性提供了有力支持,也为其他传感器的偏心自适应校正研究提供了一种有效的方法和思路。A TMR current sensor eccentricity compensation model based on sparrow search algorithm (SSA) optimized BP neural network is proposed. The weights and thresholds of the BP neural network are optimized by sparrow search algorithm (SSA) for training and learning, and the relationship between the conductor eccentricity position and the sensor output is found, and then the correction factor is fed back to eliminate the influence of conductor eccentricity. Through finite element simulation and experimental verification, it is proved that this method has significant performance in resisting eccentricity error and greatly improves the accuracy of current measurement. This not only provides strong support for the reliability and stability of TMR current sensors in practical engineering applications, but also provides an effective method and idea for the study of eccentricity adaptive correction of other sensors.
以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410370231.5A CN118171530A (en) | 2024-03-29 | 2024-03-29 | Conductor eccentricity self-adaptive correction method of array type single-axis TMR current sensor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410370231.5A CN118171530A (en) | 2024-03-29 | 2024-03-29 | Conductor eccentricity self-adaptive correction method of array type single-axis TMR current sensor |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118171530A true CN118171530A (en) | 2024-06-11 |
Family
ID=91359873
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410370231.5A Pending CN118171530A (en) | 2024-03-29 | 2024-03-29 | Conductor eccentricity self-adaptive correction method of array type single-axis TMR current sensor |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118171530A (en) |
-
2024
- 2024-03-29 CN CN202410370231.5A patent/CN118171530A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Di Rienzo et al. | Circular arrays of magnetic sensors for current measurement | |
JP3208924U (en) | Interference rejection for current measurement systems | |
Arpaia et al. | ANN-based error reduction for experimentally modeled sensors | |
Li et al. | A closed-loop operation to improve GMR sensor accuracy | |
CN110045168A (en) | A kind of current sensor apparatus and measurement method based on TMR tunnel magnetoresistance device | |
JP2021006813A5 (en) | ||
CN103063345B (en) | Method for detecting radial force stressed on shaft pin | |
Zhao et al. | A comprehensive compensation method for piezoresistive pressure sensor based on surface fitting and improved grey wolf algorithm | |
CN113252960A (en) | External magnetic field interference suppression method suitable for direct-current power distribution network current sensor | |
CN112363099B (en) | A TMR current sensor temperature drift and geomagnetic field correction device and method | |
CN110441027A (en) | A kind of modification method controlling the null offset of probe automatic tracking system | |
CN118171530A (en) | Conductor eccentricity self-adaptive correction method of array type single-axis TMR current sensor | |
CN113296045B (en) | Error correction method of micro current sensor based on sensing array | |
CN103063233A (en) | Method for reducing measuring errors by adopting a plurality of sensors | |
US20070052412A1 (en) | Magnetic-field-measuring device | |
CN113567897A (en) | A kind of self-adaptive measurement method of annular TMR array sensor | |
CN214895491U (en) | Device suitable for measure direct current distribution network direct current voltage | |
Li et al. | An Adaptive Eccentricity Correction Method for Arrayed Single‐Axis TMR Current Sensors | |
CN110705186B (en) | Real-time online instrument checksum diagnosis method through RBF particle swarm optimization algorithm | |
CN119310326A (en) | Anti-interference current measurement method and system of magnetic sensor array based on neural network | |
Song et al. | Application research of information fusion technology of multi-sensor in level measurement | |
Si et al. | Numerical study of field-circuit coupling and output response of TMR current sensor | |
CN111505543A (en) | Method and system for compensating dynamic hysteresis based on recurrent neural network | |
Hashemi et al. | Modeling and compensation for capacitive pressure sensor by RBF neural networks | |
Zhao et al. | Error analysis of current sensor based on fluxgate sensor array |
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 |