Current sensor and its environmental compensation method based on differential demodulation and PID feedback control

Through micro-difference demodulation and PID feedback control current sensor, the current output is adjusted in real time, which solves the problem of dynamic compensation in the prior art, improves the adaptability and measurement accuracy of the sensor, and ensures stability and accuracy in complex environments.

CN120177862BActive Publication Date: 2025-08-29CHINA PETROLEUM & CHEMICAL CORP +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510654333.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2025-08-29
Estimated Expiration
2045-05-21

AI Technical Summary

Technical Problem

In actual applications, existing current sensors cannot adjust compensation dynamically in real time. Due to temperature and current changes, they lead to a decrease in measurement accuracy and stability. They lack dynamic feedback control for real-time current changes, which affects the real-time response and accuracy of the sensor.

Method used

The micro-difference demodulation and PID feedback control method are used to obtain the periodic modulated voltage signal of the current sensor through the data acquisition unit, perform preprocessing and data analysis, and combine the Fourier transform method and the inverse Fourier transform method to calculate the current control index, and combine the environmental compensation index to adjust the current output in real time to adapt to external changes.

Benefits of technology

It improves the adaptability and measurement accuracy of the current sensor in changing environments, ensures that it maintains high accuracy and stability in complex environments, and avoids measurement errors caused by environmental factors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120177862B_ABST
    Figure CN120177862B_ABST
Patent Text Reader

Abstract

The present invention discloses a current sensor based on differential demodulation and PID feedback control and an environmental compensation method thereof, relating to the field of current measurement. The current sensor based on differential demodulation and PID feedback control continuously acquires modulated voltage signal data of several cycles of the current sensor, performs preprocessing, and performs data analysis on the modulated voltage signal data of each cycle of the preprocessed current sensor to obtain a difference signal of each cycle of the current sensor, which is then demodulated to obtain a current change signal of each cycle of the current sensor. The present invention analyzes the current change signal of each cycle of the current sensor to obtain a current control index of the current sensor in the current cycle, compares and analyzes it with a preset current drive control range, and takes corresponding control measures based on the analysis results, thereby making adjustments based on real-time data, thereby significantly improving the accuracy and reliability of current measurement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Current sensor and its environmental compensation method based on differential demodulation and PID feedback control Background Art

[0002] With the rapid development of electronic technology and automated control, current sensors have been widely used in many fields such as industry, instrumentation, automobiles, smart homes, etc. As an important measurement tool, current sensors can accurately monitor current changes and ensure the safety and reliability of equipment. However, traditional current sensors often have measurement errors due to interference from environmental factors, which affects the stability and accuracy of the system. The differential demodulation method can effectively reduce the signal error caused by environmental interference and improve the sensitivity and accuracy of the sensor by finely demodulating the current sensor signal. PID feedback control uses proportional, integral, and differential control algorithms to optimize the sensor's response time and stability by adjusting the current signal feedback in real time, thereby ensuring the reliability of the measurement results.

[0003] Prior art, such as a Hall current sensor with temperature compensation and a temperature compensation method thereof disclosed in a patent application with announcement number: CN110687347B, solves the technical problem that the current Hall current sensor is subject to reduced measurement accuracy due to temperature fluctuations. The sensor includes a Hall current chip, a PCB substrate temperature acquisition unit, a level conversion isolation unit, an AD conversion unit, a main control unit and a signal output unit; the signal output end of the Hall current chip is electrically connected to the signal input end of the level conversion isolation unit; the signal output end of the PCB substrate temperature acquisition unit is electrically connected to the main control unit; the signal output end of the level conversion isolation unit, the AD conversion unit, the main control unit and the signal output unit are electrically connected in sequence; during the current acquisition process of the Hall current chip, the PCB substrate temperature acquisition module is used to continuously monitor the chip temperature change, and the current collected by the Hall current chip is compensated according to the temperature value, so that the current value obtained is highly accurate.

[0004] Based on the above solution, it is found that the limitations of the existing technology include at least the following problems. First, the temperature calibration range and current calibration points in the existing technology are performed under a set environment and are only valid under specific calibration conditions. As a result, when the temperature and current of the current sensor change greatly in actual application, it is impossible to dynamically adjust and compensate in real time, thereby affecting the measurement accuracy and stability. Secondly, the existing technology lacks dynamic feedback control of real-time current changes, which causes the output current to be greatly affected by changes in the external environment, and then difficult to adaptively adjust. Finally, in the existing technology, the signal of the current sensor is demodulated after level conversion and filtering, and the current output cannot be adjusted in time within each cycle, which may cause errors, thereby affecting the real-time response and accuracy of the sensor. Summary of the Invention

[0005] In response to the deficiencies of the prior art, the present invention provides a current sensor and an environmental compensation method thereof based on micro-difference demodulation and PID feedback control, which solves the problem that the temperature calibration range and current calibration point in the prior art are performed under a set environment and are only valid under specific calibration conditions, so that when the temperature and current of the current sensor change greatly in actual application, it is impossible to dynamically adjust the compensation in real time, thereby affecting the measurement accuracy and stability. Secondly, the prior art lacks dynamic feedback control of real-time current changes, which causes the output current to be greatly affected by changes in the external environment, and then difficult to adaptively adjust. Finally, in the prior art, the signal of the current sensor is demodulated after level conversion and filtering processing, and the current output cannot be adjusted in time within each cycle, which may cause errors, thereby affecting the real-time response and accuracy of the sensor.

