Intelligent magnetic field generator device based on deep learning and control method

By combining coil arrays and deep learning modules, the problems of slow response speed and low control accuracy in complex magnetic field reconstruction of traditional magnetic field generators are solved, realizing fast and high-precision magnetic field generation, which is suitable for electromagnetic compatibility testing, biomagnetic stimulation and geomagnetic environment simulation.

CN121257293APending Publication Date: 2026-01-02HUBEI UNIV +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511365418.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-23
Publication Date
2026-01-02

AI Technical Summary

Technical Problem

Traditional magnetic field generators suffer from difficulties in modeling complex spatial magnetic field distributions, low control precision, and slow response speed. They are particularly difficult to meet the requirements of real-time performance and accuracy in applications that require dynamic reconstruction of specific magnetic field patterns.

Method used

A collaborative architecture of coil array, programmable current control module and deep learning module is adopted. A specific magnetic field distribution is generated by the coil array with equal spacing square matrix structure. The nonlinear mapping relationship between magnetic field and coil current is established by combining deep neural network to realize magnetic field inverse reconstruction and current parameter prediction.

Benefits of technology

It achieves rapid inverse reconstruction and high-precision reproduction of arbitrary magnetic flux density distribution within a spatial target area, with a response time of less than 60 seconds and an average error of less than 20%, adapting to the needs of different application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121257293A_ABST
    Figure CN121257293A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent magnetic field generator device based on deep learning and a control method. The device comprises a coil array, a programmable current control module and a deep learning module. The coil array adopts an equidistant square matrix structure and is used for generating specific magnetic flux density distribution in a space target area; the programmable current control module is used for adjusting the power-on current amplitude and direction of each coil of the coil array; and the deep learning module is used for establishing a nonlinear mapping relation between the magnetic field distribution of the space target area and the coil current configuration of the coil array so as to realize magnetic field reverse reconstruction and current parameter prediction. The invention aims to solve the problems of complex modeling, difficulty in solving an inverse problem, low control precision and poor flexibility in a magnetic field adjustment process in the prior art, and quick inverse solution and high-precision reproduction from target magnetic field distribution to coil current parameters are realized through the magnetic field generator device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electromagnetic field generation and intelligent control technology, specifically to an intelligent magnetic field generator device and control method based on deep learning. Background Technology

[0002] In modern scientific research and engineering applications, high-precision, programmable magnetic field environments have become an indispensable technological support. Traditional magnetic field generating devices mainly rely on structures such as Helmholtz coils, solenoids, Maxwell coils, or elliptical coil arrays to generate uniform or gradient magnetic fields by adjusting the input current. In recent years, with the development of artificial intelligence technology, deep learning, especially deep neural networks, has shown great potential in physical system modeling and control. Existing research has attempted to use neural networks to establish a forward mapping model of current input-magnetic field output, but efficient and stable inverse reconstruction functions have not yet been achieved, and most remain at the simulation level without deep integration with real hardware systems. However, these methods have significant limitations when facing complex magnetic field distributions that are asymmetric, non-uniform, or dynamically changing.

[0003] Complex modeling and large computational load: Accurate prediction of the spatial magnetic field distribution of multi-coil coupled systems requires finite element simulation, which is time-consuming and difficult to meet the requirements of real-time control.

[0004] The inverse problem is difficult to solve: deriving the current parameters of each coil from the target magnetic field is a typical "field-source" inverse problem, and analytical solutions are difficult to obtain. Traditional optimization algorithms (such as genetic algorithms and particle swarm optimization) converge slowly and are prone to getting trapped in local optima.

[0005] Low control precision and poor flexibility: Most systems only support the generation of magnetic fields in a fixed direction, lack multi-degree-of-freedom adjustment capabilities, and have no closed-loop feedback mechanism, resulting in a large deviation between the actual magnetic field and the target. Summary of the Invention

[0006] The main objective of this application is to provide a deep learning-based intelligent magnetic field generator device, which includes: a coil array, a programmable current control module, and a deep learning module;

[0007] The programmable current control module is used to generate programmable current and adjust the amplitude and direction of the energized current of each coil in the coil array.

[0008] The coil array adopts an equally spaced square array structure, which is used to generate a specific magnetic field distribution in the spatial target region corresponding to the coil array by the programmable current generated by the programmable current control module.

[0009] The deep learning module is used to establish a nonlinear mapping relationship between the magnetic field distribution in the target space region and the coil current configuration of the coil array, thereby realizing magnetic field inverse reconstruction and current parameter prediction.

[0010] In one embodiment, the coil array further includes: an axial central coil group and lateral end coil groups;

[0011] The axial center coil group has a symmetrical cylindrical structure, which is composed of multiple turns of cylindrical coils arranged in a row;

[0012] The side end coil groups are located at the upper and lower ends of the coil array along the Z-axis. Each group contains several coils, which are arranged parallel to and spaced apart from the axial center coil. The axial direction of the coils can be switched to the X / Y / Z axis direction by a stepper motor.

[0013] In one embodiment, the current values ​​of the axial center coil and the side end coil group are in a preset proportional relationship;

[0014] When a 5A DC current is applied to the axial center coil and a 2A current is applied to the side end coil group, an asymmetric magnetic field with a peak value of 900nT and an axial gradient of 35nT / mm is generated in the target spatial region.

[0015] In one embodiment, the programmable current control module further includes: a current amplitude adjustment unit and a current direction control unit;

[0016] The current amplitude adjustment unit adopts a closed-loop feedback circuit composed of a digital-to-analog converter chip and a precision operational amplifier, which can realize continuous adjustment of the current in the range of 0-10A. By receiving the current amplitude command output by the deep learning module, the current amplitude command is converted into an analog current signal with the corresponding amplitude.

[0017] The current direction control unit consists of a relay array and an H-bridge drive circuit. It controls the on / off state of the relay array through high and low level signals to achieve bidirectional switching of the coil current direction.

[0018] In one embodiment, the deep learning module further includes: a data storage unit, a deep neural network model, an inverse mapping unit, and a model optimization unit;

[0019] The data storage unit is used to store sample datasets of coil current configuration and corresponding spatial magnetic field distribution, including simulation calculation data and measured data of the device, to construct a magnetic field-current correlation database;

[0020] The deep neural network model adopts a combination structure of a long short-term memory network with multiple hidden layers and a fully connected network. The input layer receives the magnetic field feature parameters of the spatial target region, the intermediate layer processes the high-dimensional mapping relationship between the magnetic field and the current through nonlinear transformation, and the output layer outputs the current configuration parameters of the coil array.

[0021] The reverse mapping unit, based on a trained deep neural network model, directly outputs a combination scheme of current amplitude and direction for each coil that satisfies the magnetic field distribution by inputting magnetic flux density distribution data of the target magnetic field.

[0022] The model optimization unit is used to receive the error signal between the actual magnetic field and the target magnetic field fed back by the magnetic field measurement module, and dynamically adjusts the weight parameters of the deep neural network model using the gradient descent algorithm to achieve online iterative optimization of the model.

[0023] In one embodiment, the device further includes: a magnetic field curve import and preprocessing module and a power supply module;

[0024] The magnetic field curve import and preprocessing module is connected to the host computer and is used to receive the target magnetic field parameters input by the user and perform noise filtering, outlier correction and data normalization.

[0025] The magnetic field curve import and preprocessing module is also used to feed back the error between the actual measured magnetic field and the target magnetic field to the deep learning module, so as to realize online fine-tuning and accuracy correction of the target magnetic field, and make the average error of magnetic field generation less than 20%.

[0026] The power module is connected to the device module, and the power module converts mains power to provide the required voltage to the device.

[0027] In one embodiment, the device further includes: a magnetic field measurement module;

[0028] The magnetic field measurement module is connected to the device module. The magnetic field measurement module is composed of a Hall sensor or a three-axis fluxgate sensor and is used to collect the actual magnetic flux density distribution data of the target area.

[0029] Furthermore, to achieve the above objectives, this application also proposes a deep learning-based intelligent magnetic field generator control method, applicable to any of the aforementioned devices, the method comprising the following steps:

[0030] S1: Import the target magnetic field distribution data through the host computer control interface, and perform noise removal, outlier correction and normalization processing through the magnetic field curve import and preprocessing module.

[0031] S2: The deep learning module calls the pre-trained learning model, inputs the pre-processed target magnetic field characteristics, and outputs the initial current configuration parameters of the coil array;

