Augmented reality online visualization method for magnetic field distribution

文档序号:1844889 发布日期:2021-11-16 浏览:31次 中文

阅读说明:本技术 一种磁场分布的增强现实在线可视化方法 (Augmented reality online visualization method for magnetic field distribution ) 是由 裴文利 赵东 刘传值 王群首 高天寒 江欣蓓 朱子辰 于 2021-08-16 设计创作,主要内容包括:本发明公开了一种磁场分布的增强现实在线可视化方法,属于永磁材料应用技术领域。利用磁场模拟软件对永磁体的磁场空间分布进行模拟计算,且将模拟结果与高斯计的实测结果进行对比,获得准确的永磁体磁场空间分布。通过热力图形式对磁场中每个测量点进行着色,以点云的形式呈现。利用识别模型的方法实现永磁体相对于增强现实设备前置摄像头的相对位姿识别,以实现磁场分布可视化点云网格在真实永磁体上的稳定叠加。最后,将磁场分布可视化点云网格进行位置校准,利用Socket通信技术将永磁体的磁场空间分布数据实现可视化。可为永磁体的磁路设计、永磁体工程化设计提供有力的支持,从而为优化磁路设计、简化磁场设计及调节。(The invention discloses an augmented reality online visualization method for magnetic field distribution, and belongs to the technical field of permanent magnet material application. And (3) performing simulation calculation on the magnetic field spatial distribution of the permanent magnet by using magnetic field simulation software, and comparing the simulation result with the actual measurement result of the gaussmeter to obtain accurate magnetic field spatial distribution of the permanent magnet. Each measurement point in the magnetic field is colored in the form of thermodynamic diagram and presented in the form of point cloud. The relative pose identification of the permanent magnet relative to the front camera of the augmented reality equipment is realized by utilizing a model identification method so as to realize the stable superposition of the magnetic field distribution visual point cloud grid on the real permanent magnet. And finally, carrying out position calibration on the magnetic field distribution visualization point cloud grid, and visualizing the magnetic field spatial distribution data of the permanent magnet by using a Socket communication technology. The method can provide powerful support for the magnetic circuit design and the permanent magnet engineering design of the permanent magnet, thereby optimizing the magnetic circuit design and simplifying the magnetic field design and adjustment.)

1. An augmented reality online visualization method of magnetic field distribution is characterized by comprising the following steps:

step 1: the method comprises the following steps of actually measuring the magnetic field spatial distribution of any permanent magnet by using a measuring tool to obtain the actual data of the magnetic field spatial distribution of the permanent magnet;

step 2: setting a permanent magnet model by using electromagnetic field analysis software, setting and adjusting coercive force and remanence parameters according to actual magnetic field spatial distribution data of a permanent magnet, and performing numerical simulation on the magnetic field spatial distribution of the permanent magnet until magnetic field spatial distribution simulation data of the permanent magnet, which is smaller than or equal to a preset error threshold compared with the actual magnetic field spatial distribution data of the permanent magnet, are obtained;

and step 3: preprocessing magnetic field spatial distribution simulation data of the permanent magnet: drawing a graph of each measuring point in the magnetic field by using a point-like three-dimensional model, coloring the point-like three-dimensional model in a thermodynamic diagram mode according to the magnitude of magnetic induction intensity, and finally presenting the spatial distribution of the magnetic field in a point cloud mode;

and 4, step 4: the relative pose identification of the permanent magnet relative to the front camera of the augmented reality equipment is realized;

and 5: the augmented reality equipment is used as a client and a desktop computer is used as a server, communication between the client and the desktop computer is established, the client sends the position of the magnetic induction intensity measuring point to the server, the server returns the magnetic induction intensity value of the position corresponding to the measuring point, and after the client successfully receives the returned measuring result, the result is displayed on a user interaction interface of the client on line.

2. The method for online augmented reality visualization of a magnetic field distribution according to claim 1 wherein the measurement tool is a gauss meter.

3. The method of claim 1, wherein the electromagnetic field analysis software is ANSOFT Maxwell simulation software.

4. The method of claim 1, wherein the dotted three-dimensional model refers to a dotted graph rendered in a real-time 3d engine Unity using a vertex shader.

5. The method for the online visualization of the augmented reality of the magnetic field distribution according to claim 4, wherein the step 3 comprises the steps of:

step 3.1: constructing a floating point type three-dimensional array Intensity [ w ] [ h ] [ d ], and initializing the three-dimensional array by using zero elements; wherein, w is the number of measuring points of the magnetic field space distribution data of the permanent magnet in the x-axis direction; h is the number of measurement points of the magnetic field spatial distribution data of the permanent magnet in the y-axis direction; d is the number of measuring points of the magnetic field space distribution data of the permanent magnet in the z-axis direction;