[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: a current sensor based on differential demodulation and PID feedback control, comprising: a data acquisition unit, a signal conversion unit, a feedback control unit, and an output control unit; the data acquisition unit is used to continuously acquire and preprocess the modulated voltage signal data of several cycles of the current sensor, wherein the modulated voltage signal data is specifically the instantaneous voltage value at each time point; the signal conversion unit is used to perform data analysis on the preprocessed modulated voltage signal data of each cycle of the current sensor to obtain a difference signal of each cycle of the current sensor, and perform demodulation processing to obtain a current change signal of each cycle of the current sensor; the feedback control unit is used to analyze the current change signal of each cycle of the current sensor to obtain an output current value of each cycle of the current sensor, and perform a comprehensive analysis of the output current value of each cycle of the current sensor in combination with PID feedback control to obtain a current control index of the current sensor in the current cycle; the output control unit is used to compare and analyze the current control index of the current sensor in the current cycle with a preset current drive control range, and take corresponding control measures based on the analysis results.

[0007] Furthermore, the specific steps for obtaining the difference signal of each cycle of the current sensor are as follows: comprehensively analyze the instantaneous voltage value at each time point of each cycle of the current sensor to obtain the instantaneous voltage peak value of each cycle of the current sensor, and mark it as the voltage amplitude of each cycle of the current sensor; and analyze the instantaneous voltage value at each time point of each cycle of the current sensor in combination with the Fourier transform method to obtain the frequency value and phase value of each cycle of the current sensor; and obtain the first reference voltage signal of each cycle of the current sensor in an ideal state, the first reference voltage signal including a first reference voltage amplitude, a first reference frequency value, and a first reference phase value; comprehensively analyze the voltage amplitude and phase value of each cycle of the current sensor with the reference voltage amplitude and reference phase value of each cycle in an ideal state, respectively, to obtain the difference amplitude and difference phase value of each cycle of the current sensor, and mark the frequency value of each cycle of the current sensor as the difference frequency value; generate an expression for the difference signal of each cycle of the current sensor based on the difference amplitude, difference phase value, and difference frequency value of each cycle of the current sensor.

[0008] Furthermore, the specific formula for calculating the difference amplitude and difference phase value of each cycle of the current sensor and the expression of the difference signal are as follows:

[0009] ;

[0010] in, The current sensor The difference amplitude of the period, The current sensor The voltage amplitude of each cycle, The current sensor The phase value of a cycle, The current sensor is in an ideal state. The first reference voltage amplitude of a cycle, The current sensor is in an ideal state. The first reference phase value of the cycle, The current sensor The difference phase value of the cycle, For the The difference signal of the period, The current sensor The frequency value of the cycle, , is the number of cycles, is the ratio of pi. Furthermore, the specific steps of obtaining the current change signal of each cycle of the current sensor are as follows: analyzing the difference signal of each cycle of the current sensor in combination with the Fourier transform method to obtain several frequency components of each cycle of the current sensor; extracting and processing each frequency component of each cycle of the current sensor to obtain a signal frequency value corresponding to each frequency component of each cycle of the current sensor; obtaining the cutoff frequency of the frequency signal of each cycle of the current sensor and establishing a frequency response function; and comprehensively analyzing the signal frequency value corresponding to each frequency component of the difference signal of each cycle of the current sensor and the frequency response function in combination with the inverse Fourier transform method to obtain the current change signal of each cycle of the current sensor.

[0011] Furthermore, the specific steps for obtaining the current control index of the current sensor in the current cycle are as follows: comprehensively analyze the current signal of each cycle of the current sensor to obtain the output current value of each cycle of the current sensor; establish the current error function of the current sensor based on the output current value of each cycle of the current sensor and the preset target current value, and obtain the critical gain and cycle length of the current sensor; analyze the critical gain and cycle length of the current sensor to obtain the proportional reference coefficient, integral reference coefficient, and differential reference coefficient of the current sensor; adjust and analyze the proportional reference coefficient, integral reference coefficient, differential reference coefficient, and current error function of the current sensor to obtain the current control index of the current sensor in the current cycle.

[0012] Furthermore, the specific formula for calculating the current control index of the current sensor in the current cycle is as follows: ,in, The current sensor The proportional gain exponent of the cycle, is the proportional reference coefficient of the current sensor, is the integral reference coefficient of the current sensor, is the differential reference coefficient of the current sensor, , is the number of cycles. Furthermore, the specific steps for obtaining the output current value of each cycle of the current sensor are as follows: reading the initial voltage amplitude of the initial voltage signal of each cycle of the current sensor, marking it as the voltage change value of each cycle of the current sensor, and obtaining the sensitivity coefficient and initial current value of the current sensor; performing a ratio analysis between the voltage change value of each cycle of the current sensor and the sensitivity coefficient respectively to obtain the output current change value of each cycle of the current sensor, and establishing a current change function of the current sensor; and performing a comprehensive analysis on the initial current value and the current change function of the current sensor to obtain the output current value of each cycle of the current sensor.

[0013] An environmental compensation method for a current sensor based on differential demodulation and PID feedback control includes: obtaining environmental data of the current sensor in the current cycle, wherein the environmental data specifically includes a temperature value, a humidity value, a magnetic field strength value, and an electromagnetic interference value, and obtaining a temperature reference value, a humidity reference value, and a magnetic field strength reference value of the current sensor; standardizing the temperature reference value, humidity reference value, and magnetic field strength reference value of the current sensor, as well as the temperature value, humidity value, magnetic field strength value, and electromagnetic interference value of the current cycle; comprehensively analyzing the standardized temperature reference value, humidity reference value, and magnetic field strength reference value of the current sensor, as well as the temperature value, humidity value, magnetic field strength value, and electromagnetic interference value of the current cycle to obtain an environmental compensation index of the current sensor in the current cycle; and comprehensively analyzing the environmental compensation coefficient and current control index of the current sensor in the current cycle to obtain a current correction control index of the current sensor in the current cycle.

[0014] Furthermore, the specific formula for calculating the environmental compensation index and the current correction control index of each cycle of the current sensor is as follows: ;

[0015] in, is the ambient compensation index of the current sensor's current cycle, is the temperature value of the current sensor in the current cycle after normalization, is the temperature reference value of the current sensor after normalization, is the temperature coefficient of the current sensor stored in the database, is the humidity value of the current sensor in the current cycle after normalization, is the humidity reference value of the current sensor after standardization, is the humidity coefficient of the current sensor stored in the database, is the humidity value and magnetic field strength value of the current sensor in the current cycle after normalization. is the reference value of the magnetic field strength of the current sensor after standardization, is the magnetic field coefficient of the current sensor stored in the database, is the electromagnetic interference value of the current sensor in the current cycle after normalization, is the interference coefficient of the current sensor stored in the database, , is the current correction control index of the current sensor in the current cycle, is the current control index of the current sensor in the current cycle, , is the number of cycles, is a natural constant. The present invention has the following beneficial effects:

[0016] (1) The current sensor based on micro-difference demodulation and PID feedback control introduces PID control algorithm and real-time feedback mechanism, so that the current sensor can automatically adjust the output according to external changes. The data acquisition unit continuously obtains the modulated voltage signal of the current sensor and adjusts the control strategy through dynamic demodulation and analysis, ensuring that the sensor can adaptively adjust the output current under changing working conditions, thereby enhancing the real-time response capability and adaptability of the sensor.

[0017] (2) The current sensor based on micro-difference demodulation and PID feedback control can accurately capture the instantaneous voltage value of each cycle through continuous monitoring and real-time preprocessing by the data acquisition unit, and perform detailed current change analysis through the signal conversion unit. As a result, the current measurement can not only reflect the actual current change, but also be adjusted according to the real-time data, thereby avoiding the measurement error caused by environmental factors, thereby significantly improving the accuracy and reliability of the current measurement.

[0018] (3) The environmental compensation method of the current sensor based on differential demodulation and PID feedback control collects the environmental data of the current sensor in real time and standardizes it with its reference value, so as to accurately obtain and comprehensively analyze the influence of various environmental factors on the current measurement. The introduction of the environmental compensation index ensures that the measurement accuracy of the current sensor is not disturbed by external fluctuations under different environmental conditions, thereby automatically correcting the sensor output, and ensuring that it can maintain high accuracy and stability in various complex environments, thereby improving the adaptability of the sensor in harsh or changing environments and avoiding the decrease in accuracy due to environmental changes.

[0019] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a flow chart of the current sensor based on differential demodulation and PID feedback control of the present invention.

[0021] Figure 2 This is a block diagram of a current sensor based on differential demodulation and PID feedback control according to the present invention.

[0022] Figure 3 This is a flow chart of the environmental compensation method of the current sensor based on differential demodulation and PID feedback control of the present invention. DETAILED DESCRIPTION

[0023] The embodiments of the present application solve the problem in the prior art that the temperature calibration range and current calibration point are performed under a set environment and are only valid under specific calibration conditions, through a current sensor and its environmental compensation method based on differential demodulation and PID feedback control. As a result, when the temperature and current of the current sensor change greatly in actual application, it is impossible to dynamically adjust the compensation in real time, thereby affecting the measurement accuracy and stability. Secondly, the prior art lacks dynamic feedback control of real-time current changes, which causes the output current to be greatly affected by changes in the external environment, and then difficult to adaptively adjust. Finally, in the prior art, the signal of the current sensor is demodulated after level conversion and filtering, and the current output cannot be adjusted in time within each cycle, which may cause errors, thereby affecting the real-time response and accuracy of the sensor.

[0024] The overall approach to the problems in the embodiments of this application is as follows:

[0025] First, the periodic modulated voltage signal data of the current sensor is continuously acquired and preprocessed. Then, the modulated voltage signal data of each cycle of the preprocessed current sensor is analyzed through the signal conversion unit to obtain the difference signal of each cycle of the current sensor, and demodulation processing is performed to obtain the current change signal of each cycle of the current sensor. Finally, the feedback control unit uses PID feedback control to analyze the current change signal of each cycle, calculates the current control index, and compares it with the preset current control range. According to the comparison result, the output control unit executes corresponding control measures and adjusts the current output in real time to ensure that the current value of the sensor is stable within the expected range.

[0026] See also Figure 1 and Figure 2 An embodiment of the present invention provides a technical solution: a current sensor based on differential demodulation and PID feedback control, comprising the following steps: a data acquisition unit, configured to continuously acquire modulated voltage signal data (at the output end) of a current sensor (in this embodiment, the current sensor is a TMR current sensor) for several (signal) cycles (by adding an adaptive control circuit to the output portion of the sensor to dynamically adjust the modulation depth (amplitude, frequency, or phase) of the output signal to respond to changes in the external current or magnetic field), and perform preprocessing, wherein the modulated voltage signal data is specifically an instantaneous voltage value at each time point (the instantaneous voltage value is the precise value of the voltage signal at a certain moment, obtained by a sampling method, i.e., a sampling device (such as an analog-to-digital converter, ADC) samples the voltage signal, the ADC measures and outputs the voltage value, and stores the output voltage value in a database);

[0027] a signal conversion unit, configured to perform data analysis on the pre-processed modulated voltage signal data of each cycle of the current sensor to obtain a difference signal of each cycle of the current sensor, and perform demodulation processing to obtain a current change signal of each cycle of the current sensor;

[0028] A feedback control unit is used to analyze the current change signal of each cycle of the current sensor to obtain the output current value of each cycle of the current sensor, and to perform a comprehensive analysis on the output current value of each cycle of the current sensor in combination with PID feedback control to obtain the current control index of the current sensor in the current cycle (i.e., the last cycle obtained);

[0029] The output control unit is used to compare and analyze the current control index of the current sensor in the current cycle with the preset current drive control range, and take corresponding control measures based on the analysis result.

[0030] (If the current control index of the current sensor in the current cycle is within the preset current drive control range, the current state is maintained; if the current control index of the current sensor in the current cycle is lower than the preset lower limit of the current drive control range, the current drive is adjusted upward to increase the current output until the current reaches the normal range. PID control can be used for fine-tuning to gradually increase the current until the target value is reached; if the current control index of the current sensor in the current cycle is higher than the preset upper limit of the current drive control range, the current drive is adjusted downward to reduce the current output, and the current sensor is checked for overload or short circuit).

[0031] Specifically, the specific steps for obtaining the difference signal of each cycle of the current sensor are as follows: comprehensively analyzing the instantaneous voltage value at each time point of each cycle of the current sensor to obtain the instantaneous voltage peak value of each cycle of the current sensor, and marking it as the voltage amplitude of each cycle of the current sensor; and analyzing the instantaneous voltage value at each time point of each cycle of the current sensor in combination with the Fourier transform method to obtain the frequency value and phase value of each cycle of the current sensor; and obtaining the first reference voltage signal of each cycle of the current sensor in an ideal state (i.e., the output of the system when there is no external disturbance or current change), the first reference voltage signal including a first reference voltage amplitude, a first reference frequency value (the same as the frequency value of the corresponding cycle), and a first reference phase value; comprehensively analyzing the voltage amplitude and phase value of each cycle of the current sensor with the reference voltage amplitude and reference phase value of each cycle in the ideal state, respectively, to obtain the difference amplitude and difference phase value of each cycle of the current sensor, and marking the frequency value of each cycle of the current sensor as the difference frequency value; and generating an expression for the difference signal of each cycle of the current sensor based on the difference amplitude, difference phase value, and difference frequency value of each cycle of the current sensor.

[0032] The frequency value and phase value of each cycle of the current sensor are obtained specifically as follows: Fourier transform analysis is performed on the instantaneous voltage value at each time point of each cycle of the current sensor to obtain several frequency components of each cycle of the current sensor, and the amplitude value corresponding to each frequency component of each cycle of the current sensor is analyzed in combination with a statistical method to obtain the fundamental frequency of each cycle of the current sensor (that is, the frequency component with the largest amplitude value), which is marked as the frequency value of each cycle of the current sensor, and the phase offset corresponding to the fundamental frequency of each cycle of the current sensor is marked as the phase value.

[0033] The first reference voltage signal is the output signal of the sensor measured under a known current value. The output signal (i.e., the static signal) is measured when there is no current input (under zero current conditions). Through calibration experiments, the input current is changed and the output signal is recorded to establish the relationship between input and output, and select a reference signal representing the "ideal" state.

[0034] The specific formula for calculating the difference amplitude and difference phase value of each cycle of the current sensor and the expression of the difference signal are: ;

[0035] in, The current sensor The difference amplitude of the period, The current sensor The voltage amplitude of each cycle, The current sensor The phase value of a cycle, The current sensor is in an ideal state. The first reference voltage amplitude of a cycle, The current sensor is in an ideal state. The first reference phase value of the cycle, The current sensor The difference phase value of the cycle, For the The difference signal of the period, The current sensor The frequency value of the cycle, , is the number of cycles, =π, which is 3.14 in this embodiment. In this embodiment, frequency and phase values ​​are obtained through Fourier transform, thereby accurately analyzing the output signal of the current sensor and accurately determining signal changes. Frequency and phase values ​​are important parameters that characterize signal characteristics, helping to detect small changes caused by external disturbances or system instability. Secondly, by calculating the difference amplitude and difference phase, the difference between the system output and the ideal reference state can be captured, further improving the sensitivity and responsiveness of the measurement system. The Fourier transform can convert the signal from the time domain to the frequency domain, helping to effectively filter out noise, thereby enabling the current sensor to operate stably in high-noise environments. At the same time, through the precise measurement of the fundamental frequency and phase offset, the difference between the noise signal and the actual current signal can be effectively distinguished, thereby improving the anti-interference capability. Finally, each cycle of the current sensor is independently analyzed to evaluate the state of each cycle in real time. The difference signal expression can accurately describe the gap between the current sensor and the ideal reference state, providing a quantitative basis for subsequent optimization and adjustment.

[0036] Specifically, the specific steps for obtaining the current change signal of each cycle of the current sensor are as follows: combining the Fourier transform method to analyze the difference signal of each cycle of the current sensor to obtain several frequency components of each cycle of the current sensor; and extracting and processing each frequency component of each cycle of the current sensor to obtain the signal frequency value corresponding to each frequency component of each cycle of the current sensor; obtaining the cutoff frequency of the frequency signal of each cycle of the current sensor, and establishing a frequency response function; combining the inverse Fourier transform method to comprehensively analyze the signal frequency value corresponding to each frequency component of the difference signal of each cycle of the current sensor and the frequency response function to obtain the current change signal of each cycle of the current sensor.

[0037] Among them, the discriminant of the frequency response function is: ;in, is the frequency response function, Current sensor The first cycle The signal frequency value corresponding to the frequency component is Current sensor The cutoff frequency of the frequency signal of one cycle, , is the number of cycles, , is the number of frequency components. The Fourier transform method specifically converts the time domain signal (the difference signal of each cycle of the current sensor) into the frequency domain. This decomposes the complex time domain signal into a combination of several sine waves (sine waves of different frequencies, amplitudes, and phases), namely the frequency components.

[0038] The inverse Fourier transform method is specifically to convert the filtered frequency component (that is, the frequency component filtered by the frequency response function) back to the time domain, that is, the current change signal.

[0039] In this embodiment, the time domain signal of the current sensor is converted into a frequency domain signal by Fourier transform, thereby decomposing the complex current change signal into a combination of several sinusoidal waves, and each sinusoidal wave represents a frequency component in the signal. By extracting these frequency components, accurate data support is provided for signal filtering and control. At the same time, the frequency component of each cycle is extracted and the frequency value of each frequency component is obtained, thereby capturing the important frequency information in the current signal. Secondly, by establishing a frequency response function and applying it to each frequency component of the signal, filtering processing is performed on signals in different frequency ranges, thereby helping to remove unwanted high-frequency noise or low-frequency drift and retaining the effective components in the signal. Secondly, the inverse Fourier transform converts the frequency components processed by the frequency response function back to the time domain signal, which can obtain a smoother and optimized current change signal, making the signal recovery process more accurate, avoiding possible distortion in the filtering process, and ensuring that the current change signal can reflect the actual current change. Finally, by finely extracting and filtering each frequency component, a higher quality current change signal is restored, thereby improving the response speed and stability.

[0040] Specifically, the specific steps for obtaining the current control index of the current sensor in the current cycle are as follows: comprehensively analyze the current signal of each cycle of the current sensor to obtain the output current value of each cycle of the current sensor; establish the current error function of the current sensor based on the output current value of each cycle of the current sensor and the preset target current value, and obtain the critical gain and cycle length of the current sensor; analyze the critical gain and cycle length of the current sensor to obtain the proportional reference coefficient, integral reference coefficient, and differential reference coefficient of the current sensor; adjust and analyze the proportional reference coefficient, integral reference coefficient, differential reference coefficient, and current error function of the current sensor to obtain the current control index of the current sensor in the current cycle.

[0041] The critical gain is the proportional gain value at which the current signal in the current sensor enters a critical oscillation state. It is obtained through an experimental method, that is, setting an initial proportional gain, increasing the proportional gain, and monitoring the response of the system. When the output begins to become unstable and maintains periodic oscillation, the value of the proportional gain is recorded and stored in a database.

[0042] The cycle duration is the time required for the current signal to complete a complete oscillation. It is obtained through the sampling method. The signal is sampled and the waveform of the signal is monitored using an oscilloscope. The time difference between the starting point of one oscillation and the starting point of the next oscillation (i.e., the cycle duration) is stored in the database.

[0043] The current error function expression of the current sensor and the specific formulas for calculating the proportional reference coefficient, integral reference coefficient, and differential reference coefficient of the current sensor are as follows: ;

[0044] in, is the current error function of the current sensor, The current sensor The current value of a cycle, is the current reference value of the current sensor, is the proportional reference coefficient of the current sensor, is the scaling factor stored in the database, which is 0.6 in this implementation example. is the critical gain of the current sensor, is the integral reference coefficient of the current sensor, is the integration factor stored in the database, which is 2 in this implementation example. is the cycle length of the current sensor, is the differential reference coefficient of the current sensor, is the differential factor stored in the database, which is 8 in this implementation example. , is the number of cycles.

[0045] The specific formula for calculating the current control index of the current sensor in the current cycle is as follows: ;in, The current sensor The proportional gain index of the cycle (i.e. the current cycle), is the proportional reference coefficient of the current sensor, is the integral reference coefficient of the current sensor, is the differential reference coefficient of the current sensor, , is the number of cycles. In this implementation example, is the proportional term of the current sensor, and is the current error value of the current sensor in the current cycle, is the integral term of the current sensor in the current cycle, and is the integral of the current error of the current sensor, is the differential term of the current cycle of the current sensor, and is the derivative of the current error of the current sensor.

[0046] In this embodiment, by comparing the output current value of the current sensor with the target current value, a current error function is generated, thereby reflecting the deviation between the current output and the target current, providing a basis for subsequent control and adjustment, and adjusting the control parameters according to the error size to optimize the current output. By calculating the proportional, integral and differential reference coefficients and combining the current error value of the current cycle, multi-dimensional feedback control of the current is performed to ensure that the current output remains within a stable control range, thereby enhancing the current sensor's ability to respond to current changes, being able to quickly correct current deviations, and improving the accuracy of the current sensor. Secondly, the critical gain and cycle length are key parameters for the stability of the current sensor. By determining these parameters through experiments, the critical stability point of the system can be accurately understood to avoid system oscillation or slow response caused by excessively high or low gain. Ensure that the system operates within a stable range. At the same time, by setting the critical gain, the current control state is monitored in real time and the parameters are adjusted to prevent the current sensor from entering an unstable state or oscillating, thereby ensuring the stability of the current signal. This improves the robustness of the current sensor to external disturbances (such as voltage fluctuations, load changes, etc.), ensuring stable operation under various uncertain conditions, and the sampling and analysis of the cycle length can help the current sensor identify and adapt to different workloads and operating environments. Finally, the real-time feedback mechanism of the current error enables the current sensor to automatically adjust the control output according to the current error of the current cycle, and then dynamically adjust the control strategy to ensure that the current output always maintains the minimum error with the target value. The integral term helps eliminate the cumulative error, and the differential term reduces instantaneous fluctuations, thereby achieving precise current regulation.

[0047] Specifically, the specific steps for obtaining the output current value of each cycle of the current sensor are as follows: read the initial voltage amplitude of the initial voltage signal of each cycle of the current sensor, mark it as the voltage change value of each cycle of the current sensor, and obtain the sensitivity coefficient and initial current value of the current sensor; perform a ratio analysis on the voltage change value of each cycle of the current sensor and the sensitivity coefficient respectively to obtain the output current change value of each cycle of the current sensor, and establish a current change function of the current sensor; perform a comprehensive analysis on the initial current value and the current change function of the current sensor to obtain the output current value of each cycle of the current sensor.

[0048] The sensitivity coefficient is a proportional relationship between a magnetic field change caused by a current change in the TMR current sensor and an output voltage, and is obtained from the technical specifications of the TMR current sensor stored in the database.

[0049] The initial current value is the current value measured by the current sensor in the absence of external disturbances or current changes. It is obtained through the theoretical model of the circuit, that is, the operating voltage and load impedance of the TMR current sensor circuit are obtained. The initial current value = operating voltage / load impedance.

[0050] In this embodiment, the voltage change value and the sensitivity coefficient are combined for analysis, so that the voltage signal can be accurately converted into the current change value. The sensitivity coefficient, as a key parameter of the TMR (tunnel magnetoresistance) current sensor, can accurately reflect the influence of the current change on the magnetic field and voltage output, thereby enabling the current change to be accurately converted into the current change value. The establishment of the current change function can further clarify the current response relationship of the current sensor, thereby ensuring a clear and predictable relationship between the current output value and the voltage change value. At the same time, the sensitivity coefficient of the TMR current sensor reflects the proportional relationship between the magnetic field change and the output voltage, so that the current sensor can accurately respond to tiny current changes, thereby improving the measurement accuracy. Secondly, through the sensitivity coefficient, A comprehensive analysis of the sensitivity coefficient and the voltage change value can more accurately calculate the current change value, which in turn helps to further optimize the control system and ensure that the current is stable and operates within the specified range. In addition, the method of obtaining the initial current value ensures the output value of the current sensor under ideal conditions without external disturbances, thereby providing a stable benchmark for subsequent current changes, thereby avoiding errors caused by external disturbances. Moreover, by establishing the current change function, the change of current over time can be accurately simulated, thereby ensuring that the control system can adjust and respond to current fluctuations in real time and maintain current stability. Finally, by combining the current change function with the initial current value for analysis, more precise current control can be achieved, thereby ensuring that the current output value can be consistent with the target current value.

[0051] See also Figure 3 , an embodiment of the present invention provides a technical solution: an environmental compensation method for a current sensor based on differential demodulation and PID feedback control, comprising the following steps: obtaining environmental data of the current sensor in the current cycle, the environmental data specifically being temperature value, humidity value, magnetic field strength value, and electromagnetic interference value, and obtaining a temperature reference value, humidity reference value, and magnetic field strength reference value of the current sensor; standardizing the temperature reference value, humidity reference value, and magnetic field strength reference value of the current sensor as well as the temperature value, humidity value, magnetic field strength value, and electromagnetic interference value of the current cycle; comprehensively analyzing the standardized temperature reference value, humidity reference value, and magnetic field strength reference value of the current sensor as well as the temperature value, humidity value, magnetic field strength value, and electromagnetic interference value of the current cycle to obtain an environmental compensation index of the current sensor in the current cycle; comprehensively analyzing the environmental compensation coefficient and current control index of the current sensor in the current cycle to obtain a current correction control index of the current sensor in the current cycle.

[0052] The electromagnetic interference value is the interference intensity of electromagnetic waves generated by an external or internal source of the TMR current sensor on the sensor signal, which is obtained through an EMI sensor (such as an electromagnetic field detector).

[0053] The magnetic field strength value is the comprehensive magnetic field strength value outside the TMR current sensor, so the magnetic field strength value = 1 / 2 The sum of the squares of the magnetic field strength values ​​in each direction.

[0054] The humidity reference value is an ideal operating humidity of the current sensor under standard environmental conditions, and is obtained through a technical manual of the current sensor stored in a database.

[0055] The magnetic field strength reference value is a magnetic field strength value of the current sensor under a standard environment, and is obtained through a technical manual of the current sensor stored in the database.

[0056] Specifically, the specific formula for calculating the environmental compensation index and the current correction control index of each cycle of the current sensor is as follows: ;

[0057] in, is the ambient compensation index of the current sensor's current cycle, is the temperature value of the current sensor in the current cycle after normalization, is the temperature reference value of the current sensor after normalization, is the temperature coefficient of the current sensor stored in the database, is the humidity value of the current sensor in the current cycle after normalization, is the humidity reference value of the current sensor after standardization, is the humidity coefficient of the current sensor stored in the database, is the humidity value and magnetic field strength value of the current sensor in the current cycle after normalization. is the reference value of the magnetic field strength of the current sensor after standardization, is the magnetic field coefficient of the current sensor stored in the database, is the electromagnetic interference value of the current sensor in the current cycle after normalization, is the interference coefficient of the current sensor stored in the database, , is the current correction control index of the current sensor in the current cycle, is the current control index of the current sensor in the current cycle, , is the number of cycles, is a natural constant, and in this embodiment, it is taken as 2.71. It should be explained that 、 、 、 The specific acquisition process is as follows: read the temperature value, humidity value, magnetic field strength value, and electromagnetic interference value of the current sensor in the current cycle after standardization, and perform sum analysis to obtain the environmental sum value of the current sensor, and perform ratio analysis on the temperature value, humidity value, magnetic field strength value, and electromagnetic interference value of the current sensor in the current cycle after standardization with the environmental sum value, and use the ratio analysis results as the corresponding coefficients.

[0058] The calculation data examples of the environmental compensation index and current correction control index of the current sensor in the current cycle are as follows:

[0059] Table 1 Example of calculation data for the current sensor's current cycle's environmental compensation index and current correction control index ;

[0060] ;

[0061] In the table, is the temperature value of the current sensor in the current cycle after normalization, is the temperature reference value of the current sensor after normalization, is the humidity value of the current sensor in the current cycle after normalization, is the humidity reference value of the current sensor after standardization, is the humidity value and magnetic field strength value of the current sensor in the current cycle after normalization. is the reference value of the magnetic field strength of the current sensor after standardization, is the electromagnetic interference value of the current sensor in the current cycle after normalization, is the temperature coefficient of the current sensor stored in the database, is the humidity coefficient of the current sensor stored in the database, is the magnetic field coefficient of the current sensor stored in the database, is the interference coefficient of the current sensor stored in the database, The current sensor's current cycle ambient compensation index, is the current control index of the current sensor in the current cycle, in amperes. The current correction control index of the current sensor in the current cycle, in amperes. The first set of data: the temperature value of the current sensor in the current cycle after standardization is: 0.624; the temperature reference value of the current sensor after standardization is: 0.584; the humidity value of the current sensor in the current cycle after standardization is: 0.447; the humidity reference value of the current sensor after standardization is: 0.493; the magnetic field strength value of the humidity value in the current cycle after standardization is: 0.611; the magnetic field strength reference value of the current sensor after standardization is: 0.546; the electromagnetic interference value of the current sensor in the current cycle after standardization is: 0.422; the temperature coefficient of the current sensor stored in the database is: 0.342; the humidity coefficient of the current sensor stored in the database is: 0.151; the magnetic field coefficient of the current sensor stored in the database is: 0.283; the interference coefficient of the current sensor stored in the database is: 0.234; the environmental compensation index of the current sensor in the current cycle is approximately: 0.141; the current control index of the current sensor in the current cycle is approximately: 0.061 ampere; and the current correction control index of the current sensor in the current cycle is approximately: 0.109 ampere.

[0062] The second set of data: the temperature value of the current sensor in the current cycle after standardization is: 0.671; the temperature reference value of the current sensor after standardization is: 0.584; the humidity value of the current sensor in the current cycle after standardization is: 0.472; the humidity reference value of the current sensor after standardization is: 0.493; the magnetic field strength value of the humidity value in the current cycle after standardization is: 0.585; the magnetic field strength reference value of the current sensor after standardization is: 0.546; the electromagnetic interference value of the current sensor in the current cycle after standardization is: 0.483; the temperature coefficient of the current sensor stored in the database is: 0.342; the humidity coefficient of the current sensor stored in the database is: 0.151; the magnetic field coefficient of the current sensor stored in the database is: 0.283; the interference coefficient of the current sensor stored in the database is: 0.234; the environmental compensation index of the current sensor in the current cycle is approximately: 0.154; the current control index of the current sensor in the current cycle is approximately: 0.057 amperes; and the current correction control index of the current sensor in the current cycle is approximately: 0.102 amperes.

[0063] The third set of data: the temperature value of the current sensor in the current cycle after standardization is: 0.529; the temperature reference value of the current sensor after standardization is: 0.584; the humidity value of the current sensor in the current cycle after standardization is: 0.521; the humidity reference value of the current sensor after standardization is: 0.493; the magnetic field strength value of the humidity value in the current cycle after standardization is: 0.634; the magnetic field strength reference value of the current sensor after standardization is: 0.546; the electromagnetic interference value of the current sensor in the current cycle after standardization is: 0.391; the temperature coefficient of the current sensor stored in the database is: 0.342; the humidity coefficient of the current sensor stored in the database is: 0.151; the magnetic field coefficient of the current sensor stored in the database is: 0.283; the interference coefficient of the current sensor stored in the database is: 0.234; the environmental compensation index of the current sensor in the current cycle is approximately: 0.151; the current control index of the current sensor in the current cycle is approximately: 0.067 amperes; and the current correction control index of the current sensor in the current cycle is approximately: 0.119 amperes.

[0064] The fourth set of data: the temperature value of the current sensor in the current cycle after standardization is: 0.662; the temperature reference value of the current sensor after standardization is: 0.584; the humidity value of the current sensor in the current cycle after standardization is: 0.488; the humidity reference value of the current sensor after standardization is: 0.493; the magnetic field strength value of the humidity value in the current cycle after standardization is: 0.597; the magnetic field strength reference value of the current sensor after standardization is: 0.546; the electromagnetic interference value of the current sensor in the current cycle after standardization is: 0.512; the temperature coefficient of the current sensor stored in the database is: 0.342; the humidity coefficient of the current sensor stored in the database is: 0.151; the magnetic field coefficient of the current sensor stored in the database is: 0.283; the interference coefficient of the current sensor stored in the database is: 0.234; the environmental compensation index of the current sensor in the current cycle is approximately: 0.156; the current control index of the current sensor in the current cycle is approximately: 0.054 amperes; and the current correction control index of the current sensor in the current cycle is approximately: 0.096 amperes.

[0065] The fifth set of data: the temperature value of the current sensor in the current cycle after standardization is: 0.558; the temperature reference value of the current sensor after standardization is: 0.584; the humidity value of the current sensor in the current cycle after standardization is: 0.422; the humidity reference value of the current sensor after standardization is: 0.493; the magnetic field strength value of the humidity value in the current cycle after standardization is: 0.603; the magnetic field strength reference value of the current sensor after standardization is: 0.546; the electromagnetic interference value of the current sensor in the current cycle after standardization is: 0.458; the temperature coefficient of the current sensor stored in the database is: 0.342; the humidity coefficient of the current sensor stored in the database is: 0.151; the magnetic field coefficient of the current sensor stored in the database is: 0.283; the interference coefficient of the current sensor stored in the database is: 0.234; the environmental compensation index of the current sensor in the current cycle is approximately: 0.139; the current control index of the current sensor in the current cycle is approximately: 0.059 amperes; and the current correction control index of the current sensor in the current cycle is approximately: 0.104 amperes.

[0066] In this embodiment, by calculating the environmental compensation index and the current correction control index, these environmental influences can be effectively compensated, thereby improving the measurement accuracy of the current sensor, and then ensuring that the measured current value is more in line with the actual situation. By calculating the current correction control index, more accurate correction parameters are provided for the control system of the current sensor, and then automatically adjusted according to real-time environmental changes to maintain the stability and reliability of current control, and avoid measurement errors caused by environmental changes. At the same time, it helps to improve the robustness of the system and reduce the negative impact of external environmental changes on sensor output. Secondly, through standardization processing and proportion analysis, the performance of the current sensor is optimized according to the actual collected data, so that the output of the current sensor is more accurate, ensuring that the system can make feedback adjustments based on real-time data. Finally, the calculated environmental compensation and current correction control index can automatically adjust the current value, reduce human intervention, and improve the efficiency and accuracy of overall control.

[0067] In summary, this application has at least the following effects:

[0068] By introducing the PID control algorithm and real-time feedback mechanism, the current sensor can automatically adjust its output according to external changes. The data acquisition unit continuously obtains the modulated voltage signal of the current sensor and adjusts the control strategy through dynamic demodulation and analysis, ensuring that the sensor can adaptively adjust the output current under changing working conditions, thereby enhancing the sensor's real-time response and adaptability.

[0069] Through continuous monitoring and real-time preprocessing by the data acquisition unit, the current sensor can accurately capture the instantaneous voltage value of each cycle, and perform detailed current change analysis through the signal conversion unit. As a result, the current measurement can not only reflect the actual current changes, but also be adjusted according to real-time data, thereby avoiding measurement errors caused by environmental factors, thereby significantly improving the accuracy and reliability of current measurement.

[0070] By collecting the environmental data of the current sensor's current cycle in real time and standardizing it with its reference value, it is possible to accurately obtain and comprehensively analyze the impact of various environmental factors on current measurement. The introduction of the environmental compensation index ensures that the measurement accuracy of the current sensor is not disturbed by external fluctuations under different environmental conditions, thereby automatically correcting the sensor output, thereby ensuring that high accuracy and stability can be maintained in various complex environments, thereby improving the sensor's adaptability in harsh or changing environments and avoiding the loss of accuracy due to environmental changes.

[0071] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0072] Obviously, those skilled in the art may make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if such changes and modifications fall within the scope of the claims and their equivalents, the present invention is intended to include such changes and modifications.

