A dynamic threshold target detection system and method based on magnetic sensor

By introducing dynamic threshold and ellipsoid fitting algorithms into the magnetic sensor detection system, the problems of insufficient information and large environmental interference in the detection of ground magnetic targets in the prior art are solved, and more efficient and reliable magnetic target detection is achieved.

CN118330757BActive Publication Date: 2024-11-29HUBEI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410496917.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-24
Publication Date
2024-11-29
Estimated Expiration
2044-04-24

AI Technical Summary

Technical Problem

The prior art has problems such as insufficient information, large environmental interference and high misjudgment rate when detecting ground magnetic targets. Especially when harsh environments or target conditions are not in line with, the detection effect is poor.

Method used

Using a dynamic threshold target detection system based on magnetic sensors, combined with the signal processing, ellipsoid fitting algorithm and dynamic threshold algorithm of operational amplifiers, amplification, denoising, fitting and threshold adjustment of magnetic field signals is realized, and the accuracy of detection is improved. reliability.

Benefits of technology

The performance and reliability of magnetic target detection are significantly improved in complex environments, and the rapid and non-contact detection of the target is achieved, reducing the misjudgment rate and the impact of environmental interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118330757B_ABST
    Figure CN118330757B_ABST
Patent Text Reader

Abstract

The present invention provides a dynamic threshold target detection system and method based on a magnetic sensor, including: a magnetic sensor module for collecting a three-axis magnetic field analog signal of a test environment based on the Hall effect; a signal processing module for amplifying and high-frequency denoising the three-axis magnetic field analog signal to obtain a processed three-axis magnetic field analog signal; an analog-to-digital conversion module for converting the processed three-axis magnetic field analog signal into a three-axis magnetic field digital signal; a signal fitting module for fitting the three-axis magnetic field digital signal based on an ellipsoid fitting algorithm to obtain a fitting signal; a threshold detection module for adjusting the threshold of the fitting signal change based on a dynamic threshold algorithm, and detecting abnormal signals based on the threshold to obtain a detection result. The present invention can detect any irregularly shaped magnetic target to be tested, is adaptable to a variety of environments, and has high measurement accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of magnetic sensor detection, and in particular relates to a dynamic threshold target detection system and method based on a magnetic sensor. Background Art

[0002] Nowadays, the detection of ground targets (armored vehicles, tanks, mines, magnetic equipment, etc.) can be achieved with the help of radar, infrared sensors, machine learning, magnetic field imaging and other means. Such methods are often used as a means of security and national defense, geological exploration and resource exploration, environmental monitoring, land use planning, archaeology and cultural relics protection, etc., and are specifically used in mine detection, underground mineral detection, geological disaster warning, cultural relics detection and other aspects.

[0003] On the one hand, conventional means have some defects in detecting magnetic targets. For example, radar is usually used for the reflection and reception of electromagnetic waves, and may not provide sufficient information for some ground magnetic targets. In particular, for small, low-reflectivity or highly concealed targets, the detection effect of radar may be limited; infrared sensors are usually used to detect the heat radiation of targets, while ground magnetic targets usually do not produce obvious heat radiation. If the ambient temperature is high during detection, it will affect the detection ability of the target; laser mainly relies on the reflection or scattering characteristics of the target surface when detecting targets. If the material or shape of the target surface and the turbid air and atmospheric conditions in the environment have a great impact on the reflection or scattering of the laser, resulting in instability or inaccuracy of the detection results; machine learning models may not be able to accurately identify and classify ground magnetic targets when there is insufficient or insufficient training data. In addition, if the training data is not representative enough or there are deviations, it will also affect the performance of the model. Magnetic field imaging technology is greatly affected by the ground structure. For example, the complexity of ground rocks, water flow and other factors may cause interference or confusion of magnetic field signals, thereby affecting the accurate detection of magnetic targets. This type of traditional method has a large attenuation coefficient in harsh environments or when the conditions of the target itself are not met, and the positioning measurement range is small and the measurement accuracy is low.

[0004] On the other hand, positioning methods based on laser, radar, etc. are all active measurements. Such methods are not easy to hide the position of the receiver, and are easy to expose the position, which is not suitable for important military applications. In addition, general magnetic sensor detection devices do not use dynamic threshold algorithms. When detecting target objects, the magnetic field strength may suddenly exceed the set threshold due to environmental interference, and cannot adapt to a variety of environments, resulting in misjudgment events; or because the ellipsoid fitting algorithm is not used, the data observation is not particularly obvious and inconsistent, which affects human-computer interaction. Summary of the invention

[0005] In view of the shortcomings of the prior art, the present invention provides a dynamic threshold target detection system and method based on a magnetic sensor. The present invention adopts a signal processing circuit based on an operational amplifier and an algorithm based on ellipsoid fitting and dynamic threshold, which greatly enhances the magnetic target detection capability of the device, enables it to exhibit better performance and reliability in complex environments, and can achieve rapid and non-contact detection of targets.

[0006] To achieve the above object, the present invention provides the following solutions:

[0007] A dynamic threshold target detection system based on a magnetic sensor, comprising:

[0008] The magnetic sensor module is used to collect the three-axis magnetic field simulation signal of the environment to be tested based on the Hall effect. When the system is started, the system is manually rotated 360°, and the magnetic sensor module is used to collect the surrounding three-axis magnetic field simulation signal. A total of 500 sets of data are collected, and the collection process takes 8 seconds. The three-axis magnetic field simulation signal collected by the magnetic sensor module is used for the ellipsoid fitting process. The three-axis magnetic field simulation signal of the environment to be tested is also collected during the rest of the time.

[0009] A signal processing module, used for amplifying and removing high-frequency noise from the three-axis magnetic field simulation signal to obtain the processed three-axis magnetic field simulation signal;

[0010] An analog-to-digital conversion module, used for converting the processed three-axis magnetic field analog signal into a three-axis magnetic field digital signal;

[0011] A signal fitting module is used to fit the three-axis magnetic field digital signal collected by the system through 360° rotation based on an ellipsoid fitting algorithm to obtain a fitting signal;

[0012] A threshold detection module, used to adjust the threshold of the fitting signal change based on a dynamic threshold algorithm, and detect abnormal signals based on the threshold to obtain a detection result;

[0013] The display module is used to display and store the detection results to complete dynamic threshold target detection based on the magnetic sensor.

[0014] Preferably, the magnetic sensor module adopts HMC1043 magnetic sensor, including three Wheatstone bridges made of nickel-iron alloy;

[0015] The working principle of the HMC1043 magnetic sensor is as follows: when the HMC1043 magnetic sensor is in a changing external magnetic field, the resistance value of the Wheatstone bridge changes, a differential voltage value is output at the measuring end of the Wheatstone bridge, and based on the differential voltage value, the change in the relative value of the external magnetic field in the direction of the resistance of the Wheatstone bridge is obtained;

[0016] The Hall effect is that when a conductor with current flowing through it is in a magnetic field, a voltage difference is generated on both sides of the conductor. The voltage difference is called the Hall voltage, and the Hall voltage is proportional to the strength of the magnetic field.

[0017] Preferably, the signal processing module includes a first operational amplifier and a second operational amplifier;

[0018] The first operational amplifier is used to amplify the three-axis magnetic field analog signal;

[0019] The second operational amplifier is used to construct a high-speed filter to filter out noise and interference reaching a preset frequency in the amplified three-axis magnetic field analog signal;

[0020] The x, y, and z axis data from the magnetic sensor are respectively passed through the first operational amplifier and the second operational amplifier, that is, there are three first operational amplifiers and three second operational amplifiers, wherein the output of the first operational amplifier is connected to the input of the second operational amplifier.

[0021] Preferably, the signal fitting module includes:

[0022] A matrix creation unit is used to create an augmented matrix with 6 rows and 7 columns whose coefficients are all zero;

[0023] A signal import unit, used for importing the three-axis magnetic field digital signal into the augmented matrix to obtain a least squares matrix;

[0024] A principal element selection unit, used for selecting the element with the largest absolute value in each column of the least squares matrix as the principal element;

[0025] An elimination unit, used for adding multiples of the row where the main element is located to subsequent rows, so that the elements below the column where the main element is located become zero, and repeating the elimination until all columns are processed;

[0026] A normalization unit, used for dividing the row where the principal element is located by the value of the principal element based on the matrix after elimination, so that the first coefficient of each row where the principal element is located becomes 1, and obtaining a principal element normalized matrix;

[0027] The back-substitution solving unit is used to start from the last row of the principal element normalization matrix, sequentially back-substitution solve the unknowns to obtain the ellipsoid equation, and fit the three-axis magnetic field digital signal based on the ellipsoid equation to obtain a fitting signal.

[0028] Preferably, the threshold detection module includes:

[0029] Initialization unit, used to initialize threshold, data index, number of collected data groups and other related parameters;

[0030] A data acquisition unit, used for storing the fitting signal into a buffer data group for data processing and obtaining a threshold reference;

[0031] A threshold calculation unit, configured to calculate a maximum value and a minimum value of the data with index 0 in the buffer data group, and to sum and average the data in the buffer data group to obtain a new threshold reference; and to obtain a maximum deviation value based on the maximum value, the minimum value and the new threshold reference;

[0032] The threshold judgment unit is used to compare the maximum deviation value with the initialized threshold value, detect abnormal signals, and obtain detection results.

[0033] A dynamic threshold target detection method based on a magnetic sensor, using the system, comprises the following steps:

[0034] The three-axis magnetic field simulation signal of the test environment is collected based on the Hall effect. When the system is started, the system is manually rotated 360°, and the magnetic sensor module is used to collect the surrounding three-axis magnetic field simulation signal. A total of 500 sets of data are collected, and the collection process takes 8 seconds. The three-axis magnetic field simulation signal collected by the magnetic sensor module is used for the ellipsoid fitting process. The three-axis magnetic field simulation signal of the test environment is also collected during the rest of the time.

[0035] Amplifying and high-frequency denoising the three-axis magnetic field simulation signal to obtain the processed three-axis magnetic field simulation signal;

[0036] Converting the processed three-axis magnetic field analog signal into a three-axis magnetic field digital signal;

[0037] Fitting the three-axis magnetic field digital signal collected by the system through 360° rotation based on an ellipsoid fitting algorithm to obtain a fitting signal;