[0032] S3: The programmable current control module adjusts the current amplitude and direction of each coil according to the current configuration parameters, driving the coil array to generate a magnetic field;

[0033] S4: The magnetic field measurement module collects the actual magnetic field distribution of the target area and calculates the error between it and the target magnetic field.

[0034] S5: If the error is greater than 5%, the error signal is fed back to the deep learning module, the model parameters are fine-tuned and the current configuration is updated using the gradient descent method, and the process returns to S3; if the error is less than or equal to 5%, the magnetic field reproduction is completed and an experimental report containing error analysis and parameter logs is generated.

[0035] In one embodiment, the method further includes a model transfer learning step:

[0036] The measurement data obtained by the magnetic field generator device during actual operation is used to perform transfer learning on the pre-trained model in the deep learning module.

[0037] During the transfer learning process, only the parameters of the third LSTM hidden layer, subsequent fully connected layers, and the output layer in the deep neural network are fine-tuned.

[0038] When the mean square error between the predicted magnetic field curve and the measured magnetic field curve is less than 20%, stop fine-tuning, save and enable the updated model as the new prediction benchmark.

[0039] This application discloses a deep learning-based intelligent magnetic field generator device and control method. The device includes a coil array, a programmable current control module, and a deep learning module. The coil array consists of a 3×3 central coil group and steerable end coil groups. The deep learning module employs a hybrid neural network to establish an inverse mapping relationship between the magnetic field and current. Combined with Hall sensor closed-loop feedback and transfer learning mechanisms, it achieves high-precision, adaptive reproduction of the target magnetic field. The control method includes steps such as target input, model inference, closed-loop adjustment, and online optimization. This application features fast response, small error, and high intelligence, making it suitable for electromagnetic simulation, biomedical, and other fields. Attached Figure Description

[0040] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0041] Figure 1 This is a system block diagram of a deep learning-based intelligent magnetic field generator device;

[0042] Figure 2 This is a specific implementation example diagram of a 3×3 coil array;

[0043] Figure 3 It is the measured value of the Bx component of the magnetic field along the central axis above the device;

[0044] Figure 4 This is a comparison chart of the coil current obtained from deep learning and the actual input current. Detailed Implementation

[0045] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0046] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of this application.

[0047] Traditional magnetic field generators often employ Helmholtz coils, solenoids, or Maxwell coils to produce uniform or gradient magnetic fields by adjusting the input current. However, these devices suffer from difficulties in modeling complex spatial magnetic field distributions (such as asymmetric fields or locally focused fields), low control accuracy, and slow response speeds. Especially in applications requiring dynamic reconstruction of specific magnetic field patterns, methods relying on manual trial and error or analytical models are inefficient and fail to meet real-time and accuracy requirements. In recent years, using neural networks to establish nonlinear input-output mappings has become an effective means of solving inverse problems in complex physical systems. Existing research has attempted to use neural networks for electromagnetic field prediction, but most studies are limited to the simulation stage, lacking a closed-loop feedback mechanism with the actual hardware system, and failing to achieve automatic optimization of current parameters and online model updates.

[0048] To address the shortcomings of existing technologies, a collaborative architecture of coil array, programmable current control system and deep learning model is constructed to achieve rapid reverse reconstruction and high-precision reproduction of arbitrary magnetic flux density distribution within a spatial target area, thereby improving the intelligence level and engineering practicality of magnetic field generation.

[0049] The core structure of this application includes a coil array, a programmable current control module, and a deep learning module. The coil array is electrically connected to the programmable current control module, which interacts with the deep learning module via a communication interface. The coil array adopts an equally spaced square array structure arranged on a non-magnetic support frame to generate a specific magnetic flux density distribution within a preset spatial target region. This structure supports multi-directional magnetic field superposition and possesses excellent spatial control capabilities. The programmable current control module is used to independently adjust the amplitude and direction of the energized current in each coil of the coil array, achieving precise control over the magnetic field strength, gradient, and spatial morphology. The deep learning module is used to establish a nonlinear mapping relationship between the magnetic field distribution within the spatial target region and the current configuration of the coil array. By training a deep neural network model, it achieves inverse reconstruction and optimal prediction from the target magnetic field to current parameters, overcoming the bottlenecks of traditional methods in terms of real-time performance and complexity.

[0050] This application provides a deep learning-based intelligent magnetic field generator device, which includes: a coil array, a programmable current control module, and a deep learning module; as shown below. Figure 1 As shown, Figure 1 This is a system block diagram of a deep learning-based intelligent magnetic field generator device. The coil array is connected to the programmable current control module, and the programmable current control module is connected to the deep learning module.

[0051] The programmable current control module is used to generate programmable current and adjust the amplitude and direction of the energized current of each coil in the coil array.

[0052] The coil array adopts an equally spaced square array structure, which is used to generate a specific magnetic field distribution in the spatial target region corresponding to the coil array by the programmable current generated by the programmable current control module.

[0053] The deep learning module is used to establish a nonlinear mapping relationship between the magnetic field distribution in the target space region and the coil current configuration of the coil array, thereby realizing magnetic field inverse reconstruction and current parameter prediction.

[0054] Specifically, in this embodiment, this application provides a deep learning-based intelligent magnetic field generator device, aiming to solve the problems of slow response speed, low control accuracy, and reliance on manual debugging in traditional magnetic field generation systems during complex magnetic field reconstruction. This device integrates electromagnetic hardware systems with artificial intelligence algorithms to construct an intelligent magnetic field control platform integrating "perception-decision-execution," achieving automatic inversion and high-precision reproduction from target magnetic field distribution to coil current parameters. It is widely used in electromagnetic compatibility testing, biomagnetic stimulation, geomagnetic environment simulation, and anti-interference assessment of shipborne equipment. The intelligent magnetic field generator device mainly includes three core modules: a coil array, a programmable current control module, and a deep learning module. These three modules form a closed-loop control system through electrical connection and data communication, collaboratively completing the intelligent generation and dynamic optimization of the magnetic field.

[0055] First, the coil array is the physical basis for magnetic field generation. It employs a square array structure with equal spacing arranged on a non-magnetic support frame to ensure spatial symmetry and magnetic field uniformity. This array is used to generate a specific magnetic flux density distribution within a predetermined spatial target region. In this embodiment, the coil array consists of multiple multi-turn conductive coils, preferably made of high-conductivity copper wire to reduce resistance loss and improve magnetic field efficiency. Each coil has defined geometric parameters, including inner diameter, outer diameter, height, and number of turns, and is preferably a symmetrical cylindrical structure to ensure the stability and predictability of the magnetic field distribution. Furthermore, the coil array can be divided into two functional subsystems: an axial central coil group and lateral end coil groups. The axial central coil group, arranged in a 3×3 configuration with a total of 9 coils, is concentrated in the central area of ​​the device. Its main function is to generate the main magnetic field and control the overall magnetic flux intensity and gradient characteristics within the target area. The lateral end coil groups are positioned along the Z-axis at the top and bottom of the coil array. Each group contains 6 independent coils, arranged parallel to and spaced apart from the central coil. Their main function is to simulate the end leakage magnetic field effect generated by electrical equipment such as motors and transformers during operation, enhancing the realism and complexity of the magnetic field shape. More importantly, the axial direction of each coil can be freely switched between the X, Y, and Z axes via a stepper motor-driven rotation mechanism, thus supporting the superposition and control of magnetic fields in any direction within three-dimensional space, significantly improving the system's flexibility and simulation capabilities.

[0056] Secondly, the programmable current control module, as the system's execution unit, is responsible for precisely adjusting the amplitude and direction of the energized current in each coil of the coil array, a crucial step in achieving fine magnetic field control. This module is electrically connected to the coil array, receives control commands from the deep learning module, and converts them into specific current output signals. To achieve high-precision control, this module further includes a current amplitude adjustment unit and a current direction control unit. The current amplitude adjustment unit uses a high-precision digital-to-analog converter chip combined with a low-noise operational amplifier to construct a closed-loop constant current source circuit, enabling continuously adjustable current output within the 0–10A range, with an adjustment resolution of 1mA and output stability better than ±0.5%. This unit can generate analog current signals with corresponding amplitudes in real time based on the digital commands output by the deep learning module, ensuring precise excitation for each coil. The current direction control unit consists of a relay array and an H-bridge drive circuit. It controls the current flow direction through high and low level signals output by the microcontroller, achieving forward and reverse switching of the current in the coil, with a response time of less than 10ms, meeting the requirement of rapid polarity reversal. The entire control module supports multi-channel independent output, possesses good scalability, and can adapt to coil array configurations of different sizes.