Claims

1. A current sensor based on differential demodulation and PID feedback control, characterized in that: include: Data acquisition unit, signal conversion unit, feedback control unit, output control unit; The data acquisition unit is used to continuously acquire the modulated voltage signal data of the current sensor for several cycles and perform preprocessing, wherein the modulated voltage signal data is specifically the instantaneous voltage value at each time point; The signal conversion unit is configured to perform data analysis on the pre-processed modulated voltage signal data of each cycle of the current sensor to obtain a difference signal of each cycle of the current sensor, specifically by performing a comprehensive analysis on the instantaneous voltage value at each time point of each cycle of the current sensor to obtain an instantaneous voltage peak value of each cycle of the current sensor, and marking the peak value as the voltage amplitude of each cycle of the current sensor; The instantaneous voltage value of each time point of each cycle of the current sensor is analyzed by combining the Fourier transform method to obtain the frequency value and phase value of each cycle of the current sensor; and obtaining a first reference voltage signal of each cycle when the current sensor is in an ideal state, wherein the first reference voltage signal includes a first reference voltage amplitude, a first reference frequency value, and a first reference phase value; The voltage amplitude and phase value of each cycle of the current sensor are comprehensively analyzed with the reference voltage amplitude and reference phase value of each cycle under an ideal state to obtain the difference amplitude and difference phase value of each cycle of the current sensor, and the frequency value of each cycle of the current sensor is marked as the difference frequency value; Generate an expression of a difference signal of each cycle of the current sensor based on the difference amplitude, difference phase value, and difference frequency value of each cycle of the current sensor, and perform demodulation processing to obtain a current change signal of each cycle of the current sensor; The feedback control unit is used to analyze the current change signal of each cycle of the current sensor to obtain the output current value of each cycle of the current sensor, and perform a comprehensive analysis on the output current value of each cycle of the current sensor in combination with PID feedback control to obtain the current control index of the current sensor in the current cycle; The output control unit is used to compare and analyze the current control index of the current sensor in the current cycle with the preset current drive control range, and take corresponding control measures based on the analysis result.