[0038] Based on a dynamic threshold algorithm, adjusting the threshold of the fitting signal change, and based on the threshold, detecting abnormal signals to obtain a detection result;

[0039] The detection results are displayed and stored to complete dynamic threshold target detection based on the magnetic sensor.

[0040] Preferably, the three-axis magnetic field digital signal is fitted based on an ellipsoid fitting algorithm, and a method for obtaining a fitting signal is as follows:

[0041] Create an augmented matrix with 6 rows and 7 columns whose coefficients are all zero;

[0042] Importing the three-axis magnetic field digital signal into an augmented matrix to obtain a least squares matrix;

[0043] Selecting the element with the largest absolute value in each column of the least squares matrix as the principal element;

[0044] Add multiples of the row where the main element is located to subsequent rows, so that the elements below the column where the main element is located become zero, and repeat the elimination until all columns have been processed;

[0045] Based on the matrix after elimination, the row where the principal element is located is divided by the value of the principal element, so that the first coefficient of each row where the principal element is located becomes 1, and a pivot normalized matrix is ​​obtained;

[0046] Starting from the last row of the principal element normalization matrix, back-substitution is performed in sequence to solve the unknown variables to obtain the ellipsoid equation, and the three-axis magnetic field digital signal is fitted based on the ellipsoid equation to obtain a fitting signal.

[0047] Preferably, based on a dynamic threshold algorithm, the threshold of the fitting signal change is adjusted, and based on the threshold, an abnormal signal is detected, and a method for obtaining a detection result is:

[0048] Initialize threshold, data index, number of collected data sets and other related parameters;

[0049] Storing the fitting signal in a buffer data group for data processing and obtaining a threshold reference;

[0050] Calculating the maximum value and the minimum value of the data with index 0 in the buffer data group, and summing and averaging the data in the buffer data group to obtain a new threshold reference; obtaining a maximum deviation value based on the maximum value, the minimum value and the new threshold reference;

[0051] The maximum deviation value is compared with the initialized threshold value to detect abnormal signals and obtain a detection result.

[0052] Compared with the prior art, the beneficial effects of the present invention are as follows: a magnetic sensor module is used to collect the three-axis magnetic field simulation signal of the environment to be tested based on the Hall effect; wherein, when the system is started, the system is manually rotated 360°, and the magnetic sensor module is used to collect the surrounding three-axis magnetic field simulation signal, and a total of 500 sets of data are collected, and the collection process takes 8 seconds. The three-axis magnetic field simulation signal collected by the magnetic sensor module is used for the ellipsoid fitting process; the three-axis magnetic field simulation signal of the environment to be tested is also collected during the rest of the time. A signal processing module is used to amplify and perform high-frequency denoising on the three-axis magnetic field simulation signal to obtain the processed three-axis magnetic field simulation signal; the signal processing circuit in this system can amplify weak signals and eliminate high-frequency noise signals in the magnetic signal brought by the surrounding environment, thereby improving the device's anti-interference ability and signal processing ability. The analog-to-digital conversion module is used to convert the processed three-axis magnetic field analog signal into a three-axis magnetic field digital signal; the signal fitting module is used to fit the three-axis magnetic field digital signal collected by the system by 360° rotation based on the ellipsoid fitting algorithm to obtain the fitting signal; the system can effectively separate the target signal from the background noise by fitting the three-axis data of the magnetic sensor, thereby reducing the impact of background interference on the detection result, making the detection result clearer and more reliable. The threshold detection module is used to adjust the threshold of the fitting signal change based on the dynamic threshold algorithm, and detect abnormal signals based on the threshold to obtain the detection result; the system uses the dynamic threshold algorithm to dynamically adjust according to the real-time environmental conditions and signal characteristics, so that the device can adapt to different environmental conditions in time, and the dynamic threshold can adjust the detection sensitivity according to the actual situation, so that the device can achieve the best detection effect in different scenarios. In the case of weak surrounding magnetic field or large noise, the threshold can be reduced to improve the sensitivity, and in the case of strong surrounding magnetic field or small noise, the threshold can be increased to reduce the false alarm rate; the display module is used to display and store the detection results, and complete the dynamic threshold target detection based on the magnetic sensor. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solution of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0054] Figure 1 A schematic diagram of the structure of a dynamic threshold target detection system based on a magnetic sensor provided by the present invention, wherein Figure (a) is a left view of the upper and lower plates, and Figure (b) is a top view of the upper and lower plates;

[0055] Figure 2 A framework diagram of a dynamic threshold target detection system based on a magnetic sensor provided by the present invention;

[0056] Figure 3 A data waveform diagram of an abnormal signal state of a dynamic threshold target detection system based on a magnetic sensor provided by the present invention;

[0057] Figure 4 The waveform diagram of the ellipsoid fitting output data of the dynamic threshold target detection system based on the magnetic sensor provided by the present invention in a normal magnetic field environment;

[0058] Figure 5 A waveform diagram of the dynamic threshold target detection system based on the magnetic sensor provided by the present invention, in which the ellipsoid fitting output data and the abnormal signal state data are compared side by side under a normal magnetic field environment;

