High-precision magnetic flux compensation type sensor and working method thereof

By using a high-precision flux compensation sensor, combined with a dual closed-loop feedback control system and FFT harmonic solution, the accuracy and range issues of traditional magnetic field measurement sensors are resolved, achieving high-precision, low-power magnetic field measurement suitable for applications in multiple fields.

CN120686163APending Publication Date: 2025-09-23YANTAI KAILIDA INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510888467.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

Existing magnetic field measurement sensors have problems such as low sensitivity, significant temperature drift, high cost, large size, high power consumption, slow response and short detection distance, and cannot meet the needs of high precision and wide application.

Method used

A high-precision flux compensation sensor is used, including a single-axis high-precision integrated fluxgate sensor acquisition module and a dual closed-loop feedback control system. It is combined with a compensation coil, sampling coil, integrator, differential driver, PID controller, temperature sensor and lock-in amplifier. Noise suppression and temperature compensation are performed through the FFT harmonic solution unit to achieve high-precision measurement of the magnetic field.

Benefits of technology

It achieves high-precision magnetic field measurement with reduced volume and power consumption. It is suitable for geomagnetic monitoring, industrial non-destructive testing and biomagnetic signal measurement. It eliminates temperature drift and expands the linear measurement range.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120686163A_ABST
    Figure CN120686163A_ABST
Patent Text Reader

Abstract

The invention discloses a high-precision magnetic flux compensation type sensor and a working method thereof. The sensor comprises a single-axis high-precision integrated fluxgate sensor acquisition module and a double-closed-loop feedback control system. The single-axis high-precision integrated fluxgate sensor acquisition module comprises a compensation coil L1, a sampling coil L2, an integrator, a differential driver RC1, a PID controller U1, a temperature sensor, an excitation coil and a lock-in amplifier COMP. Through three-in-one of fluxgate sensing, electromagnetic compensation and single-chip integration, the precision and the range break through physical limits, the size and the power consumption are obviously reduced, in addition, noise suppression is carried out through FFT harmonic calculation, and through arrangement of a PT1000 platinum resistor, temperature drift can be effectively eliminated, and the reliability of the temperature sensor is improved. The device is suitable for the fields of geomagnetic monitoring, industrial nondestructive testing, biological magnetic signal measurement and the like, and meets the use requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of magnetic field measurement, and in particular to a high-precision magnetic flux compensation sensor and a working method thereof. Background Art

[0002] Traditional magnetic field measurement usually uses Hall sensors, magnetoresistive sensors, fluxgate sensors or inductance / eddy current sensors for measurement. The above sensors have the following shortcomings during use: Hall sensors have low sensitivity (≥1mT) and obvious temperature drift, magnetoresistive sensors require magnetic shielding and are expensive, and fluxgate sensors are large in size, high in power consumption, and slow in response. Inductance / eddy current sensors are only suitable for dynamic magnetic fields and have a short detection distance. Taking into account the problems existing in the sensors of the existing technology, this application proposes a high-precision flux compensation sensor and its working method. Summary of the Invention

[0003] Based on the technical problems existing in the background technology, the present invention proposes a high-precision magnetic flux compensation sensor and a working method thereof.

[0004] The high-precision magnetic flux compensation sensor proposed in the present invention includes a single-axis high-precision integrated fluxgate sensor acquisition module and a dual closed-loop feedback control system;

[0005] The single-axis high-precision integrated fluxgate sensor acquisition module includes a compensation coil L1, a sampling coil L2, an integrator, a differential driver RC1, a PID controller U1, a temperature sensor, an excitation coil and a lock-in amplifier COMP;

[0006] The dual closed-loop feedback control system includes a physical layer magnetic flux loop and a digital control loop. The digital control loop includes an FFT harmonic solution unit. The compensation coil L1, the sampling coil L2 and the excitation coil are all part of the physical layer magnetic flux loop. The phase-locked amplifier COMP, the PID controller U1 and the temperature sensor are all part of the digital control loop.