2. The current sensor based on differential demodulation and PID feedback control according to claim 1, characterized in that: The specific formula for calculating the difference amplitude and difference phase value of each cycle of the current sensor and the expression of the difference signal are as follows: ;in, The current sensor The difference amplitude of the period, The current sensor The voltage amplitude of each cycle, The current sensor The phase value of a cycle, The current sensor is in an ideal state. The first reference voltage amplitude of a cycle, The current sensor is in an ideal state. The first reference phase value of the cycle, The current sensor The difference phase value of the cycle, For the The difference signal of the period, The current sensor The frequency value of the cycle, , is the number of cycles, is pi.

3. The current sensor based on differential demodulation and PID feedback control according to claim 1, characterized in that: The specific steps to obtain the current change signal of each cycle of the current sensor are as follows: The difference signal of each cycle of the current sensor is analyzed by combining the Fourier transform method to obtain several frequency components of each cycle of the current sensor; and extracting and processing each frequency component of each cycle of the current sensor to obtain a signal frequency value corresponding to each frequency component of each cycle of the current sensor; Obtaining the cutoff frequency of the frequency signal of each cycle of the current sensor and establishing a frequency response function; The signal frequency value and frequency response function corresponding to each frequency component of the difference signal of each cycle of the current sensor are comprehensively analyzed by combining the inverse Fourier transform method to obtain the current change signal of each cycle of the current sensor.

