A real-time positioning method for a permanent magnet based on a single magnetic sensor
By combining a single magnetic sensor with a BP neural network and specific sensors, the problems of complexity and high cost in magnetic sensing positioning technology have been solved, achieving low-cost, high-precision real-time positioning of permanent magnets, which is suitable for a variety of application scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UNIV OF ELECTRONICS SCI & TECH OF CHINA
- Filing Date
- 2023-12-21
- Publication Date
- 2026-07-03
AI Technical Summary
Existing magnetic sensing positioning technology is complex, occupies a large space, and is costly, making it unsuitable for certain specific scenarios. Furthermore, the sensor array algorithm is complex and difficult to apply in engineering.
A real-time positioning method based on a single magnetic sensor is adopted. By measuring the triaxial magnetic field strength of the target permanent magnet, a fitting function is established using a BP neural network, which is then converted into cylindrical coordinates. The Hall effect, anisotropic magnetoresistive or tunnel magnetoresistive sensors are combined for real-time measurement to eliminate environmental magnetic field interference and achieve real-time positioning of the permanent magnet.
It achieves high-precision positioning with low cost and low space occupation in more demanding environments, is suitable for a variety of application scenarios, provides accurate positioning results, is easy to operate and is easy to apply in engineering.
Smart Images

Figure CN117665830B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of magnetic sensing technology, particularly magnetic sensing-based positioning technology, specifically a real-time positioning method for permanent magnets based on a single magnetic sensor. Background Technology
[0002] Common methods for real-time measurement of position and distance include ranging based on magnetic fields, ultrasound, microwaves, and laser reflection. These methods often have limitations: ultrasonic ranging relies on the air medium, making it unsuitable for aerospace applications; microwave ranging is constrained by system complexity, making miniaturization difficult; laser ranging has certain advantages, but is usually limited to unobstructed straight-line distance detection and struggles to acquire multi-degree-of-freedom parameters such as attitude information.
[0003] Compared to the methods mentioned above, magnetic field detection-based sensing and positioning features lightweight, small size, and low power consumption, and has played an important role in national economy, national defense, science and technology, and medical and health fields, becoming a major branch of the modern sensor industry. Especially in industrial applications, magnetic sensors are more durable due to their unique resistance to dust, dirt, grease, vibration, and humidity, and can be used in more demanding working environments, where commonly used non-contact position sensors often fail.
[0004] In the field of magnetic sensing positioning, most existing positioning technologies are based on the theory of magnetic dipoles, using magnetic sensor arrays and specific algorithms to locate the object being measured. The algorithms used in sensor arrays are relatively complex, occupy a large space, and are costly, making them unsuitable for certain specific scenarios and difficult to implement in engineering. Summary of the Invention
[0005] To address the aforementioned problems and shortcomings, and to solve the limitations of existing magnetic sensing positioning technologies due to their complexity, large footprint, and high cost, this invention provides a real-time positioning method for permanent magnets based on a single magnetic sensor, thus solving positioning needs in more application scenarios.
[0006] A real-time positioning method for a permanent magnet based on a single magnetic sensor includes:
[0007] Step 1: Measure the actual magnetic field strength of the target permanent magnet and establish a triaxial magnetic field distribution model of the target permanent magnet.
[0008] Step 2: Train the magnetic field distribution model established in Step 1 using a BP neural network to establish two neural network models: the first neural network model has the z-axis magnetic field strength Bz and the x-axis magnetic field strength Bx as inputs and the z-coordinate as output; the second neural network model has the z-coordinate, Bx, and Bz as inputs and the r-coordinate as output; and fit the three-axis magnetic field strength and cylindrical coordinates in the model established in Step 1 into a functional relationship.
[0009] Step 3: Select a magnetic sensor based on the magnetic field strength range of the target permanent magnet, taking into account both range and resolution; use the selected single magnetic sensor to measure the triaxial magnetic field strength of the permanent magnet in space in real time.
[0010] Step 4: Convert the real-time triaxial magnetic field strength obtained in Step 3 into cylindrical coordinates (r, θ, z) using the fitting function obtained in Step 2.
[0011] By eliminating the ambient magnetic field, the true magnetic field strength of the permanent magnet is obtained through a neural network model, which yields the values of r and z in cylindrical coordinates. The angle θ can be obtained from the y-axis magnetic field strength By and the x-axis magnetic field strength Bx.
[0012] Step 5: Convert the cylindrical coordinates (r, θ, z) obtained in Step 4 into rectangular coordinates (x, y, z) to obtain the position information of the permanent magnet.
[0013] Furthermore, step 1 specifically includes:
[0014] First, the actual magnetic field strength of the target permanent magnet is measured using a professional magnetic field measuring instrument (such as a gaussmeter). Then, a suitable simulation model (such as a magnetization model, finite element analysis model, or hysteresis loop model) is selected to simulate and model the target permanent magnet. During the simulation, relevant parameters are adjusted to ensure that the triaxial magnetic field strength distribution model of the permanent magnet matches the actual magnetic field strength distribution, thus meeting the performance requirements of the positioning system.
[0015] Furthermore, in step 1, depending on the actual application scenario and positioning requirements, the target permanent magnet is selected from permanent magnets of different specifications and sizes, such as cylinders, cubes, or spheres. Among them, cylindrical permanent magnets have a uniform magnetic field distribution, which helps to improve the stability of the measurement; cubic permanent magnets have a stronger magnetic field in a specific direction, which is suitable for application scenarios with high orientation requirements; spherical permanent magnets can provide a magnetic field distribution in all directions, which is suitable for application scenarios with high sensitivity.
[0016] Furthermore, in step 2, the magnetic field strength information is converted into cylindrical coordinate information using a BP neural network. The BP neural network, also known as a backpropagation neural network, is one of the most widely used intelligent algorithms in the field of artificial intelligence today. It consists of multiple layers of neurons, including an input layer, hidden layers, and an output layer, and is a representative of artificial neural networks. These three layers of neurons play different roles, and the input information is transmitted in the order of input layer-hidden layer-output layer. If the network output differs from the expected output, the deviation between the two is calculated and backpropagated. By adjusting the weights and thresholds of the neurons, the system seeks to minimize the deviation. When the output deviation reaches the expected level, the system stops network computation and records the weights of each neuron, thus forming the BP network model.
[0017] The network weights of the input layer and hidden layer neurons are denoted as M. 1 The network weights between neurons in the hidden layer and the output layer are denoted as M. 2 The expressions are as follows:
[0018]
[0019]
[0020] Where l represents the number of rows in the matrix; k represents the number of columns in the matrix; M represents 1 The element at the l-th row and k-th column; M represents 2 The element at the l-th row and k-th column.
[0021] The core of the BP neural network lies in its backpropagation mechanism, which gradually makes the network output approach the expected result by adjusting the weights and thresholds between neurons, thereby realizing the training and learning process.
[0022] Since Bz, Bx, and z coordinates, and z, Bx, Bz, and r coordinates are highly correlated, the first BP neural network model has Bz and Bx as inputs and z coordinates as outputs; the second neural network model has z, Bx, and Bz as inputs and r coordinates as outputs.
[0023] After the two neural network models are trained to their optimal performance, the resulting fitting functions are as follows:
[0024]
[0025] After completing network training, unused sample data is used for testing to evaluate the accuracy of the network model; and by adjusting the weights and thresholds of neurons, the accuracy of the neural network model is made to reach over 90%.
[0026] Furthermore, in step 3, the measurement range is the maximum range of magnetic field strength that the magnetic sensor can measure; the resolution is the minimum magnetic field change that the sensor can distinguish. Permanent magnets of different sizes may generate magnetic fields of different intensities, so it is necessary to select a magnetic sensor whose measurement range can cover the required range of magnetic fields, while its resolution must meet the sensitivity requirements for magnetic field changes during measurement.
[0027] Furthermore, the magnetic sensor selected in step 3 is a Hall effect sensor, anisotropic magnetoresistive sensor, giant magnetoresistive sensor, or tunneling magnetoresistive sensor. Among these, the Hall effect sensor has a fast response speed, low power consumption, and high reliability, but its accuracy is relatively low and its performance is easily affected by temperature. Anisotropic magnetoresistive sensors have high sensitivity, can detect minute changes in magnetic fields, and have high accuracy; due to their anisotropic nature, they may be more sensitive to specific directions. Giant magnetoresistive sensors and tunneling magnetoresistive sensors have high sensitivity and low power consumption, but giant magnetoresistive sensors are easily affected by external magnetic fields and are relatively expensive. Tunneling magnetoresistive sensors are more complex to manufacture, resulting in higher costs, and their performance is affected by temperature changes.
[0028] Furthermore, in step 4, the relationship between the actual magnetic field strength and the ambient magnetic field strength is as follows:
[0029]
[0030] Wherein, Bx, By, and Bz are the actual magnetic field strengths of the permanent magnet; Bx1, By1, and Bz1 are the magnetic field strengths measured by the magnetic sensor; Bx0, By0, and Bz0 are the ambient magnetic field strengths, which are the first set of data output by the magnetic sensor, i.e., the magnetic field strength values output by the magnetic sensor when there is no permanent magnet.
[0031] The relationship between the actual magnetic field strength and the cylindrical coordinates r, θ, z is as follows:
[0032]
[0033] Furthermore, in step 5, the transformation relationship between cylindrical coordinates and rectangular coordinates is as follows:
[0034]
[0035] In summary, this invention utilizes a fitting function established by a BP neural network and a single magnetic sensor to perform real-time magnetic field measurement of a target permanent magnet. This converts the triaxial magnetic field information of the target permanent magnet into coordinate information, enabling real-time tracking and positioning of the permanent magnet. This invention is simple to operate, occupies a small space, has low cost, and can monitor the triaxial magnetic field strength information of a target permanent magnet in real time using a magnetic sensor, updating position information instantly and providing accurate positioning results. Furthermore, depending on the application scenario and requirements, different specifications and sizes of permanent magnets can be selected, including but not limited to cylinders, cuboids, and spheres. For the magnetic field strength information of a specific specification and size permanent magnet, a suitable type and model of magnetic sensor is selected by comprehensively considering parameters such as range and resolution to achieve the ideal positioning range and accuracy. Attached Figure Description
[0036] Figure 1 This is a flowchart of the present invention;
[0037] Figure 2 This is a schematic diagram of the cylindrical permanent magnet in the embodiment;
[0038] Figure 3 This is a comparison chart of the simulation results and actual measurement results of the cylindrical permanent magnet in Example 1;
[0039] Figure 4 This is a comparison chart of the simulation results and actual measurement results of the cylindrical permanent magnet in Example 2. Detailed Implementation
[0040] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.
[0041] The purpose of this invention is to provide a real-time positioning method for a permanent magnet based on a single magnetic sensor, and two embodiments are provided. Embodiment 1 uses a cylindrical permanent magnet with a radius of 1.5 mm and a thickness of 1.5 mm, and the magnetic sensor is an HMC5883L sensor; Embodiment 2 uses a cylindrical permanent magnet with a radius of 1.5 mm and a thickness of 3 mm, and the magnetic sensor is an MMC5603NJ sensor.
[0042] The Honeywell HMC5883L is a surface-mount, highly integrated AMR (anisotropic magnetoresistive) sensor characterized by high axial sensitivity and high linear accuracy. It is also a weak magnetic field sensor chip with a digital interface, suitable for low-cost compasses and magnetic field detection applications. Its features include: 1. A 12-bit resolution analog-to-digital converter and a low-interference AMR sensor; 2. A measurable magnetic field range of ±8 Gauss; 3. Achievable resolution of 5 milligauss; 4. Features I... 2 C (Serial bidirectional bus) digital interface. 5. Maximum output frequency up to 160Hz.
[0043] The MMC5603NJ is a triaxial magnetic sensor integrated into a single chip by MEMSensing Semiconductor based on advanced AMR technology. It is the smallest magnetic sensor available (0.8*0.8*0.4mm). Its features include: 1. Measurable magnetic field range of ±30 Gauss; 2. Achievable resolution of 0.0625 milligauss in 20-bit operation mode; 3. Sensor true frequency response up to 1000Hz; 4. Operating temperature range of -40℃ to +85℃; 5. Features I... 2 C digital interface.
[0044] Example 1
[0045] Step 1: Measure the actual magnetic field strength of a cylindrical permanent magnet with a radius of 1.5 mm and a thickness of 1.5 mm, and establish a triaxial magnetic field distribution model of the cylindrical permanent magnet with a radius of 1.5 mm and a thickness of 1.5 mm.
[0046] First, a cylindrical permanent magnet with a radius of 1.5 mm and a thickness of 1.5 mm is linearly scanned along the x-axis using a gaussmeter. Then, a simulation model is created. In this embodiment, a magnetization model is used for simulation. In the magnetization model, the expression for the magnetic induction intensity B is:
[0047] B = μ0(H + M)
[0048] Where μ0 is the free permeability, H is the magnetic field strength, and M is the magnetization, with H and M both in A / m. The magnetization along the z-axis is set to Ms, and the magnetization along the x and y axes is set to 0. Due to limitations of the experimental equipment, there are some differences between the simulation results and the actual measurement results. The simulation results and actual measurement results along the x-axis of a cylindrical permanent magnet with a radius of 1.5 mm and a thickness of 1.5 mm at z = 6 mm are attached. Figure 3 As shown, the mean absolute error (MAE) is 0.5805, and the error percentage is 3.9%, which is less than 5%, indicating that the simulation model can be applied to subsequent studies. The mean absolute error (MAE) represents the model error as the average of the absolute errors between the actual and predicted values. The formula for calculating MAE is as follows:
[0049]
[0050] Where N is the number of data points; A i It is the i-th data point of the actual measurement result; F i It is the i-th data point in the simulation results; |A i -F i | indicates that A i and F i Take the absolute value of the difference.
[0051] Step 2: Train the magnetic field distribution model established in Step 1 using a backpropagation (BP) neural network to create two neural network models. The algorithm used in the neural network is the Levenberg-Marquardt method. In the first neural network model, the inputs are Bz and Bx, and the output is the z-coordinate. In the second neural network model, the inputs are z, Bx, and Bz, and the output is the r-coordinate.
[0052] The core of a backpropagation (BP) neural network lies in its backpropagation mechanism. This mechanism gradually adjusts the weights and thresholds between neurons to make the network output approach the expected result, thus achieving the training and learning process. The BP neural network converts magnetic field strength into cylindrical coordinates; the network weights between neurons in the input and hidden layers of the BP neural network are denoted as M. 1 The network weights between neurons in the hidden layer and the output layer are denoted as M. 2 The expressions are as follows:
[0053]
[0054]
[0055] Where l represents the number of rows in the matrix; k represents the number of columns in the matrix; M represents 1 The element at the l-th row and k-th column; M represents 2 The element at the l-th row and k-th column.
[0056] Since Bz, Bx, and z coordinates; and z, Bx, Bz, and r coordinates are highly correlated, the first BP neural network model has Bz and Bx as inputs and z coordinates as outputs; the second neural network model has z, Bx, and Bz as inputs and r coordinates as outputs; the Levenberg-Marquardt method is used to train the magnetic field distribution model.
[0057] In this embodiment of the invention, the two neural network models achieve optimal results after 1000 training iterations, and the resulting fitting functions are as follows:
[0058]
[0059] In this embodiment, after adjusting the weights and thresholds of the neurons, the correlation coefficients of the two neural network models were 0.9992 and 0.9998, respectively. After completing the network training, the remaining sample data was used for comparison to test the accuracy of the network models. The test accuracy rates were 99.92% and 99.98%, respectively, both exceeding 99.9%.
[0060] Step 3: Use an HMC5883L sensor to measure the triaxial magnetic field strength of the cylindrical permanent magnet in space in real time;
[0061] Step 4: Eliminate the ambient magnetic field. The actual magnetic field strength of the permanent magnet is obtained by using a neural network model to obtain the values of r and z in cylindrical coordinates. The angle θ can be obtained by the y-axis magnetic field strength By and the x-axis magnetic field strength Bx.
[0062] The relationship between the actual magnetic field strength and the ambient magnetic field strength is as follows:
[0063]
[0064] Wherein, Bx, By, and Bz are the actual magnetic field strength of the permanent magnet; Bx1, By1, and Bz1 are the magnetic field strength measured by the HMC5883L sensor; Bx0, By0, and Bz0 are the ambient magnetic field strength, which are the first set of data output by the HMC5883L sensor, that is, the magnetic field strength values output by the HMC5883L sensor when there is no permanent magnet.
[0065] The relationship between the actual magnetic field strength and the cylindrical coordinates r, θ, z is as follows:
[0066]
[0067] Step 5: Convert the cylindrical coordinates (r, θ, z) to rectangular coordinates (x, y, z) to obtain the position information of the permanent magnet.
[0068] The transformation relationship between cylindrical coordinates and rectangular coordinates is as follows:
[0069]
[0070] In this embodiment, the locatable range is a 10*10*10mm cube centered at a point 16mm directly above the magnetic sensor.
[0071] Example 2
[0072] Step 1: Measure the actual magnetic field strength of a cylindrical permanent magnet with a radius of 1.5 mm and a thickness of 3 mm, and establish a triaxial magnetic field distribution model of the cylindrical permanent magnet with a radius of 1.5 mm and a thickness of 3 mm.
[0073] First, a permanent magnet with a radius of 1.5 mm and a thickness of 3 mm is linearly scanned along the x-axis using a gaussmeter. Then, a simulation model is created. In this embodiment, a magnetization model is used for simulation. In the magnetization model, the expression for the magnetic induction intensity B is:
[0074] B = μ0(H + M)
[0075] The magnetization intensity along the z-axis is set to Ms, while the magnetization intensity along the x and y axes is set to 0. Due to limitations of the experimental equipment, there are some differences between the simulation results and the actual measurement results. The simulation results and actual measurement results along the x-axis of a cylindrical permanent magnet with a radius of 1.5 mm and a thickness of 3 mm at z = 10 mm are attached. Figure 4 As shown, the mean absolute error is 0.7050, and the error percentage is 4.79%, which is less than 5%, so the simulation model can be applied to subsequent applications.
[0076] Step 2: Train the magnetic field distribution model established in Step 1 using a backpropagation (BP) neural network to create two neural network models. The algorithm used in the neural network is the Levenberg-Marquardt method. In the first neural network model, the inputs are Bz and Bx, and the output is the z-coordinate. In the second neural network model, the inputs are z, Bx, and Bz, and the output is the r-coordinate.
[0077] The magnetic field strength is converted into cylindrical coordinates using a backpropagation (BP) neural network. Since the Bz, Bx, and z coordinates, and the z, Bx, Bz, and r coordinates are highly correlated, the first BP neural network model uses Bz and Bx as inputs and the z coordinate as output. The second neural network model uses z, Bx, and Bz as inputs and the r coordinate as output. The Levenberg-Marquardt algorithm is used to train the magnetic field distribution model.
[0078] In this embodiment, the first neural network model achieved its optimal performance after 600 training iterations, and the second neural network model achieved its optimal performance after 1000 training iterations. The resulting fitting functions are as follows:
[0079]
[0080] In this embodiment, after adjusting the weights and thresholds of the neurons, the correlation coefficients of the two neural network models were 0.9978 and 0.9981, respectively. After completing the network training, the remaining sample data was used for comparison to test the accuracy of the network models. The test accuracy rates were 99.78% and 99.81%, respectively, both exceeding 99.5%.
[0081] Step 3: Use an MMC5603NJ sensor to measure the triaxial magnetic field strength of the cylindrical permanent magnet in space in real time.
[0082] Step 4: Eliminate the ambient magnetic field. The true magnetic field strength of the permanent magnet is obtained by using a neural network model to obtain the values of r and z in cylindrical coordinates. The angle θ can be obtained from the magnetic field strength along the y-axis and the magnetic field strength along the x-axis.
[0083] The relationship between the actual magnetic field strength and the ambient magnetic field strength is as follows:
[0084]
[0085] Wherein, Bx, By, and Bz are the actual magnetic field strength of the permanent magnet; Bx1, By1, and Bz1 are the magnetic field strengths measured by the MMC5603NJ sensor; Bx0, By0, and Bz0 are the ambient magnetic field strengths, which are the first set of data output by the MMC5603NJ sensor, that is, the magnetic field strength values output by the MMC5603NJ sensor when there is no permanent magnet.
[0086] The relationship between the actual magnetic field strength and the cylindrical coordinates (r, θ, z) is as follows:
[0087]
[0088] Step 5: Convert the cylindrical coordinates (r, θ, z) to Cartesian coordinates (x, y, z) to obtain the position information of the permanent magnet. The conversion relationship between cylindrical and Cartesian coordinates is as follows:
[0089]
[0090] In this embodiment, the locatable range is a 50*50*50mm cube centered at a point 35mm directly above the magnetic sensor.
[0091] As can be seen from the above embodiments, this invention, based on a fitting function established by a neural network using a single magnetic sensor, performs real-time magnetic field measurement of a target permanent magnet using a single magnetic sensor, and converts the triaxial magnetic field information into coordinate information, thus achieving real-time tracking and positioning of the target permanent magnet. This invention is simple to operate, occupies a small space, has low cost, and can monitor the triaxial magnetic field strength information of a permanent magnet in real time using a single magnetic sensor, updating position information instantly and providing accurate positioning results. Furthermore, depending on the application scenario and requirements, different specifications and sizes of permanent magnets can be selected, such as cylinders, cuboids, and spheres. For the magnetic field strength information of a specific specification and size permanent magnet, a suitable type and model of magnetic sensor is selected by comprehensively considering parameters such as range and resolution to achieve ideal positioning range and accuracy. This allows for use in more demanding working environments, is easier to engineer, and can be applied to scenarios with different needs.
Claims
1. A real-time positioning method for a permanent magnet based on a single magnetic sensor, characterized in that, Includes the following steps: Step 1: Measure the actual magnetic field strength of the target permanent magnet and establish a triaxial magnetic field distribution model of the target permanent magnet; Step 2: Train the magnetic field distribution model established in Step 1 using a BP neural network to create two neural network models: the first neural network model takes z-axis magnetic field strength Bz and x-axis magnetic field strength Bx as inputs and outputs the z-coordinate; the second neural network model takes z-coordinate, Bx, and Bz as inputs and outputs the r-coordinate. Fit the three-axis magnetic field strength and cylindrical coordinates in the model established in Step 1 into a functional relationship. Step 3: Select a magnetic sensor based on the magnetic field strength range of the target permanent magnet, taking into account both the range and resolution; use the selected single magnetic sensor to measure the triaxial magnetic field strength of the permanent magnet in space in real time. Step 4: Convert the real-time triaxial magnetic field strength obtained in Step 3 into cylindrical coordinates (r, θ, z) using the fitting function obtained in Step 2. To eliminate the ambient magnetic field, the true magnetic field strength of the permanent magnet is obtained by using a neural network model to obtain the values of r and z in cylindrical coordinates. The angle θ is obtained by the y-axis magnetic field strength By and the x-axis magnetic field strength Bx. Step 5: Convert the cylindrical coordinates (r, θ, z) obtained in Step 4 into rectangular coordinates (x, y, z) to obtain the position information of the permanent magnet.
2. The real-time positioning method for a permanent magnet based on a single magnetic sensor as described in claim 1, characterized in that, Step 1 specifically involves: firstly, measuring the actual magnetic field strength of the target permanent magnet using a professional magnetic field measuring instrument; then, simulating and modeling the target permanent magnet by selecting a simulation model; during the simulation process, adjusting the corresponding parameters to ensure that the triaxial magnetic field strength distribution model of the permanent magnet is consistent with the actual magnetic field strength distribution, so as to meet the performance requirements of the positioning system.
3. The real-time positioning method for a permanent magnet based on a single magnetic sensor as described in claim 2, characterized in that: The simulation model is a magnetization model, a finite element analysis model, or a hysteresis loop model.
4. The real-time positioning method for a permanent magnet based on a single magnetic sensor as described in claim 1, characterized in that: In step 1, the target permanent magnet is a cylinder, a cube, or a sphere.
5. The real-time positioning method for a permanent magnet based on a single magnetic sensor as described in claim 1, characterized in that: In step 2, the BP neural network includes an input layer, a hidden layer, and an output layer, where the network weights of the neurons in the input and hidden layers are denoted as M. 1 The network weights between neurons in the hidden layer and the output layer are denoted as M. 2 The expressions are as follows: ; ; Where l represents the number of rows in the matrix; k represents the number of columns in the matrix; M represents 1 The element at the l-th row and k-th column; M represents 2 The element at the l-th row and k-th column; After the two neural network models are trained to their optimal performance, the resulting fitting functions are as follows: ; After completing network training, unused sample data is used for testing to evaluate the accuracy of the network model. By adjusting the weights and thresholds of neurons, the accuracy of the neural network model is made to reach over 90%.
6. The real-time positioning method for a permanent magnet based on a single magnetic sensor as described in claim 1, characterized in that: In step 3, the range of the magnetic sensor should be able to cover the required magnetic field range, and its resolution should meet the sensitivity requirements for magnetic field changes during measurement. The range is the maximum range of magnetic field strength that the magnetic sensor can measure; the resolution is the minimum magnetic field change that the sensor can distinguish.
7. The real-time positioning method for a permanent magnet based on a single magnetic sensor as described in claim 6, characterized in that: The magnetic sensor is a Hall effect sensor, anisotropic magnetoresistive sensor, giant magnetoresistive sensor, or tunnel magnetoresistive sensor.
8. The real-time positioning method for a permanent magnet based on a single magnetic sensor as described in claim 5, characterized in that: In step 4, the relationship between the actual magnetic field strength and the ambient magnetic field strength is as follows: ; Where Bx, By, and Bz are the actual magnetic field strengths of the permanent magnet; Bx1, By1, and Bz1 are the magnetic field strengths measured by the magnetic sensor; Bx0, By0, and Bz0 are the ambient magnetic field strengths, which are the first set of data output by the magnetic sensor, i.e., the magnetic field strength values output by the magnetic sensor when there is no permanent magnet. The relationship between the actual magnetic field strength and the cylindrical coordinates r, θ, z is as follows: 。 9. The real-time positioning method for a permanent magnet based on a single magnetic sensor as described in claim 1, characterized in that: In step 5, the transformation relationship between cylindrical coordinates and rectangular coordinates is as follows: 。