step 3.2: filling the permanent magnet magnetic field spatial distribution simulation data obtained in the step 2 into the three-dimensional array Intensity constructed in the step 3.1 according to the following subscript mapping relation: for a certain point P with coordinates (x ', y ', z '), the magnetic induction intensity value of the point is I, the subscript mapping relationship between the magnetic induction intensity value of the position and the three-dimensional array elements can be obtained from formulas (1) to (3):

wherein s isx、syAnd szThe measurement distances between two adjacent measurement points of the permanent magnet magnetic field space distribution data in the directions of the x axis, the y axis and the z axis are respectively, and the corresponding subscript of the magnetic induction Intensity value I of the point P stored in the Intensity is [ I [ ]][j][k]If the Intensity value I of the magnetic induction is filled into Intensity, there is an Intensity [ I [ ]][j][k]=I;

Step 3.3: carrying out average normalization on data in the three-dimensional array Intensity, and mapping the size of each element in the Intensity into a range of [0,1 ];

step 3.4: regarding the element values in the three-dimensional array Intensity as the pixel gray value in the gray map, converting the three-dimensional gray map represented by the normalized three-dimensional array obtained in the step 3.3 into a color three-dimensional heat map with RGB channel information by using a cvtColor interface provided by an OpenCV (open computer vision library) of a cross-platform computer, so as to obtain the heat map color of the magnetic induction Intensity value of each measuring point;

step 3.5: reading the magnetic field spatial distribution simulation data of the permanent magnet obtained in the step 2 in the Unity project, drawing a dotted three-dimensional model in the Unity scene aiming at the position of the magnetic induction intensity measuring point, coloring the corresponding dotted three-dimensional model by using the heat map color of the magnetic induction intensity value of each measuring point obtained in the step 3.4, and finally combining all colored dotted three-dimensional models to obtain the magnetic field distribution visual point cloud grid.

6. The method for online visualization of augmented reality of magnetic field distribution according to claim 5, wherein the method for realizing the relative pose recognition of the permanent magnet with respect to the front camera of the augmented reality device comprises: and constructing a Model identification environment based on an augmented reality software development kit Vuforia, and realizing the relative pose identification of the permanent magnet relative to a front camera of augmented reality equipment by using a Model Target based on an identification Model.

7. The method for the online visualization of the augmented reality of the magnetic field distribution according to claim 6, wherein the step 4 comprises the steps of:

step 4.1: using Autodesk 3Ds Max modeling software to construct a permanent magnet three-dimensional model with the size and shape consistent with the size and shape of a real permanent magnet, and using a UVLayout tool to carry out UV expansion on the constructed permanent magnet three-dimensional model;

step 4.2: according to the real permanent magnet, configuring the permanent magnet three-dimensional Model constructed in the step 4.1 towards a Model Up Vector, Model Units of Model size, color mixing of the Model surface and Model Type by using a Model Target creation platform Vuformia Model Target Generator provided by Vuformia, and generating a three-dimensional Model identification Target;

step 4.3: uploading the three-dimensional Model recognition Target obtained in the step 4.2 to a cloud server special for Model Target recognition training of Vuforia, performing cloud recognition training on the uploaded three-dimensional Model recognition Target, generating three-dimensional Model rendering maps obtained by observing the permanent magnet three-dimensional Model under different camera poses, taking the three-dimensional Model rendering maps and the corresponding different camera poses as training samples, training a pose estimation neural network, and introducing the permanent magnet pose estimation neural network weight obtained after training into a Unity project;

step 4.4: and (3) importing a Vuforia recognition library in the Unity project, adding preset game objects ARCamera and Model Target provided by the Vuforia recognition library in the scene, and selecting the permanent magnet three-dimensional Model obtained in the step 4.1 as a recognition Target on a Model Target Behaviour component of the Model Target object.

8. The method for the online visualization of the augmented reality of the magnetic field distribution according to claim 7, wherein the step 5 comprises the steps of:

step 5.1: respectively registering the message for activating and hiding the magnetic field distribution visualization point cloud grid obtained in the step (3) into an On Target Found Event and an On Target Lost Event of a Default Trackable Event Handler component of the Model Target object so as to ensure that the magnetic field distribution point cloud grid can be visualized only when the augmented reality device correctly identifies the permanent magnet; and carrying out coordinate alignment on the magnetic field distribution visualization point cloud grid and the permanent magnet three-dimensional model obtained in the step 4.1 so as to ensure that the magnetic field distribution visualization point cloud grid is superposed on the permanent magnet of the real world on line without deviation after successful identification;

step 5.2: uploading the permanent magnet magnetic field spatial distribution simulation data obtained in the step 2 to a server, and calculating a three-dimensional vector V of the relative position of the magnetic induction intensity measuring point relative to the coordinate axis origin of the permanent magnet three-dimensional modelrelative=(xrelative,yrelative,zrelative) And sends it to the server; wherein xrelative、yrelativeAnd zrelativeRespectively measuring the offset values of the points in the x, y and z directions relative to the origin of the coordinate axis of the three-dimensional model of the permanent magnet;

step 5.3: the server receives the three-dimensional vector V sent by the clientrelativeAnd acquiring V from the three-dimensional array Intensity constructed according to the permanent magnet magnetic field space distribution simulation data by the method of the step 3.1 and the step 3.2 when the server is started every time according to the subscript mapping relation in the step 3.2relativeCorresponding to the scalar I of the magnetic induction intensity of the measuring position and returning the scalar I of the magnetic induction intensity to the client;

step 5.4: the client side converts the V calculated in the step 5.2relativeDisplaying the returned result on a user interaction interface of the client;

step 5.5: and publishing the Unity project, opening a solution project generated after the project is published, and deploying the solution project to the client.

9. The method of claim 8, wherein the client is a wearable augmented reality device, HoloLens.

Technical Field

The invention belongs to the technical field of permanent magnet material application, and particularly relates to an augmented reality online visualization method for magnetic field distribution.

Background

The permanent magnetic material has high magnetic energy density, is used as an important basic functional material and is applied to the fields of information communication, electronics, new energy automobiles, aviation, petroleum, medical treatment, national defense and the like. Magnetic energy is uninterruptedly transferred to a target through a magnetic field regularly distributed around a permanent magnet, and interaction is generated. In engineering application, a magnetic circuit is designed according to the spatial distribution condition of a magnetic field around the permanent magnet, so that the optimal working state of the permanent magnet is obtained. However, the magnetic field exists in the space around the magnet, and cannot be directly observed, the magnetic field can be detected point by point only through a special gauss meter, a large number of measurements are needed to be carried out around the permanent magnet, and then the data are processed to obtain the spatial distribution condition of the magnetic field. However, in practical engineering application, even if data of magnetic field distribution is obtained, the situation of the magnetic field around the permanent magnet cannot be directly seen, so that the permanent magnet still belongs to a blind feeling in the design and installation processes of the application of the permanent magnet. Whether the magnetic circuit after the permanent magnet is installed is reasonable or not can only be presumed by experience, magnetic field measurement needs to be carried out again to evaluate whether the magnetic field is reasonable or not, the permanent magnet is adjusted to obtain a reasonable magnetic circuit and a reasonable space magnetic field, and a large amount of time and labor are wasted.

Disclosure of Invention

The invention aims to solve the problem of designing a magnetic field black box for the application of the existing permanent magnet, provides an augmented reality online visualization method for magnetic field distribution, and aims to realize real-time online visualization of invisible magnetic fields and convert the black box problem into a white box problem.

The technical scheme of the invention is as follows:

an augmented reality online visualization method of magnetic field distribution comprises the following steps:

step 1: the method comprises the following steps of actually measuring the magnetic field spatial distribution of any permanent magnet by using a measuring tool to obtain the actual data of the magnetic field spatial distribution of the permanent magnet;

step 2: setting a permanent magnet model by using electromagnetic field analysis software, setting and adjusting coercive force and remanence parameters according to actual magnetic field spatial distribution data of a permanent magnet, and performing numerical simulation on the magnetic field spatial distribution of the permanent magnet until magnetic field spatial distribution simulation data of the permanent magnet, which is smaller than or equal to a preset error threshold compared with the actual magnetic field spatial distribution data of the permanent magnet, are obtained;

and step 3: preprocessing magnetic field spatial distribution simulation data of the permanent magnet: drawing a graph of each measuring point in the magnetic field by using a point-like three-dimensional model, coloring the point-like three-dimensional model in a thermodynamic diagram mode according to the magnitude of magnetic induction intensity, and finally presenting the spatial distribution of the magnetic field in a point cloud mode;

and 4, step 4: the relative pose identification of the permanent magnet relative to the front camera of the augmented reality equipment is realized;

and 5: the augmented reality equipment is used as a client and a desktop computer is used as a server, communication between the client and the desktop computer is established, the client sends the position of the magnetic induction intensity measuring point to the server, the server returns the magnetic induction intensity value of the position corresponding to the measuring point, and after the client successfully receives the returned measuring result, the result is displayed on a user interaction interface of the client on line.

Further, according to the method for online visualization of augmented reality of magnetic field distribution, the measuring tool is a gaussmeter.

Further, according to the augmented reality online visualization method of the magnetic field distribution, the electromagnetic field analysis software is ANSOFT Maxwell simulation software.

Further, according to the method for online visualization of augmented reality of magnetic field distribution, the dotted three-dimensional model refers to a dotted graph rendered by using a vertex shader in a real-time 3d engine Unity.

Further, according to the method for online visualization of augmented reality of magnetic field distribution, the step 3 includes the following steps:

step 3.1: constructing a floating point type three-dimensional array Intensity [ w ] [ h ] [ d ], and initializing the three-dimensional array by using zero elements; wherein, w is the number of measuring points of the magnetic field space distribution data of the permanent magnet in the x-axis direction; h is the number of measurement points of the magnetic field spatial distribution data of the permanent magnet in the y-axis direction; d is the number of measuring points of the magnetic field space distribution data of the permanent magnet in the z-axis direction;

step 3.2: filling the permanent magnet magnetic field spatial distribution simulation data obtained in the step 2 into the three-dimensional array Intensity constructed in the step 3.1 according to the following subscript mapping relation: for a certain point P with coordinates (x ', y ', z '), the magnetic induction intensity value of the point is I, the subscript mapping relationship between the magnetic induction intensity value of the position and the three-dimensional array elements can be obtained from formulas (1) to (3):

wherein s isx、syAnd szThe measurement distances between two adjacent measurement points of the permanent magnet magnetic field space distribution data in the directions of the x axis, the y axis and the z axis are respectively, and the corresponding subscript of the magnetic induction Intensity value I of the point P stored in the Intensity is [ I [ ]][j][k]If the Intensity value I of the magnetic induction is filled into Intensity, there is an Intensity [ I [ ]][j][k]=I;

Step 3.3: carrying out average normalization on data in the three-dimensional array Intensity, and mapping the size of each element in the Intensity into a range of [0,1 ];

step 3.4: regarding the element values in the three-dimensional array Intensity as the pixel gray value in the gray map, converting the three-dimensional gray map represented by the normalized three-dimensional array obtained in the step 3.3 into a color three-dimensional heat map with RGB channel information by using a cvtColor interface provided by an OpenCV (open computer vision library) of a cross-platform computer, so as to obtain the heat map color of the magnetic induction Intensity value of each measuring point;

step 3.5: reading the magnetic field spatial distribution simulation data of the permanent magnet obtained in the step 2 in the Unity project, drawing a dotted three-dimensional model in the Unity scene aiming at the position of the magnetic induction intensity measuring point, coloring the corresponding dotted three-dimensional model by using the heat map color of the magnetic induction intensity value of each measuring point obtained in the step 3.4, and finally combining all colored dotted three-dimensional models to obtain the magnetic field distribution visual point cloud grid.

Further, according to the method for online visualization of augmented reality of magnetic field distribution, the method for identifying the relative pose of the permanent magnet with respect to the front camera of the augmented reality device comprises the following steps: and constructing a Model identification environment based on an augmented reality software development kit Vuforia, and realizing the relative pose identification of the permanent magnet relative to a front camera of augmented reality equipment by using a Model Target based on an identification Model.

Further, according to the method for online visualization of augmented reality of magnetic field distribution, the step 4 includes the following steps:

step 4.1: using Autodesk 3Ds Max modeling software to construct a permanent magnet three-dimensional model with the size and shape consistent with the size and shape of a real permanent magnet, and using a UVLayout tool to carry out UV expansion on the constructed permanent magnet three-dimensional model;

step 4.2: according to the real permanent magnet, configuring the permanent magnet three-dimensional Model constructed in the step 4.1 towards a Model Up Vector, Model Units of Model size, color mixing of the Model surface and Model Type by using a Model Target creation platform Vuformia Model Target Generator provided by Vuformia, and generating a three-dimensional Model identification Target;

step 4.3: uploading the three-dimensional Model recognition Target obtained in the step 4.2 to a cloud server special for Model Target recognition training of Vuforia, performing cloud recognition training on the uploaded three-dimensional Model recognition Target, generating three-dimensional Model rendering maps obtained by observing the permanent magnet three-dimensional Model under different camera poses, taking the three-dimensional Model rendering maps and the corresponding different camera poses as training samples, training a pose estimation neural network, and introducing the permanent magnet pose estimation neural network weight obtained after training into a Unity project;

step 4.4: and (3) importing a Vuforia recognition library in the Unity project, adding preset game objects ARCamera and Model Target provided by the Vuforia recognition library in the scene, and selecting the permanent magnet three-dimensional Model obtained in the step 4.1 as a recognition Target on a Model Target Behaviour component of the Model Target object.

Further, according to the method for online visualization of augmented reality of magnetic field distribution, the step 5 includes the following steps:

step 5.1: respectively registering the message for activating and hiding the magnetic field distribution visualization point cloud grid obtained in the step (3) into an On Target Found Event and an On Target Lost Event of a Default Trackable Event Handler component of the Model Target object so as to ensure that the magnetic field distribution point cloud grid can be visualized only when the augmented reality device correctly identifies the permanent magnet; and carrying out coordinate alignment on the magnetic field distribution visualization point cloud grid and the permanent magnet three-dimensional model obtained in the step 4.1 so as to ensure that the magnetic field distribution visualization point cloud grid is superposed on the permanent magnet of the real world on line without deviation after successful identification;

step 5.2: uploading the permanent magnet magnetic field spatial distribution simulation data obtained in the step 2 to a server, and calculating a three-dimensional vector V of the relative position of the magnetic induction intensity measuring point relative to the coordinate axis origin of the permanent magnet three-dimensional modelrelative=(xrelative,yrelative,zrelative) And sends it to the server; wherein xrelative、yrelativeAnd zrelativeRespectively measuring the offset values of the points in the x, y and z directions relative to the origin of the coordinate axis of the three-dimensional model of the permanent magnet;

step 5.3: the server receives the three-dimensional vector V sent by the clientrelativeAnd acquiring V from the three-dimensional array Intensity constructed according to the permanent magnet magnetic field space distribution simulation data by the method of the step 3.1 and the step 3.2 when the server is started every time according to the subscript mapping relation in the step 3.2relativeCorresponding to the scalar I of the magnetic induction intensity of the measuring position and returning the scalar I of the magnetic induction intensity to the client;

step 5.4: the client side converts the V calculated in the step 5.2relativeDisplaying the returned result on a user interaction interface of the client;

step 5.5: and publishing the Unity project, opening a solution project generated after the project is published, and deploying the solution project to the client.

Further, according to the augmented reality online visualization method of the magnetic field distribution, the client is wearable augmented reality equipment, HoloLens.

Generally, the above technical solution conceived by the present invention has the following beneficial effects compared with the prior art: according to the augmented reality online visualization method for the magnetic field distribution, the captured information is transmitted to the computer for processing through the worn augmented reality equipment and the Gaussian measuring device, and the magnetic field data formed after processing is transmitted to the wearable augmented reality equipment in the form of images. The visual three-dimensional guiding instruction can be provided for operators, and all information of online visual magnetic field distribution can be fused in a scene. The augmented reality visualization technology can enable workers to transmit the magnetic field condition of the magnetic material to the site in real time through wearable augmented reality equipment, the magnetic field spatial distribution simulation calculation of the permanent magnet is combined with the AR technology, the real-time online magnetic field spatial distribution visualization effect of the permanent magnet is obtained, related workers are guided to visually see the magnetic field distribution effect, the magnetic field spatial distribution and the magnetic field size of the magnetic functional material are conveniently known, and the key problems that the magnetic field distribution in the existing magnetic material application field is difficult to design, the multipoint measurement and analysis work in engineering application is complicated and the like are solved.

Drawings

Fig. 1 is a schematic flow chart of a method for online visualization of augmented reality of magnetic field distribution according to this embodiment;

fig. 2 is a schematic view of a single differently shaped permanent magnet: (a) is a schematic diagram of a single cuboid permanent magnet; (b) is a single cube permanent magnet schematic diagram; (c) is a schematic diagram of a single cylindrical permanent magnet; (d) is a schematic diagram of a single hollow cylindrical permanent magnet; (e) is a schematic diagram of a single tile-shaped permanent magnet; (f) is a schematic diagram of a single annular permanent magnet;

FIG. 3 is a schematic diagram of a plurality of permanent magnets assembled: (a) the tile-shaped permanent magnets are closely arranged; (b) the tile-shaped permanent magnets are arranged at intervals; (c) the schematic diagram of the interval arrangement of the rectangular permanent magnets is shown;

FIG. 4 is a schematic flow chart of the method for realizing real-time measurement and online visualization of the magnetic field distribution in the space of the permanent magnet through communication between the server and the client;

FIG. 5 is a diagram showing the effect of the magnetic field distribution of a rectangular parallelepiped permanent magnet observed on line by the method of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more clear, the present invention will be further described in detail with reference to the accompanying drawings and specific embodiments. The specific embodiments described herein are merely illustrative of the invention and are not intended to be limiting.

The core thought of the invention is as follows: and performing simulation calculation on the magnetic field spatial distribution of the permanent magnet by using ANSOFT Maxwell simulation software, and comparing a simulation result with an actual measurement result of a gaussmeter so as to obtain accurate magnetic field spatial distribution of the permanent magnet. Each measurement point in the magnetic field is colored in the form of thermodynamic diagram and presented in the form of point cloud. The model recognition environment based on Vuforia realizes the relative pose recognition of the permanent magnet relative to the front camera of the augmented reality equipment by using a model recognition method so as to realize the stable superposition of the magnetic field distribution visualization point cloud grid on the real permanent magnet. And finally, carrying out position calibration on the magnetic field distribution visualization point cloud grid, and visualizing the magnetic field spatial distribution data of the permanent magnet by using a Socket communication technology. The technology can provide powerful support for the magnetic circuit design and the permanent magnet engineering design of the permanent magnet, thereby optimizing the magnetic circuit design and simplifying the magnetic field design and adjustment.

Fig. 1 is a schematic flow chart of the method for online visualization of augmented reality of magnetic field distribution according to the present embodiment, and as shown in fig. 1, the method for online visualization of augmented reality of magnetic field distribution includes the following steps:

step 1: the method comprises the following steps of actually measuring the magnetic field spatial distribution of any permanent magnet by using a measuring tool to obtain the actual data of the magnetic field spatial distribution of the permanent magnet;

in this embodiment, the step uses a gaussmeter to actually measure the magnetic field spatial distribution of the selected permanent magnet, specifically, the hall probe connected to the gaussmeter controller is respectively contacted with the center of each surface around the permanent magnet, the position 3mm away from the center of each surface and the position 5mm away from the center of each surface to measure the magnetic induction intensity of the corresponding position, and the magnetic induction intensity values displayed by the lcd of the gaussmeter controller are recorded and counted to obtain the actual data of the magnetic field spatial distribution of the selected permanent magnet. It should be noted that the hall probe can be used to contact different positions around the permanent magnet, for example, the center of each face, and the magnetic induction intensity can be measured at positions away from the center of each face by different millimeters.

The permanent magnet is made of permanent magnet materials and comprises a permanent magnet ferrite, a neodymium iron boron rare earth permanent magnet, a samarium cobalt rare earth permanent magnet and the like. The arrangement of the permanent magnets may be a single differently shaped magnet, for example: one of a cuboid, cube, cylinder, hollow cylinder, tile and ring, as shown in fig. 2. The arrangement of the permanent magnets can also be a combination of a plurality of permanent magnets, such as a combination of a plurality of rectangular parallelepiped, cylindrical and tile shapes, as shown in fig. 3.

Step 2: setting a permanent magnet model by using electromagnetic field analysis software, setting and adjusting coercive force and remanence parameters according to actual magnetic field spatial distribution data of the permanent magnet, and performing numerical simulation on the magnetic field spatial distribution of the permanent magnet to obtain magnetic field spatial distribution simulation data of the permanent magnet until the obtained magnetic field spatial distribution simulation data of the permanent magnet is smaller than or equal to a preset error threshold relative to the actual magnetic field spatial distribution data of the permanent magnet obtained in the step 1;

in the embodiment, three-dimensional electromagnetic field-based finite element analysis software ANSOFT Maxwell of ANSYS is used, the coercive force and remanence parameters of the permanent magnet are adjusted and set according to the magnetic induction intensity value displayed by the Gauss liquid crystal display screen recorded and counted in the step 1, a zero boundary condition and a self-adaptive grid are adopted, the grid type is selected to be a tetrahedron, the maximum iteration frequency is set to be 10 times, the grid is encrypted by 30% in each iteration process, and meanwhile, the error percentage of the energy difference of the front iteration and the back iteration is ensured to be 1%. Carrying out numerical simulation on the magnetic field spatial distribution of the permanent magnet by adopting ANSOFT Maxwell, carrying out numerical simulation on the magnetic induction intensity of each surface center around the permanent magnet, the position 3mm away from each surface center and the position 5mm away from each surface center respectively in the same way as the step 1, and recording the data of simulation calculation to obtain the magnetic field spatial distribution simulation data of the selected permanent magnet.

In the embodiment, the magnetic induction intensity value recorded and counted in the step 1 and displayed on the gauss meter liquid crystal display screen is compared with the simulation result obtained by numerical simulation in the step 2, the relative errors of the magnetic induction intensity values of each surface center, 3mm away from each surface center and 5mm away from each surface center, which are obtained by the two methods, are calculated, whether the calculation result is controlled within 5% of a preset error threshold value is observed, and the coercive force, residual magnetism parameters and the accuracy and reasonability of the calculation result of the set permanent magnet are explained if the calculation result is within 5%. If the calculation result exceeds 5%, the coercive force and the remanence parameters of the permanent magnet need to be continuously adjusted until the calculation result is controlled within 5%. Meanwhile, in order to obtain magnetic field space distribution data and magnetic induction intensity data of the whole permanent magnet, the magnetic field space distribution of the permanent magnet is simulated to obtain the magnetic induction intensities of the permanent magnet in the x-axis direction, the y-axis direction and the z-axis direction, wherein the magnetic induction intensity data of the permanent magnet at a certain point P is represented by coordinates (x ', y ', z '), and the magnetic induction intensity value under the coordinates is I. The permanent magnet magnetic field spatial distribution data is stored in a permanent magnet magnetic field spatial distribution data file of fld type;

and step 3: carrying out data preprocessing on the magnetic field space distribution simulation data of the permanent magnet obtained in the step 2, and carrying out graphic drawing on each measuring point in the magnetic field by using a punctiform three-dimensional model; and coloring the point-shaped three-dimensional model in a thermodynamic diagram form according to the magnetic induction intensity, and finally presenting the magnetic field spatial distribution condition in a point cloud form. The dotted three-dimensional model refers to a dotted graph rendered by a vertex shader in a real-time 3d engine Unity. The step 3 specifically comprises the following steps:

step 3.1: and constructing a floating-point number type three-dimensional array Intensity [ w ] [ h ] [ d ], and initializing the three-dimensional array by using a zero element, wherein the length w corresponding to one dimension of the array is the number of measurement points of the permanent magnet magnetic field space distribution data in the x-axis direction, the length h corresponding to two dimensions of the array is the number of measurement points of the permanent magnet magnetic field space distribution data in the y-axis direction, and the length d corresponding to three dimensions of the array is the number of measurement points of the permanent magnet magnetic field space distribution data in the z-axis direction.

An array is a data structure used to store a collection of values of the same type. Each element of the array is accessible by the integer subscript. For example, Intensity [0] [3] [4] represents the element of the three-dimensional array Intensity that is first in one-dimensional position, fourth in two-dimensional position, and fifth in three-dimensional position.

Step 3.2: and (3) filling the permanent magnet magnetic field spatial distribution simulation data obtained in the step (2) into the three-dimensional array Intensity constructed in the step (3.1) according to the following subscript mapping relation. For a certain point P with coordinates (x ', y ', z '), the magnetic induction intensity value of the point is I, the subscript mapping relationship between the magnetic induction intensity value data of the position and the three-dimensional array elements can be obtained from formulas (1) to (3):

wherein s isx、syAnd szThe magnetic induction Intensity value I of the point P is stored in the Intensity with the corresponding subscript of [ [ 2 ] ], respectivelyi][j][k]If the Intensity value I of the magnetic induction is filled into Intensity, there is an Intensity [ I [ ]][j][k]=I。

For the space distribution analog data of the permanent magnet magnetic field, recording the maximum value I of the magnetic induction intensity valuemaxAnd the minimum value Imin

Step 3.3: and carrying out average normalization on the data in the three-dimensional array Intensity.

In this embodiment, for any element Intensity [ i ] [ j ] [ k ] in the three-dimensional array Intensity, a formula (4) is used to calculate:

wherein mu is the average value of the magnetic induction Intensity values in the magnetic field spatial distribution simulation data of the permanent magnet obtained in the step 2, and after average normalization, the size of each element in Intensity is mapped into the range of [0,1 ];

step 3.4: and (3) regarding the element values in the three-dimensional array Intensity as the pixel gray value in the gray map, and converting the three-dimensional gray map represented by the normalized three-dimensional array obtained in the step (3.3) into a color three-dimensional heat map with RGB channel information by using a cvtColor interface provided by an OpenCV (open computer vision library) of the cross-platform computer, so as to obtain the color of the heat map of the magnetic induction Intensity value of each measuring point. The color is characterized by an RGB pattern, the color of each measuring point can be represented by R, G, B three channel values, the RGB three channel values of all the measuring points respectively correspond to three arrays R [ w ] [ h ] [ d ], G [ w ] [ h ] [ d ] and B [ w ] [ h ] [ d ], and the arrays R, G and B are referred to as channel value arrays for short.

Step 3.5: and (3) reading the magnetic field space distribution simulation data of the permanent magnet obtained in the step (2) in the Unity project, and drawing a point-like three-dimensional model in the Unity scene aiming at the magnetic induction intensity measuring point position. The dotted three-dimensional model is colored with the colors represented by the R, G and B-channel value arrays obtained at step 3.4. And finally, combining all the colored point-like three-dimensional models to obtain the magnetic field distribution visual point cloud grid.

In the present embodiment, a point-like three-dimensional model is drawn in a Unity scene from the permanent magnet magnetic induction measurement point positions at a ratio of 1 meter to one Unity unit length in the world coordinate system of Unity. The dotted three-dimensional model is colored with the colors represented by the R, G and B-channel value arrays obtained at step 4.4. And finally, combining all the colored point-like three-dimensional models to obtain the magnetic field distribution visual point cloud grid.

And 4, step 4: and constructing a Model identification environment based on an augmented reality software development kit Vuforia, and realizing the relative pose identification of the permanent magnet relative to a front camera of augmented reality equipment by using a Model Target based on an identification Model.

And 3, the front camera of the augmented reality device can capture continuous image frames, and the image frames can be used as the input of a Model Target method so as to realize the superposition of the magnetic induction intensity visualization point cloud grid obtained in the step 3 on the position where the permanent magnet appears in the captured image frames.

Step 4.1: and (3) using Autodesk 3Ds Max modeling software to construct a permanent magnet three-dimensional model with the size and the shape consistent with the size and the shape of the real permanent magnet, and exporting the model into an obj file. And importing the obtained obj file into a UVLayout tool, and carrying out UV expansion on the constructed permanent magnet three-dimensional model.

UV refers to the u, v texture map coordinate points of the three-dimensional model, which define information of the location of each point on the picture and determine the location of the surface texture map. UV unfolding refers to the exact correspondence of each point on the image to the surface of the model object. The UV expansion is carried out to better draw the surface details of the three-dimensional model of the permanent magnet in the material drawing stage. Importing the UV-expanded obj file into a Substance Painter tool, drawing material textures of a three-dimensional model of the permanent magnet according to the material of the real permanent magnet, and exporting three mapping of color, metal degree and normal;

step 4.2: and (3) introducing the permanent magnet three-dimensional Model constructed in the step 4.1 into a Model Target creation platform Vuforia Model Target Generator provided by Vuforia, and configuring the Model orientation Model Up Vector, the Model size unit Model Units, the Model surface color Coloring and the Model Type according to the placing orientation, size and surface color condition of the real permanent magnet. The identification View Guide Views parameter needs to be set to an Advanced identification View in order to identify the permanent magnet from different viewing angles. After configuration is completed, generating a three-dimensional model recognition target;

step 4.3: uploading the three-dimensional Model recognition Target obtained in the step 4.2 to a cloud server special for Model Target recognition training of Vuforia, and performing cloud recognition training on the uploaded three-dimensional Model recognition Target. The Vuforia cloud server generates three-dimensional model rendering graphs obtained by observing the permanent magnet three-dimensional models under different camera poses, the three-dimensional model rendering graphs and the corresponding different camera poses are used as training samples, a pose estimation neural network is trained, and the permanent magnet pose estimation neural network weight obtained after training is led into a Unity project;

the attitude estimation neural network is an algorithm used by the Model Target method. Under the premise that the camera is calibrated, an image containing the recognition target is input into the posture estimation neural network, the network can calculate the posture (rotation and translation) of the recognition target relative to the camera, and the posture information can be used for realizing the effect of superposing the virtual three-dimensional object on the recognition target. After training is finished, deriving the permanent magnet attitude estimation neural network weight with Unity as a suffix name, and importing the weight into a Unity project;

step 4.4: and importing a Vuforia recognition library in the Unity project, and adding the preset game objects ARCamera and Model Target provided by the Vuforia recognition library in the scene. And (4) selecting the permanent magnet three-dimensional Model obtained in the step (4.1) as an identification Target on a Model Target Behaviour component of the Model Target object.

And 5: and (3) carrying out position calibration on the magnetic field distribution visualization point cloud grid obtained in the step (3.5), using augmented reality equipment as a client and a desktop computer as a server, realizing communication between the server and the client by using a Socket communication technology, sending the position of the magnetic induction intensity measuring point to the server by the client, and returning the magnetic induction intensity value of the corresponding position of the measuring point by the server. After the client (namely augmented reality equipment) successfully receives the returned measurement result, the result is displayed on a user interaction interface of the client on line, so that real-time measurement and online visualization of the space magnetic field distribution of the permanent magnet are realized. Fig. 4 is a flow chart of real-time measurement and online visualization of the magnetic field distribution in space of the permanent magnet, and step 5 specifically includes the following steps:

step 5.1: respectively registering the message for activating and hiding the magnetic field distribution visualization point cloud grid obtained in the step (3) into an On Target Found Event and an On Target Lost Event of a Default Trackable Event Handler component of the Model Target object so as to ensure that the magnetic field distribution point cloud grid can be visualized only when the augmented reality device correctly identifies the permanent magnet; carrying out coordinate alignment on the magnetic field distribution visualization point cloud grid and the permanent magnet three-dimensional model obtained in the step 4.1 so as to ensure that the magnetic field distribution visualization point cloud grid is superposed on the permanent magnet of the real world on line without deviation after successful identification;

step 5.2: and (3) uploading the file storing the permanent magnet magnetic field spatial distribution simulation data obtained in the step (2) to a server. And establishing communication connection between the client and the server through Socket. Calculating a three-dimensional vector V of the relative position of the magnetic induction intensity measuring point relative to the origin of the coordinate axis of the three-dimensional model of the permanent magnetrelative=(xrelative,yrelative,zrelative) Wherein x isrelative、yrelativeAnd zrelativeRespectively, the offset values of the measuring points in the x, y and z directions relative to the origin of the coordinate axes of the three-dimensional model of the permanent magnet. Will VrelativeAnd encoding and sending to the server side. The specific coding mode is to encode VrelativeThe json character string obtained by serializing the entity class of the data is converted into an array of a byte type in a UTF-8 format. Socket communication adopting a tcp protocol is used for carrying out communication transmission based on the type of data;

step 5.3: the server receives the three-dimensional vector V sent by the clientrelativeAnd acquiring V from the three-dimensional array Intensity constructed according to the permanent magnet magnetic field space distribution simulation data by the method of the step 3.1 and the step 3.2 when the server is started every time according to the subscript mapping relation in the step 3.2relativeCorresponding to the measuring positionAnd the magnetic induction scalar I returns the magnetic induction scalar I to the client. Wherein if the three-dimensional vector VrelativeIf the position is beyond the magnetic induction measurement range, the magnetic induction is considered to be negligible, and the value of I is 0.

Step 5.4: the client receives the magnetic induction scalar I returned by the server in the step 5.3, and converts the V calculated in the step 5.2relativeDisplaying the returned result on a user interaction interface of the client;

step 5.5: and publishing the Unity project, opening a solution project generated after the project is published, and deploying the solution project to the client.

In this embodiment, the publishing Platform for publishing the Unity project is set as a Windows Universal Platform (Windows) Universal application Platform. And (3) opening a solution project generated after the project is published by using Visual Studio 2019, and deploying the solution project to a wearable augmented reality device HoloLens published by Microsoft. After the deployment is successful, the HoloLens serving as the client can be in communication connection with the server, and a front-facing camera of the HoloLens is opened. When the Model Target identifies the real permanent magnet in the image frame captured by the front camera, the posture (rotation and translation) of the real permanent magnet relative to the front camera is calculated, and the magnetic field distribution visualization point cloud grid is projected to the position of the permanent magnet in the real space on the imaging of the HoloLens lens. In addition, the user can use two hands to move or rotate the virtual magnetic induction measuring instrument superimposed in the HoloLens lens imaging, and the end of the virtual magnetic induction measuring instrument is the magnetic induction measuring point in the step 5.2. By the real-time measurement method for the magnetic induction intensity of the permanent magnet, which is described in the steps 5.2, 5.3 and 5.4, a user can see the magnetic induction intensity of a magnetic induction intensity measurement point on line on a user interaction interface in the Hololens lens imaging, and fig. 5 is an effect diagram of the magnetic field distribution of the rectangular permanent magnet, which is observed on line by the method disclosed by the invention. The interaction of the user operating the virtual magnetic induction measuring instrument by using two hands realizes that the gesture recognition technology provided by Microsoft and integrated in Hololens is used, is out of the scope of the method, and therefore, the detailed description is not given.

It should be noted that: the above embodiments are only used for the technical solution of the present invention, and are not limited thereto; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions and scope of the present invention as defined in the appended claims.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种永磁体磁偏角&磁矩检测装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!