4. The current sensor based on differential demodulation and PID feedback control according to claim 1, characterized in that: The specific steps for obtaining the current control index of the current sensor in the current cycle are as follows: Performing comprehensive analysis on the current signal of each cycle of the current sensor to obtain the output current value of each cycle of the current sensor; Establishing a current error function of the current sensor based on the output current value of each cycle of the current sensor and a preset target current value, and obtaining a critical gain and a cycle length of the current sensor; Analyze the critical gain and cycle duration of the current sensor to obtain the proportional reference coefficient, integral reference coefficient, and differential reference coefficient of the current sensor; The proportional reference coefficient, integral reference coefficient, differential reference coefficient, and current error function of the current sensor are adjusted and analyzed to obtain a current control index of the current sensor in the current cycle.

5. The current sensor based on differential demodulation and PID feedback control according to claim 4, characterized in that: The specific formula for calculating the current control index of the current sensor in the current cycle is as follows: ;in, The current sensor The proportional gain exponent of the cycle, is the proportional reference coefficient of the current sensor, is the integral reference coefficient of the current sensor, is the differential reference coefficient of the current sensor, , is the number of cycles.

6. The current sensor based on differential demodulation and PID feedback control according to claim 4, characterized in that: The specific steps to obtain the output current value of each cycle of the current sensor are as follows: Reading the initial voltage amplitude of the initial voltage signal of each cycle of the current sensor, marking it as the voltage change value of each cycle of the current sensor, and obtaining the sensitivity coefficient and initial current value of the current sensor; The voltage change value of each cycle of the current sensor is analyzed with the sensitivity coefficient to obtain the output current change value of each cycle of the current sensor, and the current change function of the current sensor is established; The initial current value and current variation function of the current sensor are comprehensively analyzed to obtain the output current value of each cycle of the current sensor.