[0007] Preferably, there are two integrators, namely integrator D1 and integrator D2. Pin 3 of integrator D1 is electrically connected to pin 1 of differential driver RC1, and pin 2 of differential driver RC1 is electrically connected to pin 3 of integrator D2. Pin 1 and pin 2 of integrator D1 are electrically connected to two ends of sampling coil L2, respectively. Pin 2 of integrator D2 is electrically connected to one end of resistor R4. Two ends of compensation coil L1 are electrically connected to pin 1 of integrator D2 and the other end of resistor R4, respectively. Pin 2 of integrator D2 is also electrically connected to one end of resistor R5. The other end of resistor R5 is electrically connected to pin 1 of lock-in amplifier COMP. Pin 1 of lock-in amplifier COMP is also electrically connected to one end of resistor R7. Pin 2 of lock-in amplifier COMP is electrically connected to one end of resistor R6. One end of resistor R6 is also electrically connected to one end of compensation coil L1. The other end of resistor R6 is electrically connected to pin 3 of lock-in amplifier COMP.

[0008] Preferably, the compensation coil L1 and sampling coil L2 use PCB planar windings to support a high-precision range of ±2mT. In closed-loop mode, the compensation coil L1 generates a reverse magnetic field, causing the magnetic core to operate in a "zero flux" state, eliminating geomagnetic interference. In open-loop mode, the compensation coil L1 provides a bias magnetic field, extending the linear measurement range to ±100mT.

[0009] Preferably, the temperature sensor is equipped with a built-in PT1000 platinum resistor, which monitors the temperature, corrects the parameters of the PID controller U1 in real time, compensates the current, and performs real-time temperature compensation.

[0010] Preferably, the integrator is used to convert the AC voltage signal induced by the sampling coil L2 into a DC voltage signal to facilitate subsequent digital processing. The integrator includes an operational amplifier, a resistor R1 and an integrating capacitor C1. The operational amplifier, the resistor R1 and the integrating capacitor C1 constitute an integrating circuit, and the resistor R1 is a thin film resistor. The output DC voltage V out Directly corresponding to the external magnetic field strength, the linear proportional relationship is as follows:

[0011]

[0012] Preferably, the differential driver RC1 is used to convert a single-ended signal into a differential signal, suppress common-mode interference, and improve the signal-to-noise ratio. It is composed of two operational amplifiers and resistors R2 and R3. The formula used during operation is:

[0013]

[0014] Preferably, the FFT harmonic solution unit is used to extract the second harmonic signal of the sampling coil L2 in real time and solve the external magnetic field strength. The FFT harmonic solution unit includes a 4th-order Butterworth low-pass filter and an ADC sampler. The specific logical steps of the FFT harmonic solution unit are as follows:

[0015] (1) Signal preprocessing: A 4th-order Butterworth low-pass filter is used for anti-aliasing filtering to limit the bandwidth and prevent high-frequency noise from aliasing, and an ADC sampler is used to digitize the time domain signal output by the sampling coil L2;

[0016] In addition, its input signal is: x(t) = A·sin(2ωt+φ)+noise, where ω is the excitation angular frequency, A and φ are the magnetic field related amplitude / phase;

[0017] (2) FFT calculation: Use Blackman-Harris window to perform windowing on the processed signal, and perform fixed-point FFT based on 2-FFT hardware accelerator to locate the second harmonic frequency point. The frequency resolution is also calculated using the formula:

[0018] (3) Harmonic parameter extraction: Amplitude calculation, phase solution and interpolation correction are performed. The formula used is as follows:

[0019] Amplitude calculation:

[0020] Phase solution:

[0021] Interpolation correction:

[0022] (4) Noise suppression and verification: perform neighborhood spectrum peak detection and check K target ±5 frequency points, confirm that there is no interference from stray peaks, and perform signal-to-noise ratio evaluation and harmonic distortion detection to calculate total harmonic distortion. The formula used is: If THD>1%, it will alarm that the core is saturated.

[0023] The present invention also proposes a working method of a high-precision magnetic flux compensation sensor, comprising the following steps:

[0024] S1: System initialization and parameter configuration: After the high-precision flux compensation sensor is powered on, the PID controller U1 is used to select the mode, set the excitation parameters, and perform temperature calibration. The modes include closed-loop zero flux mode and open-loop extended mode. The closed-loop zero flux mode is used for nT-level weak magnetic field measurements, and the open-loop extended mode is used for ±100mT strong magnetic field measurements. The excitation parameter setting configures the AC drive frequency of the excitation coil according to the selected mode, and simultaneously sets the target frequency of the FFT harmonic solution unit. During temperature calibration, the initial temperature value of the PT1000 platinum resistor is read and the temperature drift compensation coefficient stored in the EEPROM is loaded;

[0025] S2: Magnetic core excitation and magnetic field coupling: A high-frequency alternating current is passed through the excitation coil, driving the magnetic core to periodically switch between positive and negative saturation magnetic induction intensities. The external magnetic field to be measured is orthogonally coupled to the magnetic core, destroying the magnetic flux saturation symmetry. At the same time, the sampling coil L2 induces a voltage signal containing a second harmonic component.

[0026] S3: Signal acquisition and harmonic solution: The output signal of the sampling coil is filtered to suppress high-frequency noise, and the ADC sampler is used to digitize the sampling rate. At the same time, the sampled data is added with a Blackman-Harris window, and a radix 2-FFT is performed through a hardware accelerator to obtain the complex spectrum, locate the target frequency point, calculate the second harmonic amplitude and phase, and perform signal-to-noise ratio evaluation and harmonic distortion detection. The total harmonic distortion is calculated. If THD>1%, an alarm is issued for core saturation and a fault flag is output;

[0027] S4: Closed-loop feedback control: The temperature sensor reads the temperature in real time, and the PID controller U1 generates a compensation current instruction based on the real-time temperature, driving the compensation coil L1 to generate a reverse magnetic field. At the same time, the temperature sensor dynamically corrects the current value;

[0028] S5: Output calibration: The differential driver RC1 converts the compensated magnetic field strength into a 0–5V voltage signal, which is linearly proportional to the ±2mT magnetic field. At the same time, the digital interface (SPI / I 2 C) Outputs the compensated magnetic field strength value. If the magnetic field strength value is greater than 1.8, it automatically switches to open-loop mode to prevent saturation. If the magnetic field strength value is less than 0.2, it switches back to closed-loop mode to restore high resolution.

[0029] Preferably, in S5, the steps for calculating the magnetic field strength value are as follows:

[0030] S501: Sampling the second harmonic voltage amplitude A induced by the coil and the external magnetic field B ext Satisfies: A=k·B ext , where k is the sensitivity coefficient, which is determined by the core material, number of coil turns, and excitation frequency, and A is the second harmonic amplitude output by the FFT solution;

[0031] S502: In closed-loop mode, the reverse magnetic field B generated by the compensation coil comp Completely offset B ext , at this time B ext =—B comp , and the compensation magnetic field B comp By current I comp Generate, B comp =β·I comp , β is the compensation coil conversion coefficient, which is determined by the number of coil turns and magnetic circuit structure, I comp It is the compensation current output by PID controller U1;

[0032] S503: PID controller U1 continuously adjusts I comp Set A to 0 and dynamically correct the β value according to the temperature of the PT1000 platinum resistor: β(T) = β0 [1 + γ(T-T0)], where γ is the coil temperature drift coefficient.

[0033] S504: Apply a fixed bias current I through the compensation coil bias :

[0034] Compared with the existing technology, the beneficial effects of the present invention are:

[0035] The present invention achieves breakthroughs in accuracy and range through the integration of fluxgate sensing, electromagnetic compensation, and single-chip integration, significantly reducing volume and power consumption. Furthermore, noise is suppressed through FFT harmonic solution, and temperature drift can be effectively eliminated through the setting of a PT1000 platinum resistor. This makes the device suitable for geomagnetic monitoring, industrial nondestructive testing, and biomagnetic signal measurement, meeting all application requirements. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 This is a block diagram of the high-precision magnetic flux compensation sensor proposed in the present invention;

[0037] Figure 2 This is a circuit diagram of the fluxgate sensor integrated into the high-precision flux compensation sensor proposed by the present invention;

[0038] Figure 3 This is a flow chart of the working method of the high-precision magnetic flux compensation sensor proposed by the present invention. DETAILED DESCRIPTION

[0039] The present invention will be further explained below with reference to specific embodiments.

[0040] Example