[0057] Furthermore, the deep learning module serves as the intelligent brain of this device, undertaking the task of inverse mapping and prediction from the target magnetic field to the current parameters. Based on a large amount of experimental or simulation data, a supervised learning model is used to model the relationship between "input current and output magnetic field," and then, through inverse prediction or optimization inference, the required coil current distribution under a certain target magnetic field curve is obtained. The core function of the deep learning module is to establish a nonlinear mapping relationship between the target magnetic field distribution and the coil current configuration. The magnetic field region is defined as a fixed space Ω, and the magnetic flux density distribution within this region is represented as a vector through n spatial sampling points. Each dimension represents the magnetic flux density modulus or component value (Bx, By, Bz) at the corresponding spatial point. This system contains m controllable coils, whose currents form a current vector. That is, I = [I1, I2, ..., I m The goal of the deep learning module is to fit the following input-output mapping:

[0058]

[0059] Among them B target It is the target magnetic field distribution that the user expects to achieve. Predicted current configuration for driving coil array, F θ It is a nonlinear function (such as a neural network) represented by the parameters of a deep learning model.

[0060] To train this mapping model, a large sample dataset is first generated through simulation or experimental methods. Each sample consists of a coil current configuration I^(i) and its corresponding spatial magnetic field distribution B^(i), generating a sample dataset D = {(B^(i), I^(i))}, where B^(i) is the i-th magnetic field distribution sample, and I^(i) is its corresponding coil current configuration. This dataset is used to train the deep learning model. Since magnetic field data typically has high dimensionality, dimensionality reduction or feature extraction methods can be used to reduce model complexity and enhance generalization ability.

[0061] Traditional methods for solving the inverse field-source problem often rely on complex mathematical modeling or time-consuming optimization algorithms, making it difficult to meet real-time requirements. This module, however, employs deep neural network technology, particularly a hybrid architecture combining Long Short-Term Memory (LSTM) networks and Fully Connected Networks (FCNs), to effectively establish a nonlinear mapping relationship between spatial magnetic field distribution and coil current configuration. Specifically, the deep learning module first constructs a sample dataset of "input current—output magnetic field" based on a large amount of simulation data (generated by COMSOL and Multiphysics) and measured data, forming a structured training database. Subsequently, a supervised learning method is used to train the neural network model: the input layer receives magnetic field feature parameters of the target region (such as the Bx, By, and Bz component sequences along the central axis or 3D mesh sampling values), which, after normalization, are fed into the LSTM layer to capture the spatial dependence and dynamic characteristics of the magnetic field; the intermediate hidden layer contains multiple LSTM units (three layers in this embodiment: 24→72→36 units), followed by a fully connected layer and an output layer, ultimately outputting the required current amplitude and direction combination scheme for each coil. Once the model is trained, it can be used for online prediction: after the user inputs any target magnetic field curve, the system can complete inference within seconds and output a set of approximately optimal current configuration parameters, significantly improving control efficiency. Furthermore, the deep learning module also has model optimization capabilities. By receiving external feedback signals (such as the error between the actual measured magnetic field and the target), it can dynamically adjust network weights using a gradient descent algorithm, achieving online fine-tuning and performance improvement of the model, and enhancing the system's adaptability under different operating conditions.

[0062] Specifically, it should be noted that the deep learning-based intelligent magnetic field generator device provided in this application embodiment achieves a flexible magnetic field generation structure through a coil array, precise current regulation through a programmable current control module, and complex inverse mapping and intelligent decision-making through a deep learning module, forming a highly integrated, closed-loop controllable intelligent system. This device can not only quickly reproduce complex asymmetric and non-uniform magnetic fields with an average error of less than 20% and a response time of less than 60 seconds, but also continuously optimize model performance through transfer learning to adapt to the needs of different application scenarios. Its technological advancement is reflected in the deep integration of software and hardware, intelligent control, and automated operation.

[0063] Furthermore, in this embodiment, the coil array further includes: an axial center coil.

[0064] Group and side end coil group;

[0065] The axial center coil group has a symmetrical cylindrical structure, which is composed of multiple turns of cylindrical coils arranged in a row;

[0066] The side end coil groups are located at the upper and lower ends of the coil array along the Z-axis. Each group contains several coils, which are arranged parallel to and spaced apart from the axial center coil. The axial direction of the coils can be switched to the X / Y / Z axis direction by a stepper motor.

[0067] Specifically, in this embodiment, the coil array in the deep learning-based intelligent magnetic field generator device serves as the core physical unit for magnetic field generation. Its structural design directly determines the system's ability to control the spatial magnetic field distribution and its simulation accuracy. To further enhance the diversity of magnetic field morphology and the degree of freedom in spatial control, this embodiment employs a functional partitioning design for the coil array, specifically including two key subsystems: the axial central coil group and the lateral end coil groups. This double-layer structure not only enhances the spatial coverage of the magnetic field but also significantly improves the simulation capability for complex asymmetric magnetic fields, making it particularly suitable for electromagnetic environment simulation tasks with typical end leakage magnetic field characteristics, such as marine motors, cabinet power supplies, and shipborne electronic equipment.

[0068] First, the axial center coil group adopts a symmetrical cylindrical multi-turn coil structure, arranged in a 3×3 equally spaced square array in the geometric center region of the device. For example... Figure 2 As shown, Figure 2 This is a specific implementation example diagram of a 3×3 coil array. In this embodiment, the inner diameter of a single coil is 22mm, the outer diameter is 25mm, the length is 90mm, and the effective cross-sectional area is 2.5mm². 2The array has 25 turns. Each coil is wound with high-conductivity copper wire, possessing excellent electrical conductivity and thermal stability. Optimized through electromagnetic simulation, this structure can generate a main magnetic field with a peak value of approximately 900 nT in the central target region when a 5A DC current is applied, meeting the requirements for simulating weak magnetic field environments. Since all central coils are arranged along the Z-axis, their main function is to generate a main magnetic flux density distributed along the axial direction, controlling the overall strength, gradient characteristics, and symmetry of the magnetic field. This 3×3 array structure has high spatial resolution and can enhance or weaken the local magnetic field by independently adjusting the current in each coil, thereby constructing a non-uniform magnetic field with specific boundary shapes and gradient structures. For example, by setting different current weights, gradient magnetic fields, focused magnetic fields, or local high-field regions can be simulated, making it widely applicable in scenarios such as biomagnetic particle manipulation and material magnetic anisotropy testing.

[0069] Secondly, the lateral end coil group, an innovative design in this embodiment, further expands the system's magnetic field simulation capabilities. This coil group is symmetrically arranged at the upper and lower ends of the central coil array along the Z-axis. Each end contains six independently controlled multi-turn cylindrical coils, totaling 12 coils forming a complete end control system. These coils are arranged parallel to and spaced apart from the central coil, forming a front-to-back extended magnetic field control link. Its core function is to simulate the end leakage magnetic field effect caused by the non-closed magnetic circuit in real electrical equipment (such as motors, transformers, and switching power supplies) during operation. Traditional Helmholtz or Maxwell coil systems typically only generate highly symmetrical uniform fields, making it difficult to reproduce such asymmetrical, divergent edge magnetic field characteristics. This embodiment, by introducing the end coil group and giving it independent current regulation capabilities, can effectively enhance or weaken the magnetic flux density at the tail of the magnetic field, achieving precise control of the magnetic field "tail" characteristics, thereby faithfully reproducing the external magnetic field distribution of the actual equipment.

[0070] More importantly, this embodiment incorporates a multi-degree-of-freedom axial adjustment mechanism in its structural design. The mounting orientation of all side end coils is not fixed, but rather dynamically switched via a rotating bracket driven by a precision stepper motor (such as a 28BYJ-48 or a higher-end servo motor). Each coil can freely switch between the X, Y, and Z Cartesian coordinate axes with an angle accuracy of ±0.5°. This design allows the coils to not only participate in the main magnetic field construction in the Z-axis direction but also generate transverse magnetic components in the X or Y directions, thus supporting the superposition and synthesis of magnetic fields in any direction within three-dimensional space. For example, when simulating transverse magnetic field disturbances caused by rotor eccentricity, some end coils can be switched to the X-axis direction and a specific current applied to generate local transverse magnetic flux, significantly improving the realism and complexity of the magnetic field simulation.

[0071] Specifically, it should be noted that this embodiment constructs a functionally layered, spatially expanded, and directionally adjustable composite magnetic field generation system by dividing the coil array into an axial central coil group and lateral end coil groups. The central coil group is responsible for constructing the main magnetic field framework, ensuring basic magnetic field performance; the end coil groups focus on simulating edge effects and three-dimensional directional expansion, enhancing the complexity and realism of the magnetic field morphology.

[0072] Furthermore, in this embodiment, the current values ​​of the axial center coil and the side end coil group are in a preset proportional relationship;

[0073] When a 5A DC current is applied to the axial center coil and a 2A current is applied to the side end coil group, an asymmetric magnetic field with a peak value of 900nT and an axial gradient of 35nT / mm is generated in the target spatial region.

[0074] Specifically, in this embodiment, the intelligent magnetic field generator device achieves high-precision control of the spatial magnetic field morphology through a carefully designed current-coordinated control strategy. A key technical feature is the pre-defined proportional relationship between the energized current values ​​of the axial central coil group and the lateral end coil groups. This proportional relationship is not arbitrarily set, but is determined based on a combination of electromagnetic field theory modeling, finite element simulation optimization, and measured data calibration. It aims to precisely control the intensity matching between the main magnetic field and the edge magnetic field, thereby generating an asymmetric magnetic field with specific spatial distribution characteristics to meet the needs of complex electromagnetic environment simulation.

[0075] Specifically, in this embodiment, when a 5A DC current is applied to the axial center coil group and a 2A current is applied to the side end coil group, the system can generate an asymmetric magnetic field distribution with a peak value of approximately 900nT and an axial gradient of approximately 35nT / mm within a preset spatial target area. This magnetic field characteristic is the core manifestation of the device's ability to achieve high-fidelity electromagnetic simulation, and it is particularly suitable for simulating the external magnetic field environment generated by actual equipment such as ship propulsion motors, shipborne power cabinets, and large transformers during operation. Due to the asymmetry of the magnetic circuit structure and the divergence of magnetic flux at the iron core ends, the external magnetic field of such equipment usually exhibits obvious non-uniformity and directionality, which is difficult to reproduce by traditional uniform field coil systems. This embodiment effectively solves this problem by introducing a current proportional control mechanism. From a physical perspective, the axial center coil group, as the main magnetic field generating unit, is mainly responsible for establishing a basic magnetic flux density field in the central region of the device. Its 3×3 array structure can generate a relatively uniform Z-axis magnetic field under symmetrical energization conditions; however, when the side end coil group is introduced and currents of different amplitudes are applied, the magnetic field distribution of the entire system will change significantly. The lateral end coils are located at the upper and lower ends of the central array. When energized, the magnetic flux they generate will superimpose and couple with the main magnetic field in the central region. Because the end coils are far from the target area and are offset, the magnetic field they generate is weaker in the central region, but forms a strong magnetic flux "tail" at both ends in the axial direction (Z direction), thereby breaking the symmetry of the original magnetic field and forming a gradient field that gradually decays along the axial direction.

[0076] By setting a preset ratio (5:2) of 5A for the central coil current and 2A for the end coil current, the system achieves optimal matching between the main magnetic field and the edge magnetic field. If the end current is too small, the edge magnetic flux will be insufficient, failing to effectively simulate the leakage magnetic effect; if it is too large, it may lead to magnetic field distortion or local saturation. Experimental and simulation results show that the combination of 5A and 2A can ensure that the main magnetic field strength reaches 900nT while making the magnetic field exhibit a stable negative gradient change along the Z-axis. The measured axial gradient is approximately 35nT / mm, which conforms to the typical characteristics of the external magnetic field of most industrial equipment. This gradient value means that for every 1 mm of axial movement, the magnetic induction intensity decreases by approximately 35 nanotesla, forming a slowly decaying asymmetric field shape, which is widely present in the axial magnetic field distribution of rotating motors.

[0077] Furthermore, this preset current ratio can be flexibly configured via host computer software, allowing users to adjust the ratio parameters according to different simulation requirements. For example, a higher center / end current ratio (e.g., 10:1) can be used to emphasize the main magnetic field when simulating small electronic devices; while a lower ratio (e.g., 2:1) can be used to enhance the influence of the edge magnetic field when simulating large power equipment. In addition, this ratio can also be automatically optimized by the deep learning module based on the target magnetic field curve without manual intervention, demonstrating the system's intelligence level. To verify the magnetic field performance under this current combination, multiple rounds of experimental tests were conducted in this embodiment. A high-precision Hall sensor array (measurement accuracy ±5nT) was used to measure the distribution of the magnetic field Bx component point by point along the central axis (keel line) of the device. The test results show that the peak magnetic field at Z = 0 mm is close to 900 nT. As |Z| increases, the magnetic field strength exhibits an exponential decay trend, with a fitting curve slope of approximately -35 nT / mm, highly consistent with the design target. Simultaneously, the transverse magnetic field components (By, Bz) remain at a low level, indicating that the system has good directional selectivity and spatial focusing capability. The generation of this asymmetric magnetic field relies not only on the hardware structure but also on a collaborative hardware and software control mechanism. The programmable current control module precisely executes 5A and 2A current commands, ensuring stable current output from each coil. The deep learning module predicts the optimal current combination based on historical data and can fine-tune the proportional relationship in real time through closed-loop feedback to compensate for deviations caused by non-ideal factors such as temperature drift and aging. Specifically, this embodiment successfully generated an asymmetric magnetic field with a peak value of 900 nT and an axial gradient of 35 nT / mm under typical operating conditions of 5A and 2A by setting a preset current ratio between the axial center coil and the side end coil groups. This design overcomes the limitation of traditional magnetic field generators that can only generate symmetrical or uniform fields, significantly improving the system's ability to simulate real electromagnetic environments. Its technical value lies in its ability to reproduce the external magnetic field characteristics of complex systems such as ship motors and power supply equipment; the proportional relationship supports customization and automatic optimization, adapting to various application scenarios.

[0078] Furthermore, in this embodiment, the programmable current control module further includes: a current amplitude adjustment unit and a current direction control unit;

[0079] The current amplitude adjustment unit adopts a closed-loop feedback circuit composed of a digital-to-analog converter chip and a precision operational amplifier, which can realize continuous adjustment of the current in the range of 0-10A. By receiving the current amplitude command output by the deep learning module, the current amplitude command is converted into an analog current signal with the corresponding amplitude.

[0080] The current direction control unit consists of a relay array and an H-bridge drive circuit. It controls the on / off state of the relay array through high and low level signals to achieve bidirectional switching of the coil current direction.

[0081] Specifically, in this embodiment, the programmable current control module of the intelligent magnetic field generator device serves as the core bridge connecting "intelligent decision-making" and "physical execution," comprising two core sub-units: a current amplitude adjustment unit and a current direction control unit. This constitutes a complete two-degree-of-freedom current drive system, supporting current output of arbitrary amplitude and direction from 0 to 10A, fully meeting the dynamic control requirements of complex magnetic field generation for excitation signals. First, the current amplitude adjustment unit is responsible for achieving continuous and precise adjustment of the coil current intensity. Its core function is to receive digital current commands from the deep learning module via the CAN bus and convert them into analog current signals of corresponding amplitude, applying them to the target coil. To ensure adjustment accuracy and output stability, this embodiment employs a closed-loop constant current source circuit structure composed of a digital-to-analog converter (DAC) chip and a precision operational amplifier. Specifically, the system uses a high-resolution, low-noise DAC (such as TI's DAC8563 or ADI's AD5761), supporting 16-bit resolution, and achieving 1mA-level adjustment accuracy within the 0–10A range, meeting the control requirements for minute current changes in weak magnetic field environments. The DAC chip receives digital instructions from the main control unit (such as an STM32F407 or FPGA) and converts them into a reference voltage signal. This voltage signal is then input to a power drive stage composed of low-drift, high-bandwidth precision operational amplifiers (such as OPA548, LT1210, or LM7171), forming a voltage-to-current converter (VI Converter). This circuit monitors the output current in real time through a feedback resistor network and sends the sampled signal back to the negative feedback terminal of the operational amplifier, forming a closed-loop control circuit. This effectively suppresses the effects of power supply fluctuations, temperature drift, and load changes, ensuring that the long-term stability of the output current is better than ±0.5%. In addition, the unit is equipped with overcurrent protection, short-circuit protection, and thermal shutdown mechanisms to improve system safety and reliability. In actual operation, when the deep learning module predicts that a coil needs a current of 4.37A, the main control chip converts this value into a corresponding digital codeword, outputs a reference voltage through the DAC, and then drives the power transistor (such as a MOSFET or Darlington transistor) to apply a precise 4.37A DC current to the coil, achieving milliampere-level fine control of the magnetic field strength.

[0082] Secondly, the current direction control unit is responsible for bidirectional switching of the current flow direction in the coil, i.e., controlling the reversal of the magnetic field polarity. During complex magnetic field reconstruction, different coils may need to generate magnetic fluxes in opposite directions to achieve local cancellation or gradient enhancement; therefore, flexible control of the current direction is crucial. This embodiment employs a hybrid control architecture combining a relay array and an H-bridge drive circuit, balancing control reliability and response speed. For low-frequency applications (such as static or slowly varying magnetic field generation), the system uses an electromagnetic relay array to achieve current direction switching. Each coil is equipped with a set of double-pole double-throw relays. The microcontroller outputs high and low level signals to control the on / off state of the relay coil, thereby changing the connection relationship between the positive and negative terminals of the power supply and the two ends of the coil in the main circuit, achieving a physical reversal of the current direction. Relays have advantages such as low on-resistance, good isolation performance, and strong anti-interference capability, making them suitable for high-current, low-frequency switching scenarios. For applications requiring rapid polarity reversal (such as dynamic magnetic field scanning or pulse field generation), the system uses an H-bridge drive circuit (such as an integrated chip L298N, DRV8876, or a full-bridge circuit built with discrete components). The H-bridge consists of four power switches forming an "H"-shaped topology. By controlling the on / off state of the diagonal switches, four operating modes can be flexibly implemented: forward current flow, reverse current flow, braking, or free rotation. The microcontroller precisely controls the switching sequence of the H-bridge via PWM signals or logic levels, achieving millisecond-level switching of current direction with a response time of less than 10ms, meeting the requirements for high-frequency magnetic field regulation. Both schemes can be selected and enabled in the host computer software according to application requirements, enabling intelligent configuration of the control strategy.

[0083] Furthermore, the programmable current control module in this embodiment adopts a multi-channel independent control architecture, meaning each coil is equipped with independent amplitude adjustment and direction control circuits, ensuring that the current parameters of each coil can be set independently without interference. Taking a 3×3 center coil group plus 12 end coils as an example, the system needs to support current drive for a total of 18 independent channels. The main control unit manages the instruction issuance and status feedback of all channels through time-division multiplexing or multi-bus methods, ensuring control synchronization and real-time performance. All channels have current sampling and status monitoring functions, and the actual output current can be read in real time through ADC and uploaded to the deep learning module for closed-loop correction, forming an intelligent control closed loop of "prediction-execution-feedback-optimization". The design of this programmable current control module not only improves the accuracy and flexibility of current regulation, but also deeply couples with the intelligent goals of the system. The current configuration parameters (including amplitude and direction encoding) output by the deep learning module can be directly mapped to control commands, and the automatic loading of complex current sequences can be completed without manual intervention. Experiments show that when generating an asymmetric magnetic field, the system can accurately execute the combined command of the central coil 5A in the forward direction and the end coil 2A in the reverse direction, successfully reproducing the target magnetic field distribution and verifying the high reliability and coordination capability of the control module.

[0084] This embodiment achieves precise, multi-dimensional control of the coil excitation signal by constructing a programmable current control module that includes a current amplitude adjustment unit and a current direction control unit. The amplitude adjustment unit adopts a closed-loop structure of DAC and operational amplifier to ensure high accuracy and stability of the current output; the direction control unit integrates relay and H-bridge technology, balancing reliability and response speed. The synergistic effect of these two components enables the system to generate complex, dynamic, and asymmetric magnetic fields, providing a solid hardware foundation for the high-fidelity simulation function of the intelligent magnetic field generator.

[0085] Furthermore, in this embodiment, the deep learning module further includes: a data storage unit, a deep neural network model, an inverse mapping unit, and a model optimization unit;

[0086] The data storage unit is used to store sample datasets of coil current configuration and corresponding spatial magnetic field distribution, including simulation calculation data and measured data of the device, to construct a magnetic field-current correlation database;

[0087] The deep neural network model adopts a combination structure of a long short-term memory network with multiple hidden layers and a fully connected network. The input layer receives the magnetic field feature parameters of the spatial target region, the intermediate layer processes the high-dimensional mapping relationship between the magnetic field and the current through nonlinear transformation, and the output layer outputs the current configuration parameters of the coil array.

[0088] The reverse mapping unit, based on a trained deep neural network model, directly outputs a combination scheme of current amplitude and direction for each coil that satisfies the magnetic field distribution by inputting magnetic flux density distribution data of the target magnetic field.

[0089] The model optimization unit is used to receive the error signal between the actual magnetic field and the target magnetic field fed back by the magnetic field measurement module, and dynamically adjusts the weight parameters of the deep neural network model using the gradient descent algorithm to achieve online iterative optimization of the model.

[0090] Specifically, in this embodiment, the deep learning module includes four functional units: a data storage unit, a deep neural network model, an inverse mapping unit, and a model optimization unit. This module, through hardware and software collaboration, achieves efficient modeling and dynamic optimization of the nonlinear mapping relationship between the magnetic field and current.

[0091] First, the data storage unit is the data foundation of the entire deep learning system, used to build a structured "magnetic field-current" correlation database. Data sources include two aspects: one is electromagnetic simulation data, which uses finite element software such as COMSOL and Multiphysics to perform 3D modeling of the coil array, simulating the magnetic field distribution under different current combinations, generating large-scale, noise-free training samples; the other is actual device measurement data, which uses a Hall sensor array to collect actual magnetic field values ​​during real-world operation, supplementing non-ideal factors in the real environment (such as temperature drift, structural deviations, and electromagnetic interference). All data, after normalization, denoising, and labeling, is stored in the database, forming a training and validation set covering a wide range of operating conditions, providing high-quality data support for subsequent model training.

[0092] Secondly, deep neural network models are the core algorithmic carrier for solving the inverse field-source problem. This embodiment adopts a hybrid structure combining Long Short-Term Memory (LSTM) networks and Fully Connected Networks (FCNs) to fully adapt to the spatial sequence characteristics of magnetic field distribution. Specifically, the input layer receives magnetic field feature parameters of the target region, such as the Bx component sequence along the central axis or three-dimensional grid sampling values; the LSTM layer, as a hidden layer, contains multiple memory units, which can capture the spatial dependence and dynamic change trend in the magnetic field data and effectively handle high-dimensional and nonlinear mapping relationships; the intermediate layer consists of multiple fully connected networks, which further extract abstract features and perform nonlinear transformations; the output layer directly outputs the current amplitude and direction codes required by each coil (e.g., ±1 indicates forward / reverse). The preferred model structure is: Input layer (24-dimensional) → LSTM hidden layer 1 (24 units) → LSTM hidden layer 2 (72 units) → LSTM hidden layer 3 (36 units) → Fully connected layer (18 units, ReLU activation) → Output layer (9 units, Tanh activation), which is suitable for current prediction tasks of a 9-coil system. Supervised learning was employed during training, using mean squared error (MSE) as the loss function, Adam as the optimizer, a batch size of 24, a learning rate of 1e-2, and 100 training epochs until the validation set loss converged. After pre-training on a large amount of simulation and experimental data, the model exhibited strong generalization ability, capable of predicting current configuration within seconds, a response speed tens of times faster than traditional finite element inversion methods. The model training objective was to minimize the predicted current. The mean square error between the actual current I and the mean square error is:

[0093]

[0094] Where θ represents the model parameters (including weights and biases), and N is the number of training samples. The optimization process uses backpropagation with stochastic gradient descent (SGD), Adam, and other optimizers. After training, this module supports online prediction: the user inputs any target magnetic field distribution B. target(This can be a magnetic flux density modulus distribution curve, spatial multi-point sampling values, or a graphical representation), and the model immediately outputs a set of approximately optimal current parameters. This is used to control the current in each coil of the actual hardware, thereby reconstructing the required magnetic field within the target region Ω. To further improve control accuracy, the system supports a closed-loop feedback structure, that is, acquiring the actual magnetic flux density distribution through real-time magnetic field measurement (Hall sensor array) and comparing it with B. target After comparison, the error can be fed back into the training system to enable online fine-tuning of the model or error correction.

[0095] Furthermore, the inverse mapping unit, based on a trained deep neural network model, achieves end-to-end inference from the target magnetic field to current parameters. After the user imports the target magnetic field curve (such as a CSV file or function expression) via the host computer, the system automatically calls this unit to preprocess the target magnetic field data into an input format recognizable by the model, feed it into the neural network for forward propagation calculation, and directly output a set of combinations of coil current amplitudes and directions that satisfy the magnetic field distribution. Figure 3 As shown, Figure 3 The diagram illustrates the magnetic field strength distribution along the x-axis of a 3×3 device with each coil subjected to a current of 0.45A. When the target is an asymmetric magnetic field with a peak value of 900nT and a gradient of 35nT / mm, the reverse mapping unit can quickly output the optimal configuration of 5A for the center coil and 2A for the end coils, without the need for manual trial and error or complex optimization.

[0096] More importantly, the model optimization unit endows the system with adaptive and continuous evolution capabilities. Due to differences between the simulation environment and the real physical system (such as material nonlinearity, temperature effects, and assembly errors), pre-trained models may exhibit prediction biases in practical applications. To address this, this embodiment introduces a closed-loop feedback mechanism. The model optimization unit receives the error signal between the actual magnetic field and the target magnetic field from the magnetic field measurement module in real time. It then uses a gradient descent algorithm (such as SGD or Adam) to backpropagate the error and dynamically adjust the weight parameters of the deep neural network model, achieving online fine-tuning and iterative optimization. This process can be automatically triggered after each magnetic field reproduction, gradually reducing the prediction error and improving the model's adaptability to the current equipment. Experiments show that after 3–5 rounds of closed-loop correction, the average error can be reduced from over 20% initially to less than 5%, significantly improving control accuracy. Furthermore, this embodiment also supports transfer learning mechanisms. During model optimization, the parameters of the first two LSTM layers can be frozen (preserving general feature extraction capabilities), and only the third LSTM layer, the fully connected layer, and the output layer can be fine-tuned. This preserves the model's generalization ability while accelerating convergence, making it suitable for rapid recalibration after equipment aging or environmental changes. This embodiment achieves a complete closed loop from "data-driven" to "intelligent decision-making" and then to "self-evolution" by constructing a deep learning module that includes four major units: data storage, neural networks, inverse mapping, and model optimization.

[0097] Furthermore, in this embodiment, the device further includes: a magnetic field curve import and preprocessing module and a power supply module;

[0098] The magnetic field curve import and preprocessing module is connected to the host computer and is used to receive the target magnetic field parameters input by the user and perform noise filtering, outlier correction and data normalization.

[0099] The magnetic field curve import and preprocessing module is also used to feed back the error between the actual measured magnetic field and the target magnetic field to the deep learning module, so as to realize online fine-tuning and accuracy correction of the target magnetic field, and make the average error of magnetic field generation less than 20%.

[0100] The power module is connected to the device module, and the power module converts mains power to provide the required voltage to the device.

[0101] Specifically, in this embodiment, the intelligent magnetic field generator device further integrates a magnetic field curve import and preprocessing module and a power supply module, serving as indispensable functional support units for the complete operation of the system. These two modules respectively undertake the key tasks of "user interaction—data preparation" and "energy supply—system power supply." First, the magnetic field curve import and preprocessing module acts as a bridge connecting the user and the system's intelligent core, responsible for converting the user-defined target magnetic field parameters into a standard input format suitable for deep learning model inference. This module achieves data interaction with the host computer control interface through a communication interface, supporting various target magnetic field input methods, including: CSV / Excel data files, MATLAB script output, image contour extraction, etc., greatly improving the system's compatibility and flexibility. Users can directly draw or import the target magnetic field distribution curve in the graphical interface, and the system automatically parses it into a discrete sampling point sequence along the spatial coordinate axis (such as the Z-axis), serving as the basic data for subsequent processing. However, the original input data often contains noise, outliers, or inconsistent formats, directly affecting the prediction accuracy of the deep learning module. Therefore, this module incorporates a complete signal preprocessing algorithm chain to ensure the quality and consistency of the input data. The specific processing flow includes:

[0102] Noise filtering: Wavelet transform or low-pass filter is used to remove high-frequency random noise while preserving the main trend characteristics of the magnetic field distribution;

[0103] Outlier correction: Based on statistical methods (such as the 3σ criterion or IQR quartile method), identify and correct data points that deviate significantly from the normal range to prevent incorrect input from causing abnormal current configuration;

[0104] Data normalization: Map the magnetic field strength values ​​to the range of [0,1] or [-1,1] to eliminate dimensional differences and improve the convergence speed and prediction stability of deep neural network models;

[0105] Interpolation and resampling: Linear or spline interpolation is performed on non-uniformly sampled data to unify it into a sequence with fixed intervals, which meets the model input dimension requirements.

[0106] After the above preprocessing, the target magnetic field data is converted into a standardized feature vector and fed into the inverse mapping unit of the deep learning module to generate initial coil current configuration parameters. More importantly, this module not only serves as the "forward input" function but also possesses closed-loop feedback and online correction capabilities. During the magnetic field generation process, the Hall sensor array acquires the actual magnetic field distribution in real time. The system compares the measured values ​​with the target values ​​and calculates error indices (such as root mean square error RMSE, maximum absolute error, or correlation coefficient R0). 2The error signal is received by the magnetic field curve import and preprocessing module and fed back to the model optimization unit of the deep learning module, triggering online fine-tuning of model parameters or iterative updates of current configuration. For example, when the measured peak magnetic field is 880 nT and the target is 900 nT, the system automatically judges the error to be 2.2%. If it exceeds the set threshold, a compensation mechanism is activated, adjusting the center coil current from 5A to 5.12A until the error converges. Through multiple rounds of feedback correction, the system can control the average error of magnetic field generation to within 20%, and further reduce it to below 5% after closed-loop optimization, significantly improving the reproduction accuracy and system robustness. In addition, this module also supports error visualization and log recording functions. The host computer interface can display the target curve, measured curve, and error trend graph in real time, facilitating user monitoring of system performance; all operating parameters, error data, and correction processes are automatically saved, forming a traceable experimental report.

[0107] Secondly, the power module, as the energy hub of the entire device, is responsible for providing stable and safe DC power to all electronic and electromagnetic components. This module connects to the mains power (AC 220V / 50Hz) and incorporates a high-efficiency AC-DC switching power supply unit, converting AC power into multiple DC voltages required by the system, primarily: ±15V (for precision operational amplifiers and analog circuits), +5V (for microcontrollers, relay drivers, and digital logic circuits), and +3.3V (for sensors, FPGAs, and communication chips). The power supply design adopts a wide input range (AC 100–240V) and high conversion efficiency (>85%) architecture, adapting to different national power grid standards, and is equipped with multiple safety mechanisms such as overvoltage protection, overcurrent protection, short-circuit protection, and overtemperature protection to ensure reliability during long-term operation. To cope with voltage fluctuations caused by high-current loads, the power module also integrates large-capacity filter capacitors and low-noise voltage regulator circuits (LDOs) to effectively suppress ripple and electromagnetic interference, ensuring the stability of the programmable current control module's output. Meanwhile, to support high-power coil driving, the system is equipped with an independent constant current source power supply branch, with a maximum output current of up to 10A, meeting the peak magnetic field generation requirements. In summary, the introduction of the magnetic field curve import and preprocessing module and the power supply module enables this intelligent magnetic field generator device to possess complete user interaction capabilities, data processing capabilities, error correction capabilities, and energy supply capabilities.

[0108] Furthermore, in this embodiment, the device further includes: a magnetic field measurement module;

[0109] The magnetic field measurement module is connected to the device module. The magnetic field measurement module is composed of a Hall sensor or a three-axis fluxgate sensor and is used to collect the actual magnetic flux density distribution data of the target area.

[0110] Specifically, in this embodiment, the intelligent magnetic field generator device further integrates a magnetic field measurement module, serving as a key sensing unit for achieving high-precision magnetic field generation and closed-loop control. This module is connected to other functional modules of the device via electrical and communication interfaces, forming a complete "sensing-decision-execution" feedback chain. The magnetic field measurement module mainly consists of a Hall sensor array, arranged in a multi-point distributed manner to cover the entire target magnetic field space. Based on the Hall effect principle, the Hall sensor can convert the magnetic induction intensity perpendicularly passing through its sensitive surface into a voltage signal, offering advantages such as fast response speed, good linearity, small size, and low cost, making it particularly suitable for precise measurement of DC and low-frequency magnetic fields. In this embodiment, a high-precision, low-noise linear Hall sensor, such as Allegro A1324, Texas Instruments TMAG5170, or a more advanced triaxial digital Hall sensor (such as Honeywell HMC5883L, ST LIS3MDL), is selected. Its measurement range covers ±1000nT to ±10mT, with a resolution of 0.1nT, an accuracy better than ±5nT, and a frequency response of up to 1kHz, which fully meets the high-sensitivity detection requirements in weak magnetic field environments.

[0111] To achieve comprehensive sensing of the three-dimensional magnetic field, the Hall sensor array adopts a three-dimensional grid layout. Specifically, the sensors are fixed on a non-magnetic support and arranged in a regular array along the X, Y, and Z directions, forming a three-dimensional measurement field surrounding the central region of the coil array. For example, within a spherical or cubic target area with a diameter of 20 cm, 64 sensor nodes are evenly distributed, achieving a spatial resolution of 1 cm. 3 The sensor array is capable of triaxial (Bx, By, Bz) measurement, simultaneously acquiring vector magnetic field information at various points to reconstruct a complete three-dimensional magnetic flux density distribution map. This high-density sampling structure significantly enhances the system's ability to capture magnetic field gradients, distortions, and asymmetric features, providing rich data support for subsequent analysis and control. The sensor array can be connected to the main control unit (FPGA or embedded computer) via a CAN bus to achieve high-speed data acquisition and transmission. The system employs a synchronous sampling mechanism to ensure that all sensors complete data reading at the same time, avoiding measurement errors introduced by timing deviations. The acquired raw voltage signal is converted from analog to digital, and then temperature compensation, zero-point calibration, and nonlinear correction are performed by the embedded software to convert it into a standard magnetic flux density value (in nT or μT), which is then uploaded to the deep learning module and the host computer monitoring system via the communication interface.

[0112] Furthermore, in this embodiment, to achieve the above objectives, this application also proposes a deep learning-based intelligent magnetic field generator control method, applied to any of the above-mentioned devices, the method comprising the following steps:

[0113] S1: Import the target magnetic field distribution data through the host computer control interface, and perform noise removal, outlier correction and normalization processing through the magnetic field curve import and preprocessing module.

[0114] S2: The deep learning module calls the pre-trained learning model, inputs the pre-processed target magnetic field characteristics, and outputs the initial current configuration parameters of the coil array;

[0115] S3: The programmable current control module adjusts the current amplitude and direction of each coil according to the current configuration parameters, driving the coil array to generate a magnetic field;

[0116] S4: The magnetic field measurement module collects the actual magnetic field distribution of the target area and calculates the error between it and the target magnetic field.

[0117] S5: If the error is greater than 5%, the error signal is fed back to the deep learning module, the model parameters are fine-tuned and the current configuration is updated using the gradient descent method, and the process returns to S3; if the error is less than or equal to 5%, the magnetic field reproduction is completed and an experimental report containing error analysis and parameter logs is generated.

[0118] Specifically, in this embodiment, this application further proposes a deep learning-based intelligent magnetic field generator control method. This method is applied to any of the aforementioned intelligent magnetic field generator devices, fully utilizing the functional integration and data interaction capabilities of the various modules within the device to construct a full-link intelligent control process from target input to magnetic field reproduction. The control method includes the following five key steps:

[0119] S1: Target Magnetic Field Import and Preprocessing. Users import target magnetic field distribution data through the host computer control interface. Input formats are flexible and diverse, supporting function expressions, CSV / Excel data files, MATLAB output, or image contour extraction. After import, the data is sent to the magnetic field curve import and preprocessing module for standardization. This module performs a series of signal processing operations: first, wavelet transform or low-pass filter is used to remove high-frequency noise; second, outliers are identified and corrected based on the 3σ criterion; finally, the magnetic field strength is normalized (e.g., mapped to the [0,1] interval) to eliminate dimensional influence. The processed data forms a structured "target magnetic field feature vector," which serves as input to the deep learning model, ensuring the accuracy and stability of subsequent inference.

[0120] S2: Initial Current Parameter Prediction. The deep learning module calls a pre-trained deep neural network model (such as an LSTM-FCN hybrid network), takes the preprocessed target magnetic field characteristics as input, performs forward propagation calculations, and outputs a set of initial coil current configuration parameters. This model has been trained on a large amount of simulation and measured data, establishing a nonlinear inverse mapping relationship between "magnetic field distribution → current configuration". The output parameters include the current amplitude of each coil (e.g., continuously adjustable from 0 to 10A) and direction encoding (+1 indicates forward, -1 indicates reverse). This process can be completed within seconds, far faster than the minutes-level computation time required by traditional finite element inversion or optimization algorithms, significantly improving the system response efficiency.

[0121] S3: Current Loading and Magnetic Field Generation. The programmable current control module receives current configuration commands from the deep learning module and precisely adjusts the energizing state of each coil through its internal current amplitude adjustment unit (based on a DAC + op-amp closed-loop circuit) and current direction control unit (relay array or H-bridge drive). Each coil receives a DC current of corresponding amplitude and direction according to the command, driving the coil array to generate an initial magnetic field within a preset spatial target area. This process achieves precise conversion from digital commands to physical magnetic fields and is the execution link in the control chain.

[0122] S4: Actual magnetic field measurement and error calculation. The magnetic field measurement module (composed of a Hall sensor array) acquires real-time data on the actual magnetic flux density distribution in the target area. The sensor operates with high spatial resolution (e.g., 1 cm). 3 The system acquires the Bx, By, and Bz components at each point with high time synchronization and uploads the data to the main control system. The system then compares the measured magnetic field point-by-point with the target magnetic field set in S1, calculating error indices, including root mean square error (RMSE), maximum absolute error (Max Error), or spatial correlation coefficient (R²). 2 This leads to a quantitative assessment result. This error reflects the current level of accuracy in magnetic field reproduction and is a key basis for determining whether further optimization is needed.

[0123] S5: Closed-loop feedback and termination judgment. The system judges whether the error is greater than a preset threshold (5% in this embodiment). If the error > 5%, the error signal is fed back to the model optimization unit of the deep learning module. The gradient descent algorithm is used to backpropagate the error, fine-tune the weight parameters of the neural network model, and re-output the optimized current configuration parameters. The system returns to S3 to generate a new round of magnetic field, forming a closed-loop iterative optimization. This process can be repeated 2–5 times until the error converges. If the error ≤ 5%, the magnetic field is judged to be successfully reproduced. The system automatically stops iterating, enters the completion stage, generates an experimental report containing information such as error analysis curves, parameter logs, running time, and number of corrections, and saves the running data to the database for subsequent querying and model training. Taking the magnetic field generated by 9 coils as an example, the current in the coil can be calculated through deep learning by inputting the magnetic field data. Figure 4 As shown, Figure 4 This is a comparison chart of the coil current obtained through learning and the actual input current. The core advantage of this control method lies in the construction of an intelligent closed-loop control system of "prediction-execution-measurement-feedback-optimization". The deep learning module provides a fast initial solution, avoiding the slow convergence problem of traditional optimization algorithms; the closed-loop feedback mechanism continuously corrects the prediction deviation through measured data, ensuring high accuracy of the final result. Experiments show that when generating an asymmetric magnetic field with a peak value of 900 nT and a gradient of 35 nT / mm, the system can reduce the error from the initial 18% to 4.2% on average within 3 rounds, with a response time of less than 60 seconds, meeting the real-time requirements of scientific research and engineering applications.

[0124] Furthermore, in this embodiment, the method further includes a model transfer learning step:

[0125] The measurement data obtained by the magnetic field generator device during actual operation is used to perform transfer learning on the pre-trained model in the deep learning module.

[0126] During the transfer learning process, only the parameters of the third LSTM hidden layer, subsequent fully connected layers, and the output layer in the deep neural network are fine-tuned.

[0127] When the mean square error between the predicted magnetic field curve and the measured magnetic field curve is less than 20%, stop fine-tuning, save and enable the updated model as the new prediction benchmark.

[0128] Specifically, in this embodiment, traditional deep learning models are typically trained on simulation data. Although they possess good theoretical generalization capabilities, their performance often degrades after deployment on real devices due to the gap between simulation and reality. This gap mainly stems from practical factors such as coil winding errors, material permeability nonlinearity, temperature drift, power supply fluctuations, sensor noise, and structural assembly deviations, which are difficult to fully model in simulation. To overcome this challenge, this embodiment proposes a transfer learning strategy based on measured data. By feeding real operating data back into the model training, the prediction error is gradually reduced, improving the system's adaptation accuracy on specific devices. Specifically, the transfer learning steps include the following three core components:

[0129] First, actual data collection and database construction.

[0130] In each magnetic field reproduction experiment, the system automatically records the input target magnetic field, the predicted current output by the deep learning module, the actual current executed by the programmable current control module, and the measured magnetic field distribution collected by the magnetic field measurement module. These "prediction-measurement" paired data are structured and stored in a local database, forming a high-quality transfer learning dataset. After denoising, alignment, and labeling, the data serves as training samples for transfer learning, ensuring a clear input-output relationship and quantifiable errors.

[0131] Second, the hierarchical parameter fine-tuning strategy

[0132] To avoid the computational overhead and overfitting risk of full model retraining, this embodiment employs a transfer learning architecture of layered freezing and selective fine-tuning. The specific operations are as follows:

[0133] The parameters of the first two LSTM hidden layers are frozen: the first layer (24 units) and the second layer (72 units). LSTM is mainly used to extract general spatiotemporal features of magnetic field data (such as trends, periodicity, and gradient changes). These features have high consistency between simulation and actual measurement. Therefore, their weights are kept unchanged to preserve the general representation ability of the model.

[0134] By fine-tuning only the third LSTM hidden layer (36 units), subsequent fully connected layers (18 units), and the output layer (9 units), these higher-level networks, responsible for mapping abstract features to specific current configuration parameters, are more sensitive to device specificity. By adjusting only the weights of these layers, the model can quickly adapt to the non-ideal characteristics of the current device while retaining its general capabilities, achieving "personalized calibration." This strategy significantly reduces the number of training parameters (only about 30% are adjustable), improves training efficiency, and reduces the risk of overfitting.

[0135] Third, training process and termination conditions

[0136] Transfer learning is automatically initiated during device idle periods or in the background. The system randomly selects a batch of measured samples from the database, using the measured magnetic field as input and the corresponding target current as the label, for supervised fine-tuning. The optimizer employs the Adam algorithm with a learning rate of 1e-4 and a batch size of 16. After each training round, the model's predictive performance on the validation set is evaluated. During training, the system continuously calculates the mean square error (MSE) between the model's predicted magnetic field curve and the actual measured curve. When this error drops below 20%, the model is deemed sufficiently adapted to the current device state, and the fine-tuning process stops. At this point, the system automatically saves the updated model weights and sets them as the new prediction baseline model for all subsequent magnetic field generation tasks.

[0137] It should be particularly noted that, through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, or of course, by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A deep learning-based intelligent magnetic field generator device, characterized in that, The device includes: a coil array, a programmable current control module, and a deep learning module; The coil array is connected to the programmable current control module, and the programmable current control module is connected to the deep learning module; The programmable current control module is used to generate programmable current and adjust the amplitude and direction of the energized current of each coil in the coil array. The coil array adopts an equally spaced square array structure, which is used to generate a specific magnetic field distribution in the spatial target region corresponding to the coil array by the programmable current generated by the programmable current control module. The deep learning module is used to establish a nonlinear mapping relationship between the magnetic field distribution in the target space region and the coil current configuration of the coil array, thereby realizing magnetic field inverse reconstruction and current parameter prediction.

2. The intelligent magnetic field generator device based on deep learning according to claim 1, characterized in that, The coil array further includes: an axial central coil group and lateral end coil groups; The axial center coil group has a symmetrical cylindrical structure, which is composed of multiple turns of cylindrical coils arranged in a row; The side end coil groups are located at the upper and lower ends of the coil array along the Z-axis. Each group contains several coils, which are arranged parallel to and spaced apart from the axial center coil. The axial direction of the coils can be switched to the X / Y / Z axis direction by a stepper motor.

3. The intelligent magnetic field generator device based on deep learning according to claim 2, characterized in that, The current values ​​of the axial center coil and the side end coil group are in a preset proportional relationship; When a 5A DC current is applied to the axial center coil and a 2A current is applied to the side end coil group, an asymmetric magnetic field with a peak value of 900nT and an axial gradient of 35nT / mm is generated in the target spatial region.

4. The intelligent magnetic field generator device based on deep learning according to claim 1, characterized in that, The programmable current control module further includes: a current amplitude adjustment unit and a current direction control unit; The current amplitude adjustment unit adopts a closed-loop feedback circuit composed of a digital-to-analog converter chip and a precision operational amplifier, which can realize continuous adjustment of the current in the range of 0-10A. By receiving the current amplitude command output by the deep learning module, the current amplitude command is converted into an analog current signal with the corresponding amplitude. The current direction control unit consists of a relay array and an H-bridge drive circuit. It controls the on / off state of the relay array through high and low level signals to achieve bidirectional switching of the coil current direction.

5. The intelligent magnetic field generator device based on deep learning according to claim 1, characterized in that, The deep learning module also includes: a data storage unit, a deep neural network model, an inverse mapping unit, and a model optimization unit; The data storage unit is used to store sample datasets of coil current configuration and corresponding spatial magnetic field distribution, including simulation calculation data and measured data of the device, to construct a magnetic field-current correlation database; The deep neural network model adopts a combination structure of a long short-term memory network with multiple hidden layers and a fully connected network. The input layer receives the magnetic field feature parameters of the spatial target region, the intermediate layer processes the high-dimensional mapping relationship between the magnetic field and the current through nonlinear transformation, and the output layer outputs the current configuration parameters of the coil array. The reverse mapping unit is based on a trained deep neural network model. By inputting the magnetic flux density distribution data of the target magnetic field, it directly outputs a combination scheme of current amplitude and direction of each coil that satisfies the magnetic field distribution. The model optimization unit is used to receive the error signal between the actual magnetic field and the target magnetic field fed back by the magnetic field measurement module, and dynamically adjusts the weight parameters of the deep neural network model using the gradient descent algorithm to achieve online iterative optimization of the model.

6. The intelligent magnetic field generator device based on deep learning according to claim 1, characterized in that, The device also includes: a magnetic field curve import and preprocessing module and a power supply module; The magnetic field curve import and preprocessing module is connected to the host computer and is used to receive the target magnetic field parameters input by the user and perform noise filtering, outlier correction and data normalization. The magnetic field curve import and preprocessing module is also used to feed back the error between the actual measured magnetic field and the target magnetic field to the deep learning module, so as to realize online fine-tuning and accuracy correction of the target magnetic field, and make the average error of magnetic field generation less than 20%. The power module is connected to the device module, and the power module converts mains power to provide the required voltage to the device.

7. The intelligent magnetic field generator device based on deep learning according to claim 1, characterized in that, The device further includes: a magnetic field measurement module; The magnetic field measurement module is connected to the device module. The magnetic field measurement module is composed of a Hall sensor or a three-axis fluxgate sensor and is used to collect the actual magnetic flux density distribution data of the target area.

8. A deep learning-based intelligent magnetic field generator control method, applied to the device described in any one of claims 1-7, characterized in that, The method includes the following steps: S1: Import the target magnetic field distribution data through the host computer control interface, and perform noise removal, outlier correction and normalization processing through the magnetic field curve import and preprocessing module. S2: The deep learning module calls the pre-trained learning model, inputs the pre-processed target magnetic field characteristics, and outputs the initial current configuration parameters of the coil array; S3: The programmable current control module adjusts the current amplitude and direction of each coil according to the current configuration parameters, driving the coil array to generate a magnetic field; S4: The magnetic field measurement module collects the actual magnetic field distribution of the target area and calculates the error between it and the target magnetic field. S5: If the error is greater than 5%, the error signal is fed back to the deep learning module, the model parameters are fine-tuned and the current configuration is updated using the gradient descent method, and the process returns to S3; if the error is less than or equal to 5%, the magnetic field reproduction is completed and an experimental report containing error analysis and parameter logs is generated.

9. The intelligent magnetic field generator control method based on deep learning according to claim 8, characterized in that, The method also includes a model transfer learning step: The measurement data obtained by the magnetic field generator device during actual operation is used to perform transfer learning on the pre-trained model in the deep learning module; During the transfer learning process, only the parameters of the third LSTM hidden layer, subsequent fully connected layers, and the output layer in the deep neural network are fine-tuned. When the mean square error between the predicted magnetic field curve and the measured magnetic field curve is less than 20%, stop fine-tuning, save and enable the updated model as the new prediction benchmark.

Citation Information

Cited By

  • Interference magnetic source simulation system and method

    CN122050988A