Adaptive data compensation method for current sensor
The method addresses measurement inaccuracies in current sensors by dynamically adapting to environmental factors through multi-dimensional error identification and long-term memory network adjustments, ensuring accurate and stable current measurements.
Patent Information
- Application Number
- CN202510515737.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-07-15
AI Technical Summary
Existing current sensors lack a dynamic compensation mechanism under complex and variable field conditions, and cannot adapt to the influence of multiple external disturbance sources. The error modeling method is single, and the compensation accuracy cannot be continuously optimized. There are problems of parameter aging and error accumulation.
By collecting the current sensor output signals and environmental parameters in real time, identifying multi-dimensional error sources, using an adaptive data compensation model for dynamic correction, and using a long and short-term memory network to optimize the mapping relationship between the error source and the compensation value, an adaptive data compensation system is built.
The compensation model's response ability to fluctuations in external factors is enhanced, the accuracy and controllability of error tracking is improved, the stability and effectiveness of signal correction is improved, and the accuracy and real-time correction of current data is achieved. The compensation method is continuously optimized over time.
Smart Images

Figure CN120314853A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of dynamic correction and intelligent compensation of current sensor measurement data, and particularly relates to an adaptive data compensation method for a current sensor. Background Art
[0002] With the rapid development of the fields of industrial automation, power systems, and new energy vehicles, current sensors play an increasingly important role in applications such as electric energy metering, equipment control, and operating status detection; there are various types of current sensors, including Hall sensors, magnetoresistive sensors, and current transformers, etc., which generally rely on analog signals or discrete signals to output the measured current value, and finally realize the real-time monitoring and control of the current.
[0003] However, due to the diversity of the sensor measurement principle, internal circuit structure, and its operating environment, the output signal is extremely vulnerable to interference from multi-dimensional factors such as temperature fluctuations, electromagnetic interference, and non-linear output characteristics, resulting in deviation or distortion of its measurement data; therefore, in order to ensure data accuracy and improve the reliability of sensor applications, it is urgent to carry out research on compensating for sensor measurement errors.
[0004] CN107392786A discloses a method for compensating missing data in a mine fiber grating monitoring system based on a support vector machine. This scheme uses a support vector regression model to perform time series modeling and fitting compensation on the collected data, so as to make up for the missing problems caused by transmission anomalies or discrete sensor failures; although this method has advantages in prediction accuracy, it has no dynamic adaptation ability to signal offsets caused by external disturbance factors (such as environmental temperature, electromagnetic interference), and overly relies on the generalization ability of the initial training of the model, resulting in unstable compensation effects under complex and changeable field conditions.
[0005] CN117456865A discloses a data compensation method applied to a display panel, which statically corrects the display data by introducing a viewing angle improvement rate and a target compensation table. Although the compensation accuracy is improved, its applicable scenario is limited to the field of image display, and the compensation strategy is static table-driven, unable to respond to the dynamic changes of the field environment, and lacking the ability to analyze multi-source errors in the sensor data dimension.
[0006] In summary, the prior art has the following deficiencies: First, there is a lack of a dynamic compensation mechanism for real-time environmental changes, and it is difficult to adapt to the continuous influence of various external disturbance sources on the output signal of the current sensor in the industrial field; second, the error modeling method is too single, and most of them use methods based on static mapping or simple fitting, and fail to decompose and model the cross-coupling relationship between multiple error sources; third, most of the existing compensation methods do not introduce a deep learning mechanism with time series memory ability, and cannot continuously optimize the compensation accuracy during long-term operation, resulting in problems such as parameter aging and error accumulation. Summary of the Invention
[0007] The purpose of this section is to outline some aspects of the embodiments of the present invention and briefly introduce some preferred embodiments. Simplifications or omissions may be made in this section, as well as in the abstract and title of the application, to avoid obscuring the purpose of this section, the abstract, and the title. However, such simplifications or omissions shall not be used to limit the scope of the present invention.
[0008] In view of the existing problems mentioned above, the present invention is proposed.
[0009] To solve the above technical problems, the present invention provides the following technical solutions: real-time collect the original output signal of the current sensor and synchronously obtain the current environmental parameters, where the environmental parameters include at least one of temperature, humidity, and electromagnetic interference intensity;
[0010] According to the environmental parameters, determine the multi-dimensional error sources caused by environmental factors in the original output signal, where the multi-dimensional error sources include at least two of temperature drift error, non-linear error, and electromagnetic coupling error;
[0011] According to the multi-dimensional error sources, calculate the first influence value of each error source on the original output signal and determine whether the influence directions of the error sources are consistent;
[0012] If the influence directions are consistent, select the first influence value with the largest absolute value as the current compensation value; otherwise, perform a weighted superposition calculation on each first influence value to obtain a comprehensive compensation value;
[0013] According to the current compensation value or the comprehensive compensation value, dynamically correct the original output signal to obtain a compensated target current signal;
[0014] Input the target current signal into an adaptive data compensation model constructed based on a long short-term memory network to update the mapping relationship between the error sources and the compensation values and store them in a compensation parameter database.
[0015] As a preferred solution of the adaptive data compensation method for a current sensor according to the present invention, the step of determining the multi-dimensional error sources caused by environmental factors in the original output signal according to the environmental parameters includes:
[0016] Identify abnormal environmental parameters that exceed the environmental thresholds according to a preset environmental parameter threshold range;
[0017] According to the type of the abnormal environmental parameters, match the corresponding pre-stored error source association models, where the error source association models include at least one of a temperature-drift coefficient mapping table and an electromagnetic interference-coupling coefficient mapping table;
[0018] Using the error source correlation model, determine the contribution degree of the error source corresponding to the abnormal environmental parameter.
[0019] As a preferred solution of the adaptive data compensation method for a current sensor according to the present invention, the determining the contribution degree of the error source corresponding to the abnormal environmental parameter includes:
[0020] Perform normalization processing on the abnormal environmental parameter to obtain its relative deviation value;
[0021] Retrieve the error coefficient corresponding to the relative deviation value in the error source correlation model;
[0022] Calculate the product of the relative deviation value and the corresponding error coefficient to obtain the corresponding contribution degree coefficient.
[0023] As a preferred solution of the adaptive data compensation method for a current sensor according to the present invention, the calculating the first influence value of each error source on the original output signal includes:
[0024] For the temperature drift error, calculate the first influence value corresponding to the temperature drift error according to the difference between the current temperature and the standard temperature and the temperature sensitivity coefficient;
[0025] For the nonlinear error, determine the first influence value corresponding to the nonlinear error by using the piecewise linear interpolation method according to the output characteristic curve of the current sensor;
[0026] For the electromagnetic coupling error, extract the amplitude and phase of the electromagnetic interference signal by using the frequency domain analysis method, and calculate the first influence value corresponding to the electromagnetic coupling error.
[0027] As a preferred solution of the adaptive data compensation method for a current sensor according to the present invention, if the influence directions are inconsistent, perform weighted superposition calculation on each first influence value to obtain a comprehensive compensation value, including:
[0028] Assign an initial weight to each error source, and the initial weight is proportional to the historical occurrence frequency of the error source;
[0029] Calculate an adjustment factor according to the fluctuation amplitude of the real-time environmental parameter, and the adjustment factor is proportional to the relative fluctuation amplitude of the environmental parameter;
[0030] Obtain a corrected weight by calculating the product of the initial weight and the adjustment factor, and perform normalization processing on all corrected weights to obtain the final weight;
[0031] Multiply each first influence value by the corresponding weight and sum them to obtain a comprehensive compensation value.
[0032] As a preferred embodiment of the adaptive data compensation method for a current sensor according to the present invention, the dynamic correction of the original output signal to obtain the compensated target current signal includes:
[0033] When the compensation value corresponds to a positive offset, subtract the absolute value of the compensation value from the original output signal;
[0034] When the compensation value corresponds to a negative offset, add the absolute value of the compensation value to the original output signal.
[0035] As a preferred embodiment of the adaptive data compensation method for a current sensor according to the present invention, the input of the adaptive data compensation model includes environmental parameters, the original output signal, and the compensated target current signal, and the output is the updated error source correlation model parameters.
[0036] As a preferred embodiment of the adaptive data compensation method for a current sensor according to the present invention, under standard current conditions, compare the output signal error before and after compensation. When the error exceeds the preset allowable range, start the recalibration process of the compensation parameter database.
[0037] Advantages of the present invention:
[0038] 1. By establishing the causal association basis between the original sensor data and the environmental state, the response ability of the compensation model to external factor fluctuations is enhanced, providing full-scale input data support for subsequent error source identification and quantitative calculation, thereby improving the integrity and accuracy of error tracking;
[0039] 2. By constructing the mapping relationship between environmental parameters and error signals, and splitting the coupled interference into multiple error sources with independent physical characteristics for management, the controllability and pertinence of the error compensation process are improved, different types of disturbance signals are distinguished and responded to, and classified modeling is carried out, providing a basis for the subsequent implementation of a differential compensation mechanism;
[0040] 3. By identifying the resultant force characteristics of interference through directional analysis, on the one hand, the error is quantitatively evaluated to improve the analytical resolution ability of the compensation model; on the other hand, the logical relationship between error sources is sorted out by using the direction judgment strategy, providing a basis for the selection of the compensation path, setting a reasonable branch logic for the compensation value selection rule, and enhancing the decision-making intelligence and application flexibility of the compensation method;
[0041] 4. Based on the compensation strategy decision shunt of error direction determination, when the interference directions of each error source are the same, only the maximum error needs to be compensated to cover the overall offset trend, optimizing the compensation efficiency; when the directions are different, the positive and negative offset errors are eliminated by weighted superposition to prevent miscompensation or overcompensation; enhancing the adaptability and robustness of the error compensation strategy, and improving the stability and effectiveness of the signal correction process;
[0042] 5. By applying the aforementioned error modeling results to the original current data, the accuracy and real-time correction of the output signal are achieved, enhancing the physical authenticity and control reliability of the data, and the output current data can remain stable and reliable for a long time.
[0043] 6. Through the continuous evolution of error modeling and compensation logic and the dynamic iteration of parameters, taking advantage of the temporal memory of the LSTM network structure, the evolution characteristics of error sources in different time periods are recorded, and the compensation strategy is continuously adjusted during operation, thus forming a dynamic compensation system with learning ability, and the compensation method is continuously optimized and its self-adaptability is enhanced over time. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings. Among them:
[0045] Figure 1 is a schematic flowchart of an adaptive data compensation method for a current sensor shown in the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0046] In order to make the above objects, features, and advantages of the present invention more obvious and understandable, the specific embodiments of the present invention will be described in detail below with reference to the drawings of the specification. Obviously, the described embodiments are some embodiments of the present invention, rather than all embodiments.
[0047] All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the scope of protection of the present invention.
[0048] In the following description, many specific details are set forth in order to fully understand the present invention. However, the present invention can also be implemented in other ways different from those described herein. Those skilled in the art can make similar extensions without departing from the connotation of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed below.
[0049] According to an embodiment of the present invention, in combination with Figure 1 the flowchart shown, an adaptive data compensation method for a current sensor specifically includes the following steps:
[0050] S1. Real-time collect the original output signal of the current sensor and synchronously obtain the current environmental parameters, where the environmental parameters include at least one of temperature, humidity, and electromagnetic interference intensity. It should be noted in this step that:
[0051] Establish a communication connection with the target current sensor and the environmental monitoring unit through the central acquisition controller, and load the sampling period Ts, the synchronous clock Tc, and the channel mapping table;
[0052] Among them, the value range of Ts is from 1 ms to 100 ms, and Tc is uniformly distributed by GPS to ensure that the timestamp error between the current channel and the environmental channel is ≤1 μs;
[0053] Use a 24-bit analog-to-digital converter to perform high-precision sampling on the analog output voltage Vout(t) generated by the secondary side of the current sensor at a rate of 1 / Ts, and record the original output signal Iraw(t) including the instantaneous current amplitude, the absolute timestamp of the sampling moment, and the self-calibration reference values of the analog front-end gain and offset;
[0054] A third-order Butterworth low-pass filter is pre-connected to the input end of the ADC, and the cut-off frequency is set to 2.5 times the fundamental frequency of the measured current to suppress high-frequency noise;
[0055] One Pt1000 resistance thermometer is arranged near the outer wall of the current sensor housing and the core magnetic circuit respectively, and is excited by a four-wire constant current source; the controller acquires the temperature channel Tenv(t) with the same time reference as Iraw(t), and stores the two-point calibration curve parameters in the temperature register, and the temperature resolution is greater than 0.05 °C;
[0056] The relative humidity Henv(t) is measured using an integrated capacitance-digital output humidity probe, and the probe outputs with 14-bit precision via the I 2 C bus. It should be noted that to reduce the water vapor hysteresis error, a micro fan is set around the probe to maintain an air flow of 0.2 m / s to ensure that the humidity response time is ≤5 s;
[0057] Measure the spatial magnetic flux density vector B(t) around the sensor through a three-axis magnetic induction probe, set the sampling bandwidth to 10 kHz, the controller calculates its instantaneous amplitude |B(t)|, and estimates the interference current Idist(t);
[0058] Exemplarily, encapsulate Iraw(t), Tenv(t), Henv(t), and |B(t)| into a sampling frame Frame(n) = {Iraw, Tenv, Henv, |B|, t n} according to the unified timestamp, and write it into the circular buffer. If the sampling frame is lost, trigger the real-time interpolation and resampling frame filling algorithm to ensure data integrity;
[0059] Perform quality detection on N consecutive frames, where:
[0060] If Iraw exceeds the rated ramp rate or the ADC saturation threshold of the sensor, it is marked as a current anomaly;
[0061] If Tenv or Henv exceeds the calibrated temperature and humidity range, it is marked as environmental anomaly;
[0062] If |B| is greater than the set electromagnetic interference safety threshold, it is marked as EMI overlimit;
[0063] The anomaly mark is written into the log along with the sampling frame for subsequent call by the error source determination algorithm.
[0064] In an alternative embodiment, the controller batches and pushes the cached frames to the edge processing unit according to the set upload period Tu (Tu≥10Ts), while refreshing the sampling sequence number n and returning to the original current signal acquisition step to continue the next round of acquisition.
[0065] It should be noted that the present invention synchronously acquires and performs quality control on the original signal of the current sensor and multi-dimensional environmental parameters under the same high-precision time reference, providing stable, accurate, and time-sequence consistent data support for subsequent error source identification, compensation amount calculation, and adaptive learning.
[0066] S2. Determine the multi-dimensional error sources caused by environmental factors in the original output signal according to the environmental parameters. The multi-dimensional error sources include at least two of temperature drift error, non-linear error, and electromagnetic coupling error. Among them, it should be noted in this step that:
[0067] Identify the abnormal environmental parameters exceeding the environmental threshold according to the preset environmental parameter threshold range;
[0068] Match the corresponding pre-stored error source association model according to the type of abnormal environmental parameters. The error source association model includes at least one of a temperature-drift coefficient mapping table and an electromagnetic interference-coupling coefficient mapping table;
[0069] Use the error source association model to determine the error source contribution degree corresponding to the abnormal environmental parameters.
[0070] Furthermore, determining the error source contribution degree corresponding to the abnormal environmental parameters includes:
[0071] Normalize the abnormal environmental parameters to obtain their relative deviation values;
[0072] Retrieve the error coefficient corresponding to the relative deviation value in the error source association model;
[0073] Calculate the product of the relative deviation value and the corresponding error coefficient to obtain the corresponding contribution degree coefficient.
[0074] As an example, the preset environmental parameter threshold range includes:
[0075] Temperature threshold [T min ,T max=[-10 °C, 85 °C]
[0076] Humidity threshold [H min , H max =[10% RH, 90% RH]
[0077] Electromagnetic interference threshold [B min , B max =[0 mT, 3 mT]
[0078] Store the threshold group in register THR REG , for real-time comparison;
[0079] Perform comparison on the current sample (T n , H n , B n ):
[0080]
[0081]
[0082]
[0083] Among them, T n is the case temperature at the sampling moment, H n is the relative humidity at the sampling moment, B n is the spatial magnetic flux density amplitude at the sampling moment;
[0084] When Abn i = 1, then this environmental quantity is an abnormal environmental parameter and is written into the abnormal flag vector Abn = [Abn T , Abn H , Abn B ;
[0085] Select the corresponding mapping in the error source correlation model library according to the type of abnormality, as shown in the following table:
[0086] Table 1. Error source correlation model mapping table
[0087]
[0088] If two or more abnormalities occur at the same time, then load the corresponding multiple models simultaneously;
[0089] Calculate the normalized deviation for the environmental quantity marked as abnormal:
[0090]
[0091] T ref = 25 °C, T span = T max - Tmin
[0092] H ref = 50, H span = H max -H min
[0093] B ref = 0.5 mT, B span = B max -B min
[0094] where, ΔP T is the relative deviation of temperature, ΔP H is the relative deviation of humidity, ΔP B is the relative deviation of electromagnetic;
[0095] Retrieve the error coefficient k T = K T (T n ), k N = K N (H n ), k B = K B (B n );
[0096] And calculate the contribution coefficient:
[0097] C T = k T ·ΔP T , C N = k N ·ΔP H , C B = k B ·ΔP B
[0098] where,
[0099] If a certain type of environmental quantity is not marked as abnormal, then its C i = 0;
[0100] Exemplarily, calculate the total contribution:
[0101] C sum = |C T | + |C N | + |C B |
[0102] If C sum = 0, then there is no significant error source in the environment, and step S2 ends.
[0103] As an example, the normalized contribution weight is:
[0104]
[0105] When R i ≥ 0.5, the i-th type of error source is defined as the dominant error source;
[0106] When 0.2 ≤ R i <0.5, the i-th type of error source is defined as the secondary error source;
[0107] When R i <0.2, no separate compensation is given, and the contribution is incorporated into the global weighted processing;
[0108] Output error source set:
[0109] ERR SET = {temperature drift error | R T ≥ 0.2} ∪ {nonlinear error | R N ≥ 0.2} ∪ {electromagnetic coupling error | R B ≥ 0.2}
[0110] This set and the corresponding R i are used as the input weights for calculating the influence value in step S3.
[0111] S3. According to the multi-dimensional error sources, calculate the first influence value of each error source on the original output signal, and judge whether the influence directions of the error sources are the same. Among them, it should be noted in this step that:
[0112] For the temperature drift error, calculate the first influence value corresponding to the temperature drift error according to the difference between the current temperature and the standard temperature and the temperature sensitivity coefficient;
[0113] For the nonlinear error, determine the first influence value corresponding to the nonlinear error by using the piecewise linear interpolation method according to the output characteristic curve of the current sensor;
[0114] For the electromagnetic coupling error, extract the amplitude and phase of the electromagnetic interference signal by using the frequency domain analysis method, and calculate the first influence value corresponding to the electromagnetic coupling error.
[0115] As an example, the calculation of the temperature drift influence value includes:
[0116] Calculate the temperature difference ΔT = Tn - T ref , T ref = 25°C;
[0117] Look up the table to obtain the sensitivity coefficient K T , and find the first temperature drift influence value F T = K T × ΔT.
[0118] As an example, the calculation of the non - linear influence value includes:
[0119] Obtain the output characteristic curve f(I) through second - order polynomial fitting;
[0120] According to the original output signal Iraw n Locate the interval to which it belongs and perform piece - wise linear interpolation:
[0121] F N = Iraw n - f -1 (Iraw n )
[0122] where f -1 (·) represents the equivalent value obtained by inverse calculation in the ideal linear interval, and F N is the first non - linear influence value;
[0123] As an example, the calculation of the electromagnetic coupling influence value includes:
[0124] Perform a fast Fourier transform on the collected interference magnetic flux signal B(t) to obtain
[0125] Based on the sensor coupling transfer function H c (f)=|H c (f)|e jθ(f) Deduce the coupling current:
[0126]
[0127] Define the first electromagnetic coupling influence value F B = I c (t n )
[0128] where B(f) is the interference amplitude - frequency characteristic, is the interference phase response, H c (f) is the sensor coupling transfer function, and θ(f) is the coupling phase response;
[0129] In an alternative embodiment, for each influence value F i (i ∈ {T, N, B}) calculate
[0130]
[0131] where Dir i is the influence direction of the error source i;
[0132] Arrange the three direction vectors into a set Dir = {Dir T , Dir N , Dir B};
[0133] Definition:
[0134]
[0135] where n act is the number of currently valid error sources (Dir i ≠ 0). If all non - zero directions are the same, the influencing directions are consistent; otherwise, they are inconsistent;
[0136] Write {F T , F N , F B} and the consistency boolean value "consistent" into the error influence vector ImpactSet;
[0137] If consistent = True, enter the maximum value selection step of step S4;
[0138] If consistent = False, enter the weighted superposition step of step S4.
[0139] S4. If the influencing directions are consistent, select the first influencing value with the largest absolute value as the current compensation value; otherwise, perform a weighted superposition calculation on each first influencing value to obtain a comprehensive compensation value. Here, it should be noted in this step:
[0140] Based on the direction set Dir i output by step S3, find out whether the influencing directions are consistent:
[0141] If the influencing directions are consistent, select the first influencing value with the largest absolute value as the current compensation value, and its calculation formula is:
[0142] Cc = F k
[0143] k = argmax i (|F i |)
[0144] where F i is the first influencing value of the i - th type of error source;
[0145] That is, select the first influencing value with the largest absolute value as the current compensation value Cc;
[0146] If the influencing directions are inconsistent, perform a weighted superposition calculation on each first influencing value to obtain a comprehensive compensation value, including:
[0147] Allocate initial weights to each error source. The initial weights are proportional to the historical occurrence frequencies of the error sources;
[0148] Calculate the adjustment factor according to the fluctuation amplitude of real - time environmental parameters. The adjustment factor is proportional to the relative fluctuation amplitude of environmental parameters;
[0149] The corrected weight is obtained by calculating the product of the initial weight and the adjustment factor, and all the corrected weights are normalized to obtain the final weight;
[0150] Multiply each first influence value by the corresponding weight and sum them to obtain the comprehensive compensation value;
[0151] Specifically, the initial weight distribution is set according to the historical frequency ratio:
[0152]
[0153] The adjustment factor is calculated based on the real-time fluctuation amplitude:
[0154] A i = 1 + k Δ ΔP i , k Δ ∈(0, 1]
[0155] Then the corrected weight is W i = W0 i ×A i ;
[0156] The weight normalization is:
[0157]
[0158] Finally, the comprehensive compensation value is generated:
[0159]
[0160] where, H i is the historical occurrence frequency of error source i, ΔP i is the relative fluctuation amplitude of the environmental quantity corresponding to error source i, W0 i is the initial weight of error source i, A i is the adjustment factor of error source i, W i is the corrected weight of error source i, is the final weight of error source i.
[0161] S5. Dynamically correct the original output signal according to the current compensation value or the comprehensive compensation value to obtain the compensated target current signal. It should be noted in this step that:
[0162] Read the compensation amount output in step S4 where:
[0163] When the directions are the same, C v = C c , is the current compensation value;
[0164] When the directions are different, Cv = V c , which is the comprehensive compensation value;
[0165] Obtain the original output current I v corresponding to the same timestamp as C raw (t n ); Then:
[0166]
[0167] where I raw (t n ) is the original current in the nth sampling period, and Dir is the offset direction flag;
[0168] Perform single-point correction on I raw according to Dir:
[0169]
[0170] Write the compensated target current signal I tar (t n ) into the double-ended buffer, together with the timestamp t n and the compensation amount C v and record them together for the adaptive data compensation model in step S6 to call.
[0171] It should be noted that by serially executing the above steps, the current offset caused by multi-source errors can be instantaneously cancelled within each sampling period, ensuring that the output signal maintains a high-fidelity tracking of the true current, and providing stable and accurate data input for the subsequent LSTM-driven adaptive compensation model.
[0172] S6. Input the target current signal into the adaptive data compensation model constructed based on the long short-term memory network to update the mapping relationship between the error source and the compensation value, and store it in the compensation parameter database. Among them, what needs to be explained in this step is:
[0173] In each sampling period t n concatenate the environmental vector E n = [T n , H n , B n , the original current Iraw n and the compensated target current Itar n to form the input sequence X n ;
[0174] Send X n into the two-layer long short-term memory network, and perform tensor attention fusion on the second-layer hidden state h t and the context vector z t to obtain the state vector Zt ;
[0175] Calculate the comprehensive compensation response Ω using the adaptive data compensation model and execute Θ new = Θ old + η·Ω to update the error source correlation parameter Θ;
[0176] In key - value form, write [timestamp t n → Θ new into the compensation parameter database and retain the most recent N historical versions for rollback;
[0177] Under the calibrated standard current condition (Istd), compare the output signal error before compensation Δpre = |Iraw – Istd| with the output signal error after compensation Δpost = |Itar – Istd|. If Δpost > δ thr (preset range), trigger the offline calibration process, perform a grid re - search on Θ and then reload it;
[0178] Enter the next sampling period and repeat the above steps.
[0179] As an example, the expression of the adaptive data compensation model is:
[0180]
[0181] where Ω is the comprehensive compensation response quantity, with a value range of (-∞, +∞), Q is the high - order aggregation order of the error source and is a positive integer, Γ is the Euler Gamma function, q is the summation index variable, τ0 is the starting time of the sequence, τ n is the current time, λ q is the q - th order exponential decay coefficient, I r (τ) is the original current signal at time τ, β q is the q - th real number with an exponent greater than 1, E q (τ) is the pre - normalization amplitude of the q - th environmental perturbation at time τ, Var(E q ) is the variance of E q within the window, ε is a very small positive number to prevent division by zero, h t is the hidden vector of the second - layer LSTM, z t is the context attention vector, <h t ,z t > is the inner product of the two vectors;
[0182] When |Ω| → 0, it means that the compensation model remains in a convergent state and does not require significant adjustment;
[0183] When Ω > 0, it means that the overall error is positive and the compensation amount needs to be reduced;
[0184] When Ω < 0, it indicates that the error is negatively biased and the compensation amount needs to be increased;
[0185] When |Ω| > Ω max , the database recalibration process will be triggered.
[0186] In an alternative embodiment, after calculating Ω according to the adaptive data compensation model, the new parameter set Θ is updated by performing gradient outer update using the adaptive learning rate η new to overwrite Θ old , and at the same time, a JSON-serialized snapshot and a hash check code are generated and written into the compensation parameter database; among them, the writing strategy adopts double buffering plus timestamp indexing to ensure that the system always obtains the latest verified parameter copy when reading in real time, and the old version is automatically cleared according to the FIFO policy after exceeding the retention threshold N, thus completing the self-evolving storage of the error source-compensation value mapping.
[0187] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present invention can be modified or equivalently replaced without departing from the spirit and scope of the technical solutions of the present invention, and they should all be covered within the scope of the claims of the present invention.
Claims
1. An adaptive data compensation method for a current sensor, characterized in that, Including: Collecting the original output signal of the current sensor in real time and synchronously obtaining the current environmental parameters, where the environmental parameters include at least one of temperature, humidity, and electromagnetic interference intensity; Determining, according to the environmental parameters, the multi-dimensional error sources caused by environmental factors in the original output signal, where the multi-dimensional error sources include at least two of temperature drift error, non-linear error, and electromagnetic coupling error; Calculating, according to the multi-dimensional error sources, the first influence value of each error source on the original output signal and determining whether the influence directions of the error sources are consistent; If the influence directions are consistent, selecting the first influence value with the largest absolute value as the current compensation value; otherwise, performing a weighted superposition calculation on the first influence values to obtain a comprehensive compensation value; Dynamically correcting the original output signal according to the current compensation value or the comprehensive compensation value to obtain a compensated target current signal; Inputting the target current signal into an adaptive data compensation model constructed based on a long short-term memory network to update the mapping relationship between the error sources and the compensation values and storing them in a compensation parameter database.
2. The adaptive data compensation method for a current sensor according to claim 1, wherein The determining, according to the environmental parameters, the multi-dimensional error sources caused by environmental factors in the original output signal includes: Identifying abnormal environmental parameters that exceed the environmental threshold according to a preset environmental parameter threshold range; Matching a corresponding pre-stored error source association model according to the type of the abnormal environmental parameters, where the error source association model includes at least one of a temperature-drift coefficient mapping table and an electromagnetic interference-coupling coefficient mapping table; Using the error source association model to determine the error source contribution degree corresponding to the abnormal environmental parameters.
3. The adaptive data compensation method for a current sensor according to claim 2, wherein The determining the error source contribution degree corresponding to the abnormal environmental parameters includes: Performing a normalization process on the abnormal environmental parameters to obtain their relative deviation values; Retrieving the error coefficient corresponding to the relative deviation value in the error source association model; Calculating the product of the relative deviation value and the corresponding error coefficient to obtain a corresponding contribution degree coefficient.
4. The adaptive data compensation method for a current sensor according to claim 1, wherein The calculating the first influence value of each error source on the original output signal includes: For the temperature drift error, calculating the first influence value corresponding to the temperature drift error according to the difference between the current temperature and the standard temperature and the temperature sensitivity coefficient; For the non-linear error, determining the first influence value corresponding to the non-linear error by using a piecewise linear interpolation method according to the output characteristic curve of the current sensor; For the electromagnetic coupling error, extracting the amplitude and phase of the electromagnetic interference signal by using a frequency domain analysis method and calculating the first influence value corresponding to the electromagnetic coupling error.
5. The adaptive data compensation method for a current sensor according to claim 1, characterized in that, If the influence directions are not consistent, performing a weighted superposition calculation on the first influence values to obtain a comprehensive compensation value, including: Assigning an initial weight to each error source, where the initial weight is proportional to the historical occurrence frequency of the error source; Calculating an adjustment factor according to the fluctuation amplitude of the real-time environmental parameters, where the adjustment factor is proportional to the relative fluctuation amplitude of the environmental parameters; Obtaining a corrected weight by calculating the product of the initial weight and the adjustment factor and performing a normalization process on all the corrected weights to obtain a final weight; Multiplying each first influence value by the corresponding weight and summing them to obtain a comprehensive compensation value.
6. The adaptive data compensation method for a current sensor according to claim 1, characterized in that, Dynamically correcting the original output signal to obtain a compensated target current signal, including: When the compensation value corresponds to a positive offset, subtracting the absolute value of the compensation value from the original output signal; When the compensation value corresponds to a negative offset, adding the absolute value of the compensation value to the original output signal.
7. The adaptive data compensation method for a current sensor according to claim 1, characterized in that The input of the adaptive data compensation model includes environmental parameters, the original output signal, and the compensated target current signal, and the output is the updated error source correlation model parameters.
8. The adaptive data compensation method for a current sensor according to claim 1 or 7, characterized in that Under standard current conditions, comparing the output signal errors before and after compensation, and when the error exceeds the preset allowable range, starting the recalibration process of the compensation parameter database.
Citation Information
Patent Citations
Support vector machine-based mine fiber grating monitoring system missing data compensation method
CN107392786A
Cited By
Fiber bragg grating strain sensing multi-source error compensation method
CN120846234A
Fiber grating strain sensing multi-source error compensation method
CN120846234B
High-precision voltage and current synchronous metering system of alternating current and direct current integrated standard electric energy meter
CN121142154A
Intelligent voltage monitoring system with adaptive calibration function
CN121186434A
Electrical parameter acquisition method and device, battery management system and storage medium
CN122386153A