[0041] Reference Figure 1-3,This embodiment proposes a high-precision flux compensation sensor, including a single-axis high-precision integrated fluxgate sensor acquisition module and a dual closed-loop feedback control system;

[0042] The single-axis high-precision integrated fluxgate sensor acquisition module includes a compensation coil L1, a sampling coil L2, an integrator, a differential driver RC1, a PID controller U1, a temperature sensor, an excitation coil, and a lock-in amplifier COMP. The compensation coil L1 and sampling coil L2 use PCB planar windings to support a high-precision measurement range of ±2mT. In closed-loop mode, the compensation coil L1 generates a reverse magnetic field, causing the magnetic core to operate in a "zero flux" state, eliminating geomagnetic interference. In open-loop mode, the compensation coil L1 provides a bias magnetic field, extending the linear measurement range to ±100mT. The temperature sensor has a built-in PT1000 platinum resistor, which monitors temperature, corrects the PID controller U1 parameters in real time, and compensates for current, providing real-time temperature compensation. The differential driver RC1 is used to convert single-ended signals into differential signals, suppress common-mode interference, and improve the signal-to-noise ratio. It consists of two operational amplifiers and resistors R2 and R3. The formula used during operation is:

[0043]

[0044] The integrator is used to convert the AC voltage signal induced by the sampling coil L2 into a DC voltage signal for subsequent digital processing. The integrator includes an operational amplifier, a resistor R1 and an integrating capacitor C1. The operational amplifier, the resistor R1 and the integrating capacitor C1 form an integrating circuit, and the resistor R1 is a thin film resistor. The output DC voltage V out Directly corresponding to the external magnetic field strength, the linear proportional relationship is as follows:

[0045]

[0046] The dual closed-loop feedback control system includes a physical layer magnetic flux loop and a digital control loop. The digital control loop includes an FFT harmonic solver. The compensation coil L1, sampling coil L2, and excitation coil are all part of the physical layer magnetic flux loop. The lock-in amplifier COMP, PID controller U1, and temperature sensor are all part of the digital control loop.

[0047] The FFT harmonic solution unit is used to extract the second harmonic signal of the sampling coil L2 in real time and solve the external magnetic field strength. The FFT harmonic solution unit includes a 4th-order Butterworth low-pass filter and an ADC sampler. The specific logical steps of the FFT harmonic solution unit are as follows:

[0048] (1) Signal preprocessing: A 4th-order Butterworth low-pass filter is used for anti-aliasing filtering to limit the bandwidth and prevent high-frequency noise from aliasing, and an ADC sampler is used to digitize the time domain signal output by the sampling coil L2;

[0049] In addition, its input signal is: x(t) = A·sin(2ωt+φ)+noise, where ω is the excitation angular frequency, A and φ are the magnetic field related amplitude / phase;

[0050] (2) FFT calculation: Use Blackman-Harris window to perform windowing on the processed signal, and perform fixed-point FFT based on 2-FFT hardware accelerator to locate the second harmonic frequency point. The frequency resolution is also calculated using the formula:

[0051] (3) Harmonic parameter extraction: Amplitude calculation, phase solution and interpolation correction are performed. The formula used is as follows:

[0052] Amplitude calculation:

[0053] Phase solution:

[0054] Interpolation correction:

[0055] (4) Noise suppression and verification: perform neighborhood spectrum peak detection and check K target ±5 frequency points, confirm that there is no interference from stray peaks, and perform signal-to-noise ratio evaluation and harmonic distortion detection to calculate total harmonic distortion. The formula used is: If THD>1%, the alarm will be core saturation;

[0056] There are two integrators, namely integrator D1 and integrator D2. Pin 3 of integrator D1 is electrically connected to pin 1 of differential driver RC1, and pin 2 of differential driver RC1 is electrically connected to pin 3 of integrator D2. Pin 1 and pin 2 of integrator D1 are electrically connected to two ends of sampling coil L2, respectively. Pin 2 of integrator D2 is electrically connected to one end of resistor R4. Two ends of compensation coil L1 are electrically connected to pin 1 of integrator D2 and the other end of resistor R4, respectively. Pin 2 of integrator D2 is also electrically connected to one end of resistor R5. The other end of resistor R5 is electrically connected to pin 1 of lock-in amplifier COMP. Pin 1 of lock-in amplifier COMP is also electrically connected to one end of resistor R7. Pin 2 of lock-in amplifier COMP is electrically connected to one end of resistor R6. One end of resistor R6 is also electrically connected to one end of compensation coil L1. The other end of resistor R6 is electrically connected to pin 3 of lock-in amplifier COMP.