[0059] Figure 6 This is a waveform diagram of the ellipsoid fitting output data of the dynamic threshold target detection device based on the magnetic sensor provided by the present invention when the magnetic field environment is strong.

[0060] Figure 7 A waveform diagram of the dynamic threshold target detection system based on the magnetic sensor provided by the present invention, in which the ellipsoid fitting output data and the abnormal signal state data are compared side by side when the magnetic field environment is strong;

[0061] Figure 8 The present invention provides a waveform diagram of the ellipsoid fitting output data of the dynamic threshold target detection system based on the magnetic sensor when the magnetic field environment is weak.

[0062] Fig. 9 The present invention provides a dynamic threshold target detection system based on a magnetic sensor, which compares ellipsoid fitting output data and abnormal signal status data in parallel when the magnetic field environment is weak. DETAILED DESCRIPTION

[0063] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0064] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0065] Embodiment 1

[0066] like Figure 1 , Figure 2As shown in the figure, a dynamic threshold target detection system based on magnetic sensor is designed. In order to meet the requirements of small size, easy placement and strong anti-interference ability, the device is designed with upper and lower PCB stacking design, using pin headers to communicate signals between the upper and lower boards and provide power, and using three studs to connect and reinforce the upper and lower boards. Specifically including:

[0067] The magnetic sensor module is used to collect the X, Y, and Z three-axis magnetic field simulation signals of the environment to be tested based on the Hall effect; when the system is started, the system is manually rotated 360°, and the magnetic sensor module is used to collect the surrounding three-axis magnetic field simulation signals, and a total of 500 sets of data are collected. The collection process takes 8 seconds. The three-axis magnetic field simulation signals collected by the magnetic sensor module are used for the ellipsoid fitting process; the three-axis magnetic field simulation signals of the environment to be tested are also collected at the rest of the time. In this embodiment, the time of rotation collection is determined according to the sampling rate, not the preset time.

[0068] A further embodiment is that the magnetic sensor module uses a HMC1043 magnetic sensor and includes three Wheatstone bridges made of nickel-iron alloy;

[0069] The working principle of the HMC1043 magnetic sensor is: when the HMC1043 magnetic sensor is in a changing external magnetic field, the resistance value of the Wheatstone bridge changes, and a differential voltage value is output at the measuring end of the Wheatstone bridge. Based on the differential voltage value, the change in the relative value of the external magnetic field in the direction of the Wheatstone bridge resistance is obtained; it is a small 3-axis surface-mounted sensor sequence system suitable for low-field magnetic sensing, using Honeywell anisotropic magnetoresistive (AMR) technology, and has advantages over coil-type magnetic sensors. This sensor is an extremely sensitive low-field, solid-state magnetic sensor with a very small size, which is suitable for the requirement of small device size.

[0070] The Hall effect is that when a conductor with current passing through it is in a magnetic field, a voltage difference is generated on both sides of the conductor. The voltage difference is called the Hall voltage, and the Hall voltage is proportional to the magnetic field strength.

[0071] A signal processing module is used to amplify and remove high-frequency noise from the three-axis magnetic field simulation signal to obtain a processed three-axis magnetic field simulation signal;

[0072] A further implementation is that the signal processing module includes a first operational amplifier and a second operational amplifier, and also includes some resistors and capacitors.

[0073] The first operational amplifier is used to amplify the three-axis magnetic field analog signal. In this embodiment, the AD8421ARZ operational amplifier is used. The AD8421ARZ is a high-precision, low-noise operational amplifier. Since the voltage signal output by the HMC1043 magnetoresistive sensor is relatively weak, it is necessary to use it to amplify the weak signal.

[0074] The second operational amplifier is used to construct a high-speed filter to filter out noise and interference reaching a preset frequency in the amplified three-axis magnetic field analog signal. In this embodiment, an OPA690ID operational amplifier is used. OPA690ID is a high-speed, high-power operational amplifier. A high-speed filter is constructed using OPA690ID to filter out noise or interference of a specific frequency.

[0075] The x, y, and z axis data from the magnetic sensor are respectively passed through the first operational amplifier and the second operational amplifier, that is, there are three first operational amplifiers and three second operational amplifiers, wherein the output of the first operational amplifier is connected to the input of the second operational amplifier.

[0076] The analog-to-digital conversion module is used to convert the processed three-axis magnetic field analog signal into a three-axis magnetic field digital signal; the AD7606 chip of the analog-to-digital conversion module adopts an eight-channel, high-performance 16-bit analog-to-digital converter and uses a serial peripheral interface (SPI) for data transmission.

[0077] The signal fitting module is used to fit the three-axis magnetic field digital signal collected by the system through 360-degree rotation based on the ellipsoid fitting algorithm to obtain a fitting signal; so that the fitted data tends to 1 when the device is not disturbed by the magnetic field;

[0078] A further implementation is that the signal fitting module comprises:

[0079] A matrix creation unit is used to create an augmented matrix with 6 rows and 7 columns whose coefficients are all zero;

[0080] A signal import unit is used to import the three-axis magnetic field digital signals collected and processed during the rotation of 500 sets of devices into the augmented matrix (corresponding array) to obtain a least squares matrix;

