A closed-loop magnetic compensation method for magnetic shielding cabin based on PID and Monte Carlo algorithm
By combining PID and Monte Carlo algorithm with closed-loop magnetic compensation method, the problems of long compensation time, low accuracy and inability to achieve closed-loop control in the traditional magnetic compensation method are solved, and fast and fully automatic three-axis magnetic field compensation and resistance to external magnetic field interference are achieved.
Patent Information
- Application Number
- CN202211125982.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-16
- Publication Date
- 2025-04-29
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The magnetic compensation method of the traditional magnetic shielding chamber has the problems of long compensation time, low accuracy, cumbersome operation and inability to achieve closed-loop control, resulting in failure under external magnetic field interference.
The closed-loop magnetic compensation method of magnetic shielding chamber based on the combination of PID and Monte Carlo algorithm is adopted. By measuring the linear relationship between the three-axis coil and the compensation current, the PID algorithm is used for coarse compensation, and the Monte Carlo algorithm is used to fine compensation to achieve fully automatic three-axis magnetic field compensation.
It realizes fast and fully automatic three-axis magnetic field compensation, avoids manual operation errors, shortens compensation time, enhances resistance to external magnetic field interference, and avoids the problem of three-axis coil coupling.
Smart Images

Figure CN115407247B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of active magnetic compensation in a magnetic shielding cabin, and specifically to a closed-loop magnetic compensation method for a magnetic shielding cabin based on a combination of PID and Monte Carlo algorithms. Background Art
[0002] Magnetism is a physical phenomenon around us. Accurately measuring and using magnetic fields is a topic that people are increasingly interested in, such as heart and brain magnetism. The magnetic field generated by the heart and brain is about tens of degrees of non-specific, more than a million times smaller than the earth's magnetic field, and several orders of magnitude smaller than other magnetic interference sources. Therefore, the measurement of heart and brain magnetism needs to be carried out in an extremely weak magnetic field environment, generally in a magnetic shielding cabin.
[0003] Measuring the magnetic field of the heart and brain requires extremely high environmental magnetic fields. Generally, the measurements are carried out in a magnetic shielding cabin. However, the passive magnetic shielding of the magnetic shielding cabin alone cannot provide an extremely weak magnetic field, and additional active magnetic compensation is required. There are currently two main magnetic compensation methods. One is to use the cross-modulation three-axis magnetic compensation method for manual compensation, and the other is to use an algorithm for automatic magnetic compensation. The former method requires three signal generators as a basis, observes the output of the fluxgate sensor through an oscilloscope, and gives the step amount based on experience to adjust the compensation axis magnetic field according to the output of the fluxgate sensor. This method has problems such as low magnetic field compensation accuracy, cumbersome operation, and long time consumption; the latter algorithm-based automatic compensation magnetic field has two problems. On the one hand, the coupling problem of the three-axis coil needs to be considered. The reason is that the three currents that are compensated to zero in the three axes are added to the three-axis coil at the same time. Due to the coupling of the three-axis coil, the magnetic field after the compensation of the three-axis direction is not all zero, and the workload of decoupling the coil is large. On the other hand, it cannot work in a closed-loop system and cannot control the interference of the external magnetic field. Therefore, it is of great significance to study a magnetic compensation method that can liberate manpower, fully automatically and accurately compensate the magnetic field, shorten the compensation time, avoid coil decoupling work, and resist interference. Summary of the invention
[0004] In order to solve the problems that the traditional manual magnetic compensation method for a magnetic shielding cabin needs to observe the output of a fluxgate sensor through instruments such as a signal generator and an oscilloscope, and the step amount is given based on experience to adjust the compensation axis magnetic field, resulting in a long compensation time, and the problem that the previous algorithm cannot perform closed-loop control, resulting in algorithm failure under external interference magnetic fields, and the problem that the previous algorithm needs to consider the coupling of three-axis coils, the present invention provides a closed-loop magnetic compensation method for a magnetic shielding cabin based on a combination of PID and Monte Carlo algorithms, which can quickly compensate the residual magnetism in the magnetic shielding cabin to zero in a fully automatic manner, and does not need to consider the coupling problem of the traditional algorithm XYZ three-axis coils being compensated separately in turn, and can also resist external magnetic field interference to a certain extent, providing a zero-magnetic environment for subsequent work.
[0005] In order to achieve the above object, the technical solution adopted by the present invention is:
[0006] A closed-loop magnetic compensation method for a magnetic shielding cabin based on a combination of PID and Monte Carlo algorithm comprises the following steps:
[0007] Step 1: By measuring the linear relationship between the three-axis Helmholtz coils inside and outside the magnetic shielding cabin and the compensation current, the expression of the three-axis compensation magnetic field is obtained: B x_n =α1I x_n , B y_n =β1I y_n , B z_n =γ1I z_n ; B x_w =α2I x_w , B y_w =β2I y_w , B z_w =γ2I z_w , where B x_n is the magnetic field generated by the internal X-axis compensation coil, I x_n is the current flowing through the internal X-axis compensation coil, α1 is determined experimentally, B y_n is the magnetic field generated by the internal Y-axis compensation coil, I y_n is the current flowing through the internal Y-axis compensation coil, β1 is determined by experiment, B z_n is the magnetic field generated by the internal Z-axis compensation coil, I z_n is the current flowing through the internal Z-axis compensation coil, γ1 is determined by experiment; B x_w is the magnetic field generated by the external X-axis compensation coil, I x_w is the current flowing through the external X-axis compensation coil, α2 is determined experimentally, B y_w is the magnetic field generated by the external Y-axis compensation coil, I y_w is the current flowing through the external Y-axis compensation coil, β2 is determined by experiment, B z_w is the magnetic field generated by the external Z-axis compensation coil, I z_w is the current flowing through the external Z-axis compensation coil, γ2 is determined experimentally;
[0008] Step 2: Take zero as the input of the external three-axis closed-loop system and obtain U according to the output of the first fluxgate sensor. now_x , U now_y , U now_z , where U now_x is the X-axis voltage value of the first fluxgate sensor, U now_y is the Y-axis voltage value of the first fluxgate sensor, U now_z is the Z-axis voltage value of the first fluxgate sensor, which is then introduced into the system input as negative feedback, and the error signal is obtained by subtracting the input from the negative feedback, i.e., Err x=0-U now_x , Err y =0-U now_y , Err z =0-U now_z , where Err x is the X-axis error signal, Err y is the Y-axis error signal, Err z is the Z-axis error signal;
[0009] Step 3: The X-axis error signal Err obtained in step 2 x , Y-axis error signal Err y , Z-axis error signal Err z Substitute them into the PID algorithm respectively, and assign appropriate PID parameters through the host computer. The PID algorithm obtains the voltage value U that needs to be adjusted for the three-axis compensation current based on the error signal at this time and the accumulation of the error signal at previous times. del_x , U del_y , U del_z , where U del_x is the voltage value required to adjust the X-axis compensation coil, U del_y is the voltage value required to adjust the Y-axis compensation coil, U del_z The voltage value required to adjust the Z-axis compensation coil;
[0010] Step 4: Set the voltage value U that needs to be adjusted for the X-axis compensation coil in step 3 del_x , the voltage value U required to adjust the Y-axis compensation coil del_y , the voltage value U required to adjust the Z-axis compensation coil del_z Load it into the external three-axis Helmholtz coil and repeat the above steps until the output of the first fluxgate sensor enters the ideal range and the PID coarse compensation is completed;
[0011] Step 5: Get U through the output of the second fluxgate sensor after step 4 ide_x , U ide_y , U ide_z , where U ide_x is the reference voltage of the X-axis compensation coil, U ide_y is the reference voltage of the Y-axis compensation coil, U ide_z The Z-axis compensation coil reference voltage is used as the initial reference voltage of the internal three-axis compensation coil, and three reasonable intervals are set around it [U ide_x -a,U ide_x +a],[U ide_y -b,U ide_y +b],[U ide_z -c,U ide_z +c], where a, b, and c are determined according to the center voltage;
[0012] Step 6: Taking the initial reference voltage of the three axes as the boundary point, the above three large intervals are divided into six small intervals, wherein the X-axis direction is defined as the first interval and the second interval; the Y-axis direction is defined as the third interval and the fourth interval; the Z-axis direction is defined as the fifth interval and the sixth interval;
[0013] Step 7: Based on the Monte Carlo algorithm, six voltage values are randomly generated in the six intervals in step 6, and then eight combinations are made, wherein the interval combinations are: the first combination is the first, third, and fifth intervals; the second combination is the first, third, and sixth intervals; the third combination is the first, fourth, and fifth intervals; the fourth combination is the first, fourth, and sixth intervals; the fifth combination is the second, third, and fifth intervals; the sixth combination is the second, third, and sixth intervals; the seventh combination is the second, fourth, and fifth intervals; the eighth combination is the second, fourth, and sixth intervals; the voltages in the above combinations are input into the internal three-axis compensation coil, the sum of the squares of the three-axis residual magnetism is calculated and sorted to find the combination number with the smallest result;
[0014] Step 8: Repeat step 7 N times, take the voltage group with the most repeated combination numbers, find the minimum value of the group N times, and record the voltage value; see if the result is zero, if it is satisfied, take the above three voltages as the final output, and the fine compensation ends, if not, go to step 9;
[0015] Step 9: Take the three voltages obtained in step 8 as new boundary points, and take the small interval where the three voltages are located as a new large interval, and then divide the three large intervals into six small intervals; repeat steps 7 and 8 until the voltage at which the magnetic field is zero after compensation of the three-axis directions is found;
[0016] Through the above nine steps, rapid and fully automatic three-axis simultaneous magnetic compensation of the magnetic shielding cabin can be achieved.
[0017] Furthermore, in the step eight, N is used to avoid random value selection in an erroneous interval, and multiple groups of values are taken to ensure accuracy, and its size is related to the interval size; to avoid overlapping group numbers in the results, the value of N is set to an odd number.
[0018] The advantages of the present invention compared with the prior art are:
[0019] Beneficial effects:
[0020] The invention designs a closed-loop magnetic compensation method for a magnetic shielding cabin based on the combination of PID and Monte Carlo algorithm. Compared with the traditional manual magnetic compensation method of observing the output signal of a fluxgate sensor through an oscilloscope and then adjusting the compensation magnetic field by giving a step amount based on experience, the invention completely liberates manpower. The active magnetic compensation system with PID and Monte Carlo algorithm as the core does not need to rely on instruments such as signal generators and oscilloscopes. It not only reduces the size, but also reduces the manual reading error and shortens the compensation time. Compared with other automatic compensation systems based on algorithms, it not only adopts a closed-loop system to reduce the influence of external magnetic field interference to a certain extent, but also avoids the coupling problem of three-axis coils, reduces the decoupling processing work of three-axis coils, saves time, and reduces the theoretical level requirements of experimenters, and is more suitable for engineering application fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] When considered in conjunction with the accompanying drawings, the present invention can be better understood and the advantages thereof can be easily known by referring to the following detailed description, but the drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments and descriptions of the present invention are used to explain the present invention and do not constitute an improper limitation of the present invention, wherein:
[0022] Figure 1 It is a schematic diagram of the system framework of the closed-loop magnetic compensation method for a magnetic shielding cabin based on the combination of PID and Monte Carlo algorithm of the present invention;
[0023] Figure 2 The hardware system block diagram of the closed-loop magnetic compensation method for a magnetic shielding cabin based on the combination of PID and Monte Carlo algorithm of the present invention;
[0024] Figure 3 The figure is a flow chart of the closed-loop magnetic compensation method of a magnetic shielding cabin based on the combination of PID and Monte Carlo algorithm of the present invention. Specific implementation methods
[0025] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of the present invention.
[0026] The invention provides a closed-loop magnetic compensation method for a magnetic shielding cabin based on the combination of PID and Monte Carlo algorithm. No signal generator and oscilloscope are required. Based on a hardware system including a DSP control module, an A / D data input module, a D / A data output module and a current source module, the external three-axis coil is firstly automatically and sequentially coarsely compensated, and then the internal three-axis coil is finely compensated at the same time. The significance of the two compensations is that the PID coarse compensation can solve the problems of manual compensation and dynamic magnetic field interference, and the Monte Carlo algorithm fine compensation can solve the problems of manual compensation and three-axis coil coupling. First, the PID algorithm is used to perform coarse compensation on the three axes in sequence, so that the residual magnetism in the magnetic shielding cabin is compensated to a state close to zero, and then the output of the flux gate at this time is used as the initial reference voltage. With the initial reference voltage as the center, three voltage range intervals are selected. The reference voltage divides the three voltage intervals into six small intervals. Based on the Monte Carlo algorithm, six voltages are randomly generated in the six intervals, and the minimum value of the combined residual magnetism is calculated in eight combinations. The points are taken N times repeatedly to find the interval with the most minimum residual magnetism, find the minimum value of the N results of the interval, and record the voltage value. If the minimum value is zero, the algorithm ends, and the three-axis outputs a stable voltage. If it is not zero, this interval is used as the interval for the next random point selection, and the recorded voltage is used as the boundary point, and the above steps are repeated until the residual magnetism after compensation in the three-axis directions is zero. The present invention realizes full-automatic three-axis magnetic field compensation, and all three axes can be compensated to the zero magnetic compensation point. Compared with traditional manual magnetic field compensation, it completely liberates manpower, takes less compensation time, is simple to operate, and has a small hardware device size; compared with other algorithms, it avoids the decoupling of the three-axis coil, has lower theoretical requirements, is more suitable for engineering applications, and constitutes a closed-loop system that can resist external magnetic field interference to a certain extent.
[0027] like Figure 1 As shown, the directions of the three-axis coils are defined as X, Y and Z axes. Among them, the system implementing the present invention includes a magnetic shielding cabin 1, an internal X-axis coil 2, an internal Y-axis coil 3, an internal Z-axis coil 4, an external X-axis coil 5, an external Y-axis coil 6, an external Z-axis coil 7, a first fluxgate sensor 8, a second fluxgate sensor 9 and a hardware system control processing part 10. Among them, the internal X-axis coil 2, the internal Y-axis coil 3, and the internal Z-axis coil 4 are wound around the inner wall of the magnetic shielding cabin 1 as internal compensation coils, and the external X-axis coil 5, the external Y-axis coil 6, and the external Z-axis coil 7 are located outside the magnetic shielding cabin 1 as external compensation coils. The first fluxgate sensor 8 and the second fluxgate sensor 9 are placed at the center of the magnetic shielding cabin 1, and the hardware system control processing part 10 is placed outside the magnetic shielding cabin 1, and is connected to the internal X-axis coil 2, the internal Y-axis coil 3, the internal Z-axis coil 4, the external X-axis coil 5, the external Y-axis coil 6, and the external Z-axis coil 7 respectively. The first fluxgate sensor 8 and the second fluxgate sensor 9 are connected to the hardware system control processing part 10.
[0028] like Figure 2As shown, the hardware system is divided into two parts, the first part is a rough compensation system based on the PID algorithm, and the second part is a fine compensation system based on the Monte Carlo algorithm. The first part and the second part both use a DSP control module, an A / D data acquisition module, a D / A data output module, and a current source module to replace the signal generator and oscilloscope used for manual magnetic compensation. First, the DSP control module performs PID control according to the error signal obtained by input and negative feedback, and converts the output value into an analog signal through the D / A data output module, thereby controlling the current source to output current to the external compensation coil. At the same time, the first fluxgate sensor 8 collects the value of the center residual magnetism and feeds it back to the DSP control module through the A / D data acquisition module. After the rough compensation is completed, the output value of the second fluxgate sensor 9 is input to the DSP control module through the A / D data acquisition module, and the Monte Carlo algorithm is performed. The algorithm output value converts the digital signal into an analog signal through the D / A data output module, thereby controlling the current source to output current to the internal compensation coil. At the same time, the second fluxgate sensor 9 collects the value of the center residual magnetism and feeds it back to the DSP control module through the A / D data acquisition module. When the final internal residual magnetism is 0, the fine compensation ends.
[0029] like Figure 3 As shown, a closed-loop magnetic compensation method for a magnetic shielding cabin based on a combination of PID and Monte Carlo algorithm of the present invention comprises the following steps:
[0030] Step 1: By using the first fluxgate sensor 8 to measure the linear relationship between the internal and external compensation coils and the compensation current of the magnetic shielding cabin 1, and using MATLAB to fit the relationship between the magnetic field and the current, the expression of the three-axis compensation magnetic field is obtained: B x_n =α1I x_n , B y_n =β1I y_n , B z_n =γ1I z_n ; B x_w =α2I x_w , B y_w =β2I y_w , B z_w =γ2I z_w , where B x_n is the magnetic field generated by the internal X-axis compensation coil, I x_n is the current flowing through the internal X-axis compensation coil, α1 can be determined experimentally, B y_n is the magnetic field generated by the internal Y-axis compensation coil, I y_n is the current flowing through the internal Y-axis compensation coil, β1 can be determined experimentally, B z_n is the magnetic field generated by the internal Z-axis compensation coil, I z_n is the current flowing through the internal Z-axis compensation coil, γ1 can be determined experimentally; Bx_w is the magnetic field generated by the external X-axis compensation coil, I x_w is the current flowing through the external X-axis compensation coil, α2 can be determined experimentally, B y_w is the magnetic field generated by the external Y-axis compensation coil, I y_w is the current flowing through the external Y-axis compensation coil, β2 can be determined experimentally, B z_w is the magnetic field generated by the external Z-axis compensation coil, I z_w is the current passed through the external Z-axis compensation coil, and γ2 can be determined experimentally.
[0031] Step 2: Take zero as the input of the external XYZ three-axis closed-loop system and obtain U according to the output of the first fluxgate sensor 8 now_x , U now_y , U now_z , where U now_x is the X-axis voltage value of the first fluxgate sensor 8, U now_y is the Y-axis voltage value of the first fluxgate sensor 8, U now_z is the Z-axis voltage value of the first fluxgate sensor 8, which is introduced into the system input as negative feedback, and the error signal is obtained by subtracting the input from the negative feedback, i.e., Err x =0-U now_x , Err y =0-U now_y , Err z =0-U now_z , where Err x is the X-axis error signal, Err y is the Y-axis error signal, Err z is the Z-axis error signal.
[0032] Step 3: The X-axis error signal Err obtained in step 2 x , Y-axis error signal Err y , Z-axis error signal Err z Substitute them into the PID algorithm respectively, and assign appropriate PID parameters through the host computer. The PID algorithm obtains the voltage value U that needs to be adjusted for the three-axis compensation current based on the error signal at this time and the accumulation of the error signal at previous times. del_x , U del_y , U del_z , where U del_x is the voltage value required to adjust the X-axis compensation coil, U del_y is the voltage value required to adjust the Y-axis compensation coil, U del_z The voltage value required to adjust the Z-axis compensation coil.
[0033] Step 4: Respectively replace the U del_x , U del_y , Udel_z Load into the external X-axis coil 5, the external Y-axis coil 6, and the external Z-axis coil 7, and repeat the above steps until the output of the first fluxgate sensor 8 enters the ideal range, and the PID rough compensation is completed.
[0034] Step 5: U can be obtained through the output of the second fluxgate sensor 9 after step 4. ide_x , U ide_y , U ide_z , where U ide_x is the reference voltage of the X-axis compensation coil, U ide_y is the reference voltage of the Y-axis compensation coil, U ide_z The Z-axis compensation coil reference voltage is used as the initial reference voltage of the internal three-axis compensation coil. In the DSP control module, three reasonable intervals are set with this as the center. ide_x -a,U ide_x +a],[U ide_y -b,U ide_y +b],[U ide_z -c,U ide_z +c], where a, b, and c are determined according to the center voltage.
[0035] Step 6: Using the initial reference voltage of the three axes as the boundary point, divide the above three large intervals into six small intervals, where the X-axis direction is defined as the first interval and the second interval; the Y-axis direction is defined as the third interval and the fourth interval; and the Z-axis direction is defined as the fifth interval and the sixth interval.
[0036] Step 7: Based on the Monte Carlo algorithm, six voltage values are randomly generated in the six intervals in step 6, and then eight combinations are performed, wherein the interval combinations are: the first combination is the first, third, and fifth intervals; the second combination is the first, third, and sixth intervals; the third combination is the first, fourth, and fifth intervals; the fourth combination is the first, fourth, and sixth intervals; the fifth combination is the second, third, and fifth intervals; the sixth combination is the second, third, and sixth intervals; the seventh combination is the second, fourth, and fifth intervals; the eighth combination is the second, fourth, and sixth intervals; these combined voltages are passed through the D / A data output module and the current source module, and the current is input into the internal three-axis compensation coil, and then the second fluxgate sensor 9 measures the residual magnetism after three-axis direction compensation, and the residual magnetism measured by the second acquisition fluxgate sensor 9 of the A / D data acquisition module is sent to the DSP control module, and the sum of the squares of the three-axis residual magnetism is calculated and sorted to find the combination number with the smallest result.
[0037] Step 8: Repeat step 7 N times, where N is to avoid random values in the wrong interval. Multiple groups of values are needed to ensure accuracy. The size is related to the interval size. In order to avoid the overlap of group numbers in the results, the value of N must be set to an odd number. Take the voltage group with the most repeated combination numbers, find the minimum value of the group N times, and record the voltage value. Check whether the result is zero. If it is satisfied, take the above three voltages as the final output and the fine compensation is completed. If not, go to step 9.
[0038] Step 9: Use the three voltages obtained in step 8 as new boundary points, and use the small intervals where the three voltages are located as new large intervals, and then divide the three large intervals into six small intervals. Repeat steps 7 and 8 until you find the voltage where the magnetic field is zero after compensation in the three-axis directions.
[0039] The contents not described in detail in this specification belong to the prior art known to those skilled in the art.
[0040] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A closed-loop magnetic compensation method for a magnetic shielding cabin based on a combination of PID and Monte Carlo algorithm, characterized in that: The steps include: Step 1: By measuring the linear relationship between the three-axis Helmholtz coils inside and outside the magnetic shielding cabin and the compensation current, the expression of the three-axis compensation magnetic field is obtained: , , ; , , ,in, The magnetic field generated by the internal X-axis compensation coil, is the current flowing through the internal X-axis compensation coil, Through experimental determination, The magnetic field generated by the internal Y-axis compensation coil, is the current flowing through the internal Y-axis compensation coil, Through experimental determination, The magnetic field generated by the internal Z-axis compensation coil, is the current flowing through the internal Z-axis compensation coil, Determined by experiment; The magnetic field generated by the external X-axis compensation coil, is the current flowing through the external X-axis compensation coil, Through experimental determination, The magnetic field generated by the external Y-axis compensation coil, is the current flowing through the external Y-axis compensation coil, Through experimental determination, The magnetic field generated by the external Z-axis compensation coil, is the current flowing through the external Z-axis compensation coil, Determined by experiment; Step 2: Take zero as the input of the external three-axis closed-loop system and obtain , , ,in is the X-axis voltage value of the first fluxgate sensor, is the Y-axis voltage value of the first fluxgate sensor, is the Z-axis voltage value of the first fluxgate sensor, which is then introduced into the system input as negative feedback, and the error signal is obtained by subtracting the input from the negative feedback, that is, , , ,in is the X-axis error signal, is the Y-axis error signal, is the Z-axis error signal; Step 3: The X-axis error signal obtained in step 2 , Y-axis error signal , Z-axis error signal Substitute them into the PID algorithm respectively, and assign appropriate PID parameters through the host computer. The PID algorithm obtains the voltage value that needs to be adjusted for the three-axis compensation current based on the error signal at this time and the accumulation of the error signal at previous moments. , , ,in is the voltage value that needs to be adjusted for the X-axis compensation coil. The voltage value required to adjust the Y-axis compensation coil, The voltage value required to adjust the Z-axis compensation coil; Step 4: Adjust the voltage value of the X-axis compensation coil in step 3 , the voltage value required to adjust the Y-axis compensation coil , the voltage value required to adjust the Z-axis compensation coil Load it into the external three-axis Helmholtz coil and repeat the above steps until the output of the first fluxgate sensor enters the ideal range and the PID coarse compensation is completed; Step 5: Get the output of the second fluxgate sensor after step 4 , , ,in, is the reference voltage of the X-axis compensation coil, is the reference voltage of the Y-axis compensation coil, The Z-axis compensation coil reference voltage is used as the initial reference voltage of the internal three-axis compensation coil, and three reasonable intervals are set around it. ],[ ],[ ], where a, b, c are determined according to the center voltage; Step 6: Using the initial reference voltage of the three axes as the boundary point, the three large intervals are divided into six small intervals, where the X-axis direction is defined as the first interval and the second interval; the Y-axis direction is defined as the third interval and the fourth interval; the Z-axis direction is defined as the fifth interval and the sixth interval; Step 7: Based on the Monte Carlo algorithm, six voltage values are randomly generated in the six intervals in step 6, and then eight combinations are made, wherein the interval combinations are: the first combination is the first, third, and fifth intervals; the second combination is the first, third, and sixth intervals; the third combination is the first, fourth, and fifth intervals; the fourth combination is the first, fourth, and sixth intervals; the fifth combination is the second, third, and fifth intervals; the sixth combination is the second, third, and sixth intervals; the seventh combination is the second, fourth, and fifth intervals; the eighth combination is the second, fourth, and sixth intervals; the voltages in the above combinations are input into the internal three-axis compensation coil, the sum of the squares of the three-axis residual magnetism is calculated and sorted to find the combination number with the smallest result; Step 8: Repeat step 7 N times, take the voltage group with the most repeated combination numbers, find the minimum value of the group N times, and record the voltage value; see if the result is zero, if it is satisfied, take the above three voltages as the final output, and the fine compensation ends, if not, go to step 9; Step 9: Take the three voltages obtained in step 8 as new boundary points, and take the small interval where the three voltages are located as a new large interval, and then divide the three large intervals into six small intervals; repeat steps 7 and 8 until the voltage at which the magnetic field is zero after compensation of the three-axis directions is found; Through the above nine steps, rapid and fully automatic three-axis simultaneous magnetic compensation of the magnetic shielding cabin can be achieved.
2. According to claim 1, a closed-loop magnetic compensation method for a magnetic shielding cabin based on a combination of PID and Monte Carlo algorithm is characterized in that: In the step eight, N is used to avoid random value selection in the wrong interval, and multiple groups of values are taken to ensure accuracy, and its size is related to the interval size; to avoid the overlap of group numbers in the results, the value of N is set to an odd number.
Citation Information
Patent Citations
Magnetic-field dynamic compensation system and methods based on spatial correlation
CN101893693A
Multi-interface high-energy electron shielding device under magnetic field condition
CN107369477A