[0057] This embodiment also provides a working method of a high-precision magnetic flux compensation sensor, comprising the following steps:

[0058] S1: System initialization and parameter configuration: After the high-precision flux compensation sensor is powered on, the PID controller U1 is used to select the mode, set the excitation parameters, and perform temperature calibration. The modes include closed-loop zero flux mode and open-loop extended mode. The closed-loop zero flux mode is used for nT-level weak magnetic field measurements, and the open-loop extended mode is used for ±100mT strong magnetic field measurements. The excitation parameter setting configures the AC drive frequency of the excitation coil according to the selected mode, and simultaneously sets the target frequency of the FFT harmonic solution unit. During temperature calibration, the initial temperature value of the PT1000 platinum resistor is read and the temperature drift compensation coefficient stored in the EEPROM is loaded;

[0059] S2: Magnetic core excitation and magnetic field coupling: A high-frequency alternating current is passed through the excitation coil, driving the magnetic core to periodically switch between positive and negative saturation magnetic induction intensities. The external magnetic field to be measured is orthogonally coupled to the magnetic core, destroying the magnetic flux saturation symmetry. At the same time, the sampling coil L2 induces a voltage signal containing a second harmonic component.

[0060] S3: Signal acquisition and harmonic solution: The output signal of the sampling coil is filtered to suppress high-frequency noise, and the ADC sampler is used to digitize the sampling rate. At the same time, the sampled data is added with a Blackman-Harris window, and a radix 2-FFT is performed through a hardware accelerator to obtain the complex spectrum, locate the target frequency point, calculate the second harmonic amplitude and phase, and perform signal-to-noise ratio evaluation and harmonic distortion detection. The total harmonic distortion is calculated. If THD>1%, an alarm is issued for core saturation and a fault flag is output;

[0061] S4: Closed-loop feedback control: The temperature sensor reads the temperature in real time, and the PID controller U1 generates a compensation current instruction based on the real-time temperature, driving the compensation coil L1 to generate a reverse magnetic field. At the same time, the temperature sensor dynamically corrects the current value;

[0062] S5: Output calibration: The differential driver RC1 converts the compensated magnetic field strength into a 0–5V voltage signal, which is linearly proportional to the ±2mT magnetic field. At the same time, the digital interface (SPI / I 2 C) Output the compensated magnetic field strength value. If the magnetic field strength value is greater than 1.8, it automatically switches to open-loop mode to prevent saturation. If the magnetic field strength value is less than 0.2, it switches back to closed-loop mode to restore high resolution.

[0063] The calculation steps of the magnetic field strength value are as follows:

[0064] S501: Sampling the second harmonic voltage amplitude A induced by the coil and the external magnetic field B ext Satisfies: A=k·B ext , where k is the sensitivity coefficient, which is determined by the core material, number of coil turns, and excitation frequency, and A is the second harmonic amplitude output by the FFT solution;

[0065] S502: In closed-loop mode, the reverse magnetic field B generated by the compensation coil comp Completely offset B ext , at this time B ext =—B comp , and the compensation magnetic field B comp By current I comp Generate, B comp =β·I comp , β is the compensation coil conversion coefficient, which is determined by the number of coil turns and magnetic circuit structure, I comp It is the compensation current output by PID controller U1;

[0066] S503: PID controller U1 continuously adjusts I comp Set A to 0 and dynamically correct the β value according to the temperature of the PT1000 platinum resistor: β(T) = β0 [1 + γ(T-T0)], where γ is the coil temperature drift coefficient.

[0067] S504: Apply a fixed bias current I through the compensation coil bias :

[0068] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solution and inventive concept of the present invention, should be covered by the scope of protection of the present invention.

Claims