[0081] A main element selection unit is used to select the element with the largest absolute value in each column of the least square matrix as the main element;

[0082] The elimination unit is used to add multiples of the row where the main element is located to the subsequent rows, so that the elements below the column where the main element is located become zero, and the elimination is repeated until all columns are processed;

[0083] A normalization unit is used to divide the row where the principal element is located by the value of the principal element based on the matrix after elimination, so that the first coefficient of each row where the principal element is located becomes 1, and obtain a principal element normalized matrix;

[0084] The back-substitution solving unit is used to start from the last row of the principal element normalization matrix, and sequentially back-substitute to solve the unknowns, obtain the ellipsoid equation, and fit the three-axis magnetic field digital signal based on the ellipsoid equation to obtain the fitting signal. Specifically, the six unknowns in the general form of the ellipsoid equation are solved, that is, the solution of the non-homogeneous linear equation system is solved, wherein the last row has been converted into a linear equation of one variable, and the solution of the unknown in the last row can be obtained by dividing the constant term by the coefficient of the unknown, and then the unknown in the last row is back-substituted into the linear equation of two variables in the penultimate row, and the solution of another unknown can be obtained in the same way, and the above operation is repeated until the first row is back-substituted, so as to obtain the solution of all the unknowns, and the general equation form of the ellipsoid equation can be obtained, and the standard equation of the ellipsoid is obtained based on the relationship between the standard equation of the ellipsoid and the general equation, and the three-axis magnetic field digital signal is fitted based on the standard equation of the ellipsoid to obtain the fitting signal.

[0085] The solution obtained in the previous step is used to obtain the ellipsoid equation X0, Y0, Z0, A, B, C, where X0, Y0, Z0 are the coordinates of the center of the ellipsoid, and A, B, C are the lengths of the three axes of the ellipsoid.

[0086] in:

[0087]

[0088] The steps for deriving the matrix of the least squares fitting method are as follows:

[0089] Rewriting the ellipsoid equation (1) in the general form (2),

[0090]

[0091] x 2 +ay 2 +bz 2 +cx+dy+ez+f=0 (2)

[0092] in: c=-2x0,

[0093] Find each sample point (x i ,y i , z i )’s error e(3) and error square sum (4), the sample point is the three-axis data of this sensor in this system;

[0094]

[0095]

[0096] The error sum of squares is calculated for the first-order partial derivative of a, b, c, d, e, and f, and set to 0, then:

[0097]

[0098] make:

[0099]

[0100] Substituting (6) into (5) and simplifying it, we can get the matrix form of the least squares method:

[0101] A threshold detection module is used to adjust the threshold of the fitting signal change based on the dynamic threshold algorithm, and detect abnormal signals based on the threshold to obtain the detection result;

[0102] In a further embodiment, the threshold detection module comprises:

[0103] Initialization unit, used to initialize the threshold (init_compare), data index (flag=0), number of collected data groups (buffer_num) and other related parameters;

[0104] The data acquisition unit is used to store the fitting signal into the buffer data group for data processing and obtain the threshold reference; in this embodiment, the data after the ellipsoid fitting is obtained, and the data is stored in the buffer array (buffer_flag) until the number of data reaches buffer_num-1, and then the data processing begins, wherein the first data is given to the threshold reference (state_buffer), i.e., the initial reference;

[0105] The threshold calculation unit is used to calculate the maximum value and the minimum value of the data with index 0 in the buffer data group, and sum and average the data in the buffer data group to obtain a new threshold reference; based on the maximum value, the minimum value and the new threshold reference, the maximum deviation value is obtained; in this embodiment, a for loop is used to obtain the maximum value (data_max) and the minimum value (data_min) of buffer_num-1 data with indexes from 0 to buffer_num-2 in the buffer array, and the data in the buffer array are summed and averaged to obtain a reference value (state_buffer), and then the deviations of the maximum value and the minimum value from the reference value are respectively calculated, and the sizes of the two deviations are compared to obtain the maximum deviation value (diff);

[0106] The threshold judgment unit is used to compare the maximum deviation value with the initialized threshold value, detect abnormal signals, and obtain detection results. If the maximum deviation value is greater than the threshold value, it means that the system has collected abnormal magnetic field data, so that subsequent processing can be carried out;

[0107] In particular, after the initial loop ends, the index (flag) is set to -1, that is, the element index of the buffer array (buffer_flag) changes from -1 to buffer_num-2 in the next loop, thereby obtaining buffer_num data, among which the data of the first array is not used in calculating the threshold, and mainly serves as a buffer.

[0108] The display module (host computer) is used to display and store the detection results and complete the dynamic threshold target detection based on the magnetic sensor.

[0109] In this embodiment, a dynamic threshold target detection system based on a magnetic sensor also includes a power supply module, a communication module, a voltage stabilizing circuit and various components. Specifically, the upper board mainly includes a magnetic sensor, a signal processing circuit (signal processing module) and a voltage stabilizing circuit, and the lower board mainly includes a microcontroller (signal fitting module, threshold detection module), an AD7606 chip, a power supply module, a voltage stabilizing circuit and various components. The design of arranging the magnetic sensor separately from other circuits is mainly to weaken the electromagnetic interference of the magnetic sensor due to its proximity to high-power, high-frequency circuits and the large amount of heat generated by the surrounding circuits, thereby reducing the performance damage or unstable output data caused by the above reasons. The Bluetooth communication module or USB-TTL can use the pin header led out of the lower board to connect the serial port, thereby realizing interaction with the host computer.