7. An environmental compensation method for a current sensor based on differential demodulation and PID feedback control, applying the current sensor based on differential demodulation and PID feedback control according to any one of claims 1 to 6, characterized in that: The following steps are involved: Acquire environmental data of the current sensor in the current cycle, wherein the environmental data specifically includes temperature, humidity, magnetic field strength, and electromagnetic interference, and acquire a temperature reference value, a humidity reference value, and a magnetic field strength reference value of the current sensor; Standardize the temperature reference value, humidity reference value, magnetic field strength reference value of the current sensor and the temperature value, humidity value, magnetic field strength value, and electromagnetic interference value of the current cycle; Comprehensively analyze the standardized current sensor temperature reference value, humidity reference value, magnetic field strength reference value, and the temperature value, humidity value, magnetic field strength value, and electromagnetic interference value of the current cycle to obtain the environmental compensation index of the current sensor in the current cycle; The environmental compensation coefficient and the current control index of the current sensor in the current cycle are comprehensively analyzed to obtain the current correction control index of the current sensor in the current cycle.

8. The environmental compensation method for a current sensor based on differential demodulation and PID feedback control according to claim 7, characterized in that: The specific formula for calculating the environmental compensation index and current correction control index of each cycle of the current sensor is as follows: ;in, is the ambient compensation index of the current sensor's current cycle, is the temperature value of the current sensor in the current cycle after normalization, is the temperature reference value of the current sensor after normalization, is the temperature coefficient of the current sensor stored in the database, is the humidity value of the current sensor in the current cycle after normalization, is the humidity reference value of the current sensor after standardization, is the humidity coefficient of the current sensor stored in the database, is the humidity value and magnetic field strength value of the current sensor in the current cycle after normalization. is the reference value of the magnetic field strength of the current sensor after standardization, is the magnetic field coefficient of the current sensor stored in the database, is the electromagnetic interference value of the current sensor in the current cycle after normalization, is the interference coefficient of the current sensor stored in the database, , is the current correction control index of the current sensor in the current cycle, is the current control index of the current sensor in the current cycle, is the number of cycles, is a natural constant.

Citation Information

Patent Citations

  • A Hall current sensor with temperature compensation and temperature compensation method thereof

    CN110687347B

  • High-resolution wide-range magnetic modulation type direct current sensor based on differential demodulation

    CN115684701A