1. High-precision magnetic flux compensation sensor, characterized in that: Includes a single-axis high-precision integrated fluxgate sensor acquisition module and a dual closed-loop feedback control system; The single-axis high-precision integrated fluxgate sensor acquisition module includes a compensation coil L1, a sampling coil L2, an integrator, a differential driver RC1, a PID controller U1, a temperature sensor, an excitation coil and a lock-in amplifier COMP; The dual closed-loop feedback control system includes a physical layer magnetic flux loop and a digital control loop. The digital control loop includes an FFT harmonic solution unit. The compensation coil L1, the sampling coil L2 and the excitation coil are all part of the physical layer magnetic flux loop. The phase-locked amplifier COMP, the PID controller U1 and the temperature sensor are all part of the digital control loop.

2. The high-precision magnetic flux compensation sensor according to claim 1, characterized in that: There are two integrators, namely integrator D1 and integrator D2. Pin 3 of integrator D1 is electrically connected to pin 1 of differential driver RC1, and pin 2 of differential driver RC1 is electrically connected to pin 3 of integrator D2. Pin 1 and pin 2 of integrator D1 are electrically connected to two ends of sampling coil L2, respectively. Pin 2 of integrator D2 is electrically connected to one end of resistor R4. Two ends of compensation coil L1 are electrically connected to pin 1 of integrator D2 and the other end of resistor R4, respectively. Pin 2 of integrator D2 is also electrically connected to one end of resistor R5. The other end of resistor R5 is electrically connected to pin 1 of lock-in amplifier COMP. Pin 1 of lock-in amplifier COMP is also electrically connected to one end of resistor R7. Pin 2 of lock-in amplifier COMP is electrically connected to one end of resistor R6. One end of resistor R6 is also electrically connected to one end of compensation coil L1. The other end of resistor R6 is electrically connected to pin 3 of lock-in amplifier COMP.

3. The high-precision magnetic flux compensation sensor according to claim 1, characterized in that: The compensation coil L1 and sampling coil L2 use PCB planar windings to support a high-precision measurement range of ±2mT. In closed-loop mode, the compensation coil L1 generates a reverse magnetic field, causing the magnetic core to operate in a "zero flux" state, eliminating geomagnetic interference. In open-loop mode, the compensation coil L1 provides a bias magnetic field, extending the linear measurement range to ±100mT.

4. The high-precision magnetic flux compensation sensor according to claim 1, characterized in that: The temperature sensor has a built-in PT1000 platinum resistor, which monitors the temperature, corrects the PID controller U1 parameters in real time, compensates the current, and performs real-time temperature compensation.

5. The high-precision magnetic flux compensation sensor according to claim 1, characterized in that: The integrator is used to convert the AC voltage signal induced by the sampling coil L2 into a DC voltage signal for subsequent digital processing. The integrator includes an operational amplifier, a resistor R1 and an integrating capacitor C1. The operational amplifier, the resistor R1 and the integrating capacitor C1 form an integrating circuit, and the resistor R1 is a thin film resistor. The output DC voltage V out Directly corresponding to the external magnetic field strength, the linear proportional relationship is as follows:

6. The high-precision magnetic flux compensation sensor according to claim 1, characterized in that: The differential driver RC1 is used to convert single-ended signals into differential signals, suppress common-mode interference, and improve the signal-to-noise ratio. It consists of two operational amplifiers and resistors R2 and R3. The formula used during operation is:

7. The high-precision magnetic flux compensation sensor according to claim 1, characterized in that: The FFT harmonic solution unit is used to extract the second harmonic signal of the sampling coil L2 in real time and solve the external magnetic field strength. The FFT harmonic solution unit includes a 4th-order Butterworth low-pass filter and an ADC sampler. The specific logical steps of the FFT harmonic solution unit are as follows: (1) Signal preprocessing: A 4th-order Butterworth low-pass filter is used for anti-aliasing filtering to limit the bandwidth and prevent high-frequency noise from aliasing, and an ADC sampler is used to digitize the time domain signal output by the sampling coil L2; In addition, its input signal is: x(t) = A·sin(2ωt+φ)+noise, where ω is the excitation angular frequency, A and φ are the magnetic field related amplitude / phase; (2) FFT calculation: Use Blackman-Harris window to perform windowing on the processed signal, and perform fixed-point FFT based on 2-FFT hardware accelerator to locate the second harmonic frequency point. The frequency resolution is also calculated using the formula: (3) Harmonic parameter extraction: Amplitude calculation, phase solution and interpolation correction are performed. The formula used is as follows: Amplitude calculation: Phase solution: Interpolation correction: (4) Noise suppression and verification: perform neighborhood spectrum peak detection and check K target ±5 frequency points, confirm that there is no interference from stray peaks, and perform signal-to-noise ratio evaluation and harmonic distortion detection to calculate total harmonic distortion. The formula used is: If THD>1%, it will alarm that the core is saturated.