[0110] In summary, the core sensor of the system of the present invention is the HMC1043 weak magnetic sensor, whose measurement range is from micro-Gauss to 6 Gauss (gauss), and the package size of the magnetic sensor is 3mm in length, 3mm in width, and 1.4mm in height. The volume and power consumption of the entire device are further reduced, which is convenient for users to deploy in limited space and to easily integrate this small magnetic detection device into other devices or systems. The present invention uses a lithium-ion battery to power the device, and designs a voltage stabilizing circuit to protect each module; the signal processing circuit is used to eliminate the high-frequency noise signal brought by the surrounding environment in the magnetic signal; the AD conversion circuit (analog-to-digital conversion module) is used to convert the processed analog signal into a digital signal and then send it to the microprocessor for related processing; the algorithm mainly involves ellipsoid fitting and dynamic threshold, in which the ellipsoid fitting is used to fit the data of the three axes of the magnetic sensor into an optimal ellipsoidal surface model; the dynamic threshold algorithm can adaptively adjust the threshold according to the change of the signal; finally, the result is transmitted to the host computer through the serial port or wireless communication module for display and storage.

[0111] Embodiment 2

[0112] A dynamic threshold target detection method based on a magnetic sensor, using the above system, includes the following steps:

[0113] The three-axis magnetic field simulation signal of the test environment is collected based on the Hall effect. When the system is started, the system is manually rotated 360°, and the magnetic sensor module is used to collect the surrounding three-axis magnetic field simulation signal. A total of 500 sets of data are collected, and the collection process takes 8 seconds. The three-axis magnetic field simulation signal collected by the magnetic sensor module is used for the ellipsoid fitting process. The three-axis magnetic field simulation signal of the test environment is also collected during the rest of the time.

[0114] Amplifying and high-frequency denoising the three-axis magnetic field simulation signal to obtain the processed three-axis magnetic field simulation signal;

[0115] Converting the processed three-axis magnetic field analog signal into a three-axis magnetic field digital signal;

[0116] Fitting the three-axis magnetic field digital signal collected by the system through 360° rotation based on an ellipsoid fitting algorithm to obtain a fitting signal;

[0117] Based on the dynamic threshold algorithm, the threshold of the fitting signal change is adjusted, and based on the threshold, the abnormal signal is detected to obtain the detection result;

[0118] The detection results are displayed and stored to complete dynamic threshold target detection based on magnetic sensors.

[0119] A further implementation method is to fit the three-axis magnetic field digital signal based on an ellipsoid fitting algorithm, and the method for obtaining the fitting signal is:

[0120] Create an augmented matrix with 6 rows and 7 columns whose coefficients are all zero;

[0121] Import the three-axis magnetic field digital signal into the augmented matrix to obtain the least square matrix;

[0122] Select the element with the largest absolute value in each column of the least squares matrix as the main element;

[0123] Add multiples of the row where the main element is located to the subsequent rows, so that the elements below the column where the main element is located become zero, and repeat the elimination until all columns have been processed;

[0124] Based on the matrix after elimination, divide the row where the principal element is located by the value of the principal element so that the first coefficient of each row where the principal element is located becomes 1, and obtain the principal element normalized matrix;

[0125] Starting from the last row of the principal element normalized matrix, back-substitution is performed in sequence to solve the unknown variables and obtain the ellipsoid equation. The three-axis magnetic field digital signal is fitted based on the ellipsoid equation to obtain the fitting signal.

[0126] A further implementation method is to adjust the threshold of the fitting signal change based on the dynamic threshold algorithm, and detect abnormal signals based on the threshold, and obtain the detection result by:

[0127] Initialize threshold, data index, number of collected data sets and other related parameters;

[0128] The fitting signal is stored in a buffer data group for data processing, and a threshold reference is obtained;

[0129] Calculate the maximum and minimum values ​​of the data with index 0 in the buffer data group, and sum and average the data in the buffer data group to obtain a new threshold reference; obtain a maximum deviation value based on the maximum value, the minimum value and the new threshold reference;

[0130] The maximum deviation value is compared with the initialized threshold value to detect abnormal signals and obtain the detection result.

[0131] Embodiment 3

[0132] The steps for users to operate the dynamic threshold target detection system based on magnetic sensors are as follows:

[0133] a. After the user turns on the power switch, the magnetic sensor starts to collect the three-axis magnetic field data of the surrounding environment, and passes the acquired three-axis magnetic field data through the signal processing circuit to amplify the weak magnetic field signal and eliminate the high-frequency noise signal brought by the surrounding environment in the magnetic signal. The processed three-axis data is then transmitted to the AD7606 conversion circuit to convert the analog signal into a digital signal. The single-chip microcomputer STM32 communicates with the AD7606 through the SPI interface to obtain the three-axis magnetic field data after relevant processing. In this process, the device is rotated 360 degrees for 8 seconds, and the device is processed for ellipsoid fitting.

[0134] b. Calculate the dynamic threshold of the data after ellipsoid fitting. The first ellipsoid fitting data will be used as the threshold reference. Then, the relevant operation will be performed on the set number of collected data groups to obtain a new threshold. This process will be repeated, and the data after ellipsoid fitting will be compared with the dynamic threshold during this period. If an abnormal magnetic field appears in the environment, for example, using a magnet to approach the device or using the device to detect the approach of surrounding vehicles, the difference between the data after ellipsoid fitting and the dynamic threshold will be greater than the set difference, triggering related functions (such as lighting up the LED light) and raising the abnormal signal state value. Figure 3 As shown, the abnormal signal state value is set to 1 after the abnormal magnetic field is detected; Figure 5 As shown, the result after ellipsoid fitting (waveform I1) is maintained near 1. When a magnetic target appears around at this time, the result after ellipsoid fitting (waveform I1) produces corresponding fluctuations, and the abnormal signal state (waveform I0) will be pulled up and set to 1.

[0135] c. This device will transmit data to the host computer for display and storage through the USB-TTL serial port or wireless communication module.

[0136] The ellipsoid fitting in step a will fit the three-axis magnetic field data into an optimal ellipsoidal surface model, and the output result is close to the value 1, such as Figure 4 As shown in the figure, after the ellipsoid fitting of the magnetic detection device is completed, it can stabilize near the value of 1 when it moves greatly without magnetic field interference; if the magnetic field strength of the surrounding environment increases, such as Figure 6 As shown, the fitted data will be greater than 1 and stabilize at that value; if the magnetic field strength of the surrounding environment decreases, such as Figure 8 As shown, the fitted data will be less than 1 and stabilize at that value.

[0137] The dynamic threshold algorithm in step b will adjust the sensitivity of the detection according to the actual situation, so that the device can achieve the best detection effect in different scenarios. When the surrounding magnetic field is strong or the noise is small, the threshold can be increased to reduce the false alarm rate. Figure 7 As shown in the figure, the result after ellipsoid fitting (waveform I1) is maintained at around 2.29. When a magnetic target appears around, the result after ellipsoid fitting (waveform I1) fluctuates accordingly, and the abnormal signal state (waveform I0) will be pulled up. When the surrounding magnetic field is weak or the noise is large, the threshold can be reduced to improve the sensitivity, such as Fig. 9 As shown, the result after ellipsoid fitting (waveform I1) is maintained near 0.49. When a magnetic target appears around at this time, the result after ellipsoid fitting (waveform I1) produces corresponding fluctuations, and the abnormal signal state (waveform I0) will be pulled up.

[0138] In step c, the data transmission speed can be increased or decreased by changing the baud rate.

[0139] The embodiments described above are only descriptions of the preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.

Claims

1. A dynamic threshold target detection system based on magnetic sensor, characterized in that: include: The magnetic sensor module is used to collect the three-axis magnetic field simulation signal of the environment to be tested based on the Hall effect; when the system is started, the system is manually rotated 360°, and the magnetic sensor module is used to collect the surrounding three-axis magnetic field simulation signal, and a total of 500 sets of data are collected. The collection process takes 8 seconds. The three-axis magnetic field simulation signal collected by the magnetic sensor module is used for the ellipsoid fitting process; the three-axis magnetic field simulation signal of the environment to be tested is also collected during the rest of the time; A signal processing module, used for amplifying and high-frequency denoising the three-axis magnetic field simulation signal to obtain the processed three-axis magnetic field simulation signal; An analog-to-digital conversion module, used for converting the processed three-axis magnetic field analog signal into a three-axis magnetic field digital signal; A signal fitting module is used to fit the three-axis magnetic field digital signal collected by the system through 360° rotation based on an ellipsoid fitting algorithm to obtain a fitting signal; A threshold detection module, used to adjust the threshold of the fitting signal change based on a dynamic threshold algorithm, and detect abnormal signals based on the threshold to obtain a detection result; The display module is used to display and store the detection results to complete dynamic threshold target detection based on the magnetic sensor.

2. The dynamic threshold target detection system based on magnetic sensor according to claim 1 is characterized in that: The magnetic sensor module adopts HMC1043 magnetic sensor, including three Wheatstone bridges made of nickel-iron alloy; The working principle of the HMC1043 magnetic sensor is as follows: when the HMC1043 magnetic sensor is in a changing external magnetic field, the resistance value of the Wheatstone bridge changes, a differential voltage value is output at the measuring end of the Wheatstone bridge, and based on the differential voltage value, the change in the relative value of the external magnetic field in the direction of the resistance of the Wheatstone bridge is obtained; The Hall effect is that when a conductor with current flowing through it is in a magnetic field, a voltage difference is generated on both sides of the conductor. The voltage difference is called the Hall voltage, and the Hall voltage is proportional to the strength of the magnetic field.

3. The dynamic threshold target detection system based on magnetic sensor according to claim 2 is characterized in that: The signal processing module includes a first operational amplifier and a second operational amplifier; The first operational amplifier is used to amplify the three-axis magnetic field analog signal; The second operational amplifier is used to construct a high-speed filter to filter out noise and interference reaching a preset frequency in the amplified three-axis magnetic field analog signal; The x, y, and z axis data from the magnetic sensor are respectively passed through the first operational amplifier and the second operational amplifier, that is, there are three first operational amplifiers and three second operational amplifiers, wherein the output of the first operational amplifier is connected to the input of the second operational amplifier.

4. The dynamic threshold target detection system based on magnetic sensor according to claim 1, characterized in that: The signal fitting module comprises: A matrix creation unit is used to create an augmented matrix with 6 rows and 7 columns whose coefficients are all zero; A signal import unit, used for importing the three-axis magnetic field digital signal into the augmented matrix to obtain a least squares matrix; A principal element selection unit, used for selecting the element with the largest absolute value in each column of the least squares matrix as the principal element; An elimination unit, used for adding multiples of the row where the main element is located to subsequent rows, so that the elements below the column where the main element is located become zero, and repeating the elimination until all columns are processed; A normalization unit, used for dividing the row where the principal element is located by the value of the principal element based on the matrix after elimination, so that the first coefficient of each row where the principal element is located becomes 1, and obtaining a principal element normalized matrix; The back-substitution solving unit is used to start from the last row of the principal element normalization matrix, sequentially back-substitution solve the unknowns to obtain the ellipsoid equation, and fit the three-axis magnetic field digital signal based on the ellipsoid equation to obtain a fitting signal.

5. The dynamic threshold target detection system based on magnetic sensor according to claim 1, characterized in that: The threshold detection module comprises: Initialization unit, used to initialize threshold, data index, number of collected data groups and other related parameters; A data acquisition unit, used for storing the fitting signal into a buffer data group for data processing and obtaining a threshold reference; A threshold calculation unit, configured to calculate a maximum value and a minimum value of the data with index 0 in the buffer data group, and to sum and average the data in the buffer data group to obtain a new threshold reference; and to obtain a maximum deviation value based on the maximum value, the minimum value and the new threshold reference; The threshold judgment unit is used to compare the maximum deviation value with the initialized threshold value, detect abnormal signals, and obtain detection results.

6. A dynamic threshold target detection method based on a magnetic sensor, characterized in that: The system according to any one of claims 1 to 5 comprises the following steps: The three-axis magnetic field simulation signal of the environment to be tested is collected based on the Hall effect; when the system is started, the system is manually rotated 360°, and the magnetic sensor module is used to collect the surrounding three-axis magnetic field simulation signal, and a total of 500 sets of data are collected. The collection process takes 8 seconds. The three-axis magnetic field simulation signal collected by the magnetic sensor module is used for the ellipsoid fitting process; the three-axis magnetic field simulation signal of the environment to be tested is also collected during the rest of the time; Amplifying and high-frequency denoising the three-axis magnetic field simulation signal to obtain the processed three-axis magnetic field simulation signal; Converting the processed three-axis magnetic field analog signal into a three-axis magnetic field digital signal; Fitting the three-axis magnetic field digital signal collected by the system through 360° rotation based on an ellipsoid fitting algorithm to obtain a fitting signal; Based on a dynamic threshold algorithm, adjusting the threshold of the fitting signal change, and based on the threshold, detecting abnormal signals to obtain a detection result; The detection results are displayed and stored to complete dynamic threshold target detection based on the magnetic sensor.

7. The dynamic threshold target detection method based on magnetic sensor according to claim 6 is characterized in that: The three-axis magnetic field digital signal is fitted based on the ellipsoid fitting algorithm to obtain the fitting signal: Create an augmented matrix with 6 rows and 7 columns whose coefficients are all zero; Importing the three-axis magnetic field digital signal into an augmented matrix to obtain a least squares matrix; Selecting the element with the largest absolute value in each column of the least squares matrix as the principal element; Add multiples of the row where the main element is located to subsequent rows, so that the elements below the column where the main element is located become zero, and repeat the elimination until all columns have been processed; Based on the matrix after elimination, the row where the principal element is located is divided by the value of the principal element, so that the first coefficient of each row where the principal element is located becomes 1, and a pivot normalized matrix is ​​obtained; Starting from the last row of the principal element normalization matrix, back-substitution is performed in sequence to solve the unknown variables to obtain the ellipsoid equation, and the three-axis magnetic field digital signal is fitted based on the ellipsoid equation to obtain a fitting signal.

8. The dynamic threshold target detection method based on magnetic sensor according to claim 6, characterized in that: Based on the dynamic threshold algorithm, the threshold of the fitting signal change is adjusted, and based on the threshold, the abnormal signal is detected, and the method for obtaining the detection result is: Initialize threshold, data index, number of collected data sets and other related parameters; Storing the fitting signal in a buffer data group for data processing and obtaining a threshold reference; Calculate the maximum and minimum values ​​of the data with index 0 in the buffered data group, and sum and average the data in the buffered data group to obtain a new threshold reference; Obtaining a maximum deviation value based on the maximum value, the minimum value, and the new threshold reference; The maximum deviation value is compared with the initialized threshold value to detect abnormal signals and obtain a detection result.

Citation Information

Patent Citations

  • Method for detecting and positioning magnetic object through magnetic sensor

    CN104739411A

  • Pupil and light spot positioning method, data calculation method and related device

    CN113190117A