8. The operating method of the high-precision magnetic flux compensation sensor according to any one of claims 1 to 7, characterized in that: The following steps are involved: S1: System initialization and parameter configuration: After the high-precision flux compensation sensor is powered on, the PID controller U1 is used to select the mode, set the excitation parameters, and perform temperature calibration. The modes include closed-loop zero flux mode and open-loop extended mode. The closed-loop zero flux mode is used for nT-level weak magnetic field measurements, and the open-loop extended mode is used for ±100mT strong magnetic field measurements. The excitation parameter setting configures the AC drive frequency of the excitation coil according to the selected mode, and simultaneously sets the target frequency of the FFT harmonic solution unit. During temperature calibration, the initial temperature value of the PT1000 platinum resistor is read and the temperature drift compensation coefficient stored in the EEPROM is loaded; S2: Magnetic core excitation and magnetic field coupling: A high-frequency alternating current is passed through the excitation coil, driving the magnetic core to periodically switch between positive and negative saturation magnetic induction intensities. The external magnetic field to be measured is orthogonally coupled to the magnetic core, destroying the magnetic flux saturation symmetry. At the same time, the sampling coil L2 induces a voltage signal containing a second harmonic component. S3: Signal acquisition and harmonic solution: The output signal of the sampling coil is filtered to suppress high-frequency noise, and the ADC sampler is used to digitize the sampling rate. At the same time, the sampled data is added with a Blackman-Harris window, and a radix 2-FFT is performed through a hardware accelerator to obtain the complex spectrum, locate the target frequency point, calculate the second harmonic amplitude and phase, and perform signal-to-noise ratio evaluation and harmonic distortion detection. The total harmonic distortion is calculated. If THD>1%, an alarm is issued for core saturation and a fault flag is output; S4: Closed-loop feedback control: The temperature sensor reads the temperature in real time, and the PID controller U1 generates a compensation current instruction based on the real-time temperature, driving the compensation coil L1 to generate a reverse magnetic field. At the same time, the temperature sensor dynamically corrects the current value; S5: Output calibration: The differential driver RC1 converts the compensated magnetic field strength into a 0–5V voltage signal, which is linearly proportional to the ±2mT magnetic field. At the same time, the digital interface (SPI / I 2 C) Outputs the compensated magnetic field strength value. If the magnetic field strength value is greater than 1.8, it automatically switches to open-loop mode to prevent saturation. If the magnetic field strength value is less than 0.2, it switches back to closed-loop mode to restore high resolution.

9. The operating method of the high-precision magnetic flux compensation sensor according to claim 8, characterized in that: In S5, the calculation steps of the magnetic field strength value are as follows: S501: Sampling the second harmonic voltage amplitude A induced by the coil and the external magnetic field B ext Satisfies: A=k·B ext , where k is the sensitivity coefficient, which is determined by the core material, number of coil turns, and excitation frequency, and A is the second harmonic amplitude output by the FFT solution; S502: In closed-loop mode, the reverse magnetic field B generated by the compensation coil comp Completely offset B ext , at this time B ext =—B comp , and the compensation magnetic field B comp By current I comp Generate, B comp =β·I comp , β is the compensation coil conversion coefficient, which is determined by the number of coil turns and magnetic circuit structure, I comp It is the compensation current output by PID controller U1; S503: PID controller U1 continuously adjusts I comp Set A to 0 and dynamically correct the β value according to the temperature of the PT1000 platinum resistor: β(T) = β0 [1 + γ(T-T0)], where γ is the coil temperature drift coefficient. S504: Apply a fixed bias current I through the compensation coil bias :