Method and system for visually realizing configuration of magnetic attraction
Through visualization of the method and system for configuring magnetic suction, the flexibility and intuitiveness of traditional magnetic suction devices and part configuration methods are solved, and the flexibility, convenience and efficiency of part configuration are achieved.
Patent Information
- Application Number
- CN202311801266.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-26
- Publication Date
- 2025-06-27
AI Technical Summary
Traditional magnetic suction devices cannot meet the different needs of users. The existing adjustable magnetic suction devices are cumbersome and lack intuitiveness, and traditional parts configuration methods are inefficient and prone to errors.
Provide a method and system for visually realizing the configuration of magnetic suction. Through the steps of part selection, initializing magnetic suction configuration, magnetic suction configuration and configuration confirmation, users can freely select parts and adjust the position of magnetic suction devices through the visual interface to realize flexible configuration of parts.
It realizes the flexible, convenient and intuitive configuration of the magnetic suction device, improves the efficiency and accuracy of part configuration, reduces the need to write complex programs, and is suitable for various types of parts.
Smart Images

Figure CN120206419A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of industrial visualization configuration, and specifically relates to a method and system for visually realizing magnetic adsorption configuration. Background Art
[0002] Traditional magnetic adsorption devices usually adopt fixed magnetic force and structural designs, which cannot meet the different requirements of users for adsorbing objects. Although some existing adjustable magnetic adsorption devices can change the magnetic force magnitude, the configuration process is cumbersome and lacks intuitiveness. Therefore, a method and system for visually configuring magnetic adsorption are needed to provide a more flexible, convenient, and intuitive configuration solution for magnetic adsorption devices.
[0003] In industrial production, the configuration and assembly of parts are very important links. Traditional part configuration methods usually rely on manual operations, with low efficiency and high error rates. To improve the efficiency and accuracy of part configuration, some automated devices have been widely used. However, these devices usually require complex programming and debugging, and different configuration programs are needed for different types of parts, making them less flexible to use. Summary of the Invention
[0004] The purpose of the present invention is to solve the above problems and provide a method and system for visually realizing magnetic adsorption configuration. This method can provide a more flexible, convenient, and intuitive configuration solution for magnetic adsorption devices.
[0005] The technical solution adopted by the present invention to achieve the above purpose is as follows:
[0006] A method for visually realizing magnetic adsorption configuration includes the following steps:
[0007] Part selection: Obtain and display information of each part;
[0008] Initial magnetic adsorption configuration: Perform initialization processing on the obtained information to obtain the initial width and height, scaling ratio, and center distance percentage of the part;
[0009] Magnetic adsorption configuration: Configure the initialized data and visualize it;
[0010] Configuration confirmation: Generate and store the configuration data confirmed by the user.
[0011] The initial magnetic adsorption configuration includes the following steps:
[0012] According to the part ID in the part information, query the length and width pixel values, alpha value (i.e., the long side pixel value of the minimum circumscribed rectangle of the part / the actual length of the long side), and magnetic chuck matching information of the part picture;
[0013] Initialize the magnetic heads to be activated and the angles of the magnetic chucks according to the head_ids and angles in the magnetic chuck matching information of the part information;
[0014] Calculate the pixel values based on the physical dimensions and alpha value of the magnetic chuck in the part information;
[0015] Initialize the center position coordinates of the part according to the match_center in the part information;
[0016] Calculate a pageAlpha based on the width and height of the fixed canvas on the outer layer of the configuration interface in the part information, and initialize the scaling ratios of the part image, the magnetic chuck canvas, and the suction cup;
[0017] Calculate the percentage of the distance from the center of the part to the upper and left sides of the fixed canvas based on the center position coordinates of the part, the width and height of the fixed canvas, and the pageAlpha.
[0018] The calculation of the pixel values based on the physical dimensions and alpha value of the magnetic chuck in the part information is specifically as follows:
[0019] Pixel value = millimeter value of the physical dimension of the magnetic chuck * alpha.
[0020] The calculation of a pageAlpha based on the width and height of the fixed canvas on the outer layer of the configuration interface in the part information is specifically as follows:
[0021] pageAlpha1 = width and height of the fixed canvas on the outer layer of the configuration interface / width and height of the magnetic chuck
[0022] pageAlpha2 = width and height of the fixed canvas on the outer layer of the configuration interface / width and height of the workpiece
[0023] Take the minimum value between pageAlpha1 and pageAlpha2 as pageAlpha.
[0024] The calculation of the percentage of the distance from the center of the part to the upper and left sides of the fixed canvas based on the center position coordinates of the part, the width and height of the fixed canvas, and the pageAlpha is specifically as follows:
[0025] Percentage of left distance = ((width of the fixed canvas / 2 - width of the part center coordinate * pageAlpha) / width of the fixed canvas) * 100
[0026] Percentage of upper distance = ((height of the fixed canvas / 2 - height of the part center coordinate * pageAlpha) / height of the fixed canvas) * 100.
[0027] The magnetic suction configuration is specifically as follows:
[0028] Call the scale() function and pass in the scaling type to perform visual scaling on the canvas; call the rotate() function and pass in the rotation direction to perform visual rotation on the canvas; call the move() function, pass in the moving direction, the physical value of the moving distance, and the initial angle of the magnetic chuck to perform visual movement on the canvas.
[0029] The configuration confirmation is specifically as follows:
[0030] Generate corresponding configuration information according to the part ID, magnetic chuck ID, magnetic chuck angle, and the coordinate pixel value of the part image relative to the center point of the magnetic chuck.
[0031] A system for visually implementing magnetic adsorption configuration includes the following steps:
[0032] Part selection, used to obtain and display information about each part;
[0033] Initialize the magnetic adsorption configuration, used to perform initialization processing on the obtained information to obtain the initial width and height, scaling ratio, and center distance percentage of the part;
[0034] Magnetic adsorption configuration, used to configure the initialized data and visualize it;
[0035] Configuration confirmation, used to generate and store the configuration data confirmed by the user.
[0036] The present invention has the following beneficial effects and advantages:
[0037] 1. Flexibility: Users can freely select the required parts and adjust the position of the magnetic adsorption device according to actual needs, and use a visual method to implement part configuration without writing complex programs, which is flexible and convenient to use.
[0038] 2. Visual configuration: Through the visual interface, users can intuitively configure the magnetic adsorption device, reduce the cumbersome operations in the configuration process, and the magnetic adsorption device can be applied to various types of parts without writing different programs for different types of parts. Description of the Drawings
[0039] Figure 1 It is a method flow chart provided for a method of visually implementing magnetic adsorption configuration of the present invention;
[0040] Figure 2 It is a functional module diagram provided by the present invention. Detailed Description of the Invention
[0041] The following further describes the present invention in detail with reference to the drawings and embodiments.
[0042] In order to make the purpose, technical content, advantages, etc. of the present invention more clear and definite, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0043] See Figure 1 , which is the method flow chart provided by the present invention. As Figure 1 shown, the present invention provides a method for visually implementing magnetic attraction configuration, including:
[0044] Part selection, displaying information of each part, including part name, size, configuration status, etc., and the user selects the required configured parts;
[0045] Initializing magnetic attraction configuration information, initializing the configuration information of the selected configured parts and the magnetic attraction device;
[0046] Magnetic attraction configuration interface, visually displaying the initialized magnetic attraction information and the user performs magnetic attraction device configuration operations;
[0047] Configuration confirmation, generating the configured information after user confirmation.
[0048] In this embodiment, first, part information is imported into the part selection module. This embodiment is a workpiece part library generated by cutting a steel plate. This part library includes information such as workpiece serial number, workpiece thumbnail, workpiece name, workpiece size, workpiece weight, workpiece thickness, configuration status, etc. By calling the initPieceList() method and passing in the workpiece part list library, various information of the workpiece can be displayed in the part selection module, and the required workpieces can be screened according to conditions for magnetic attraction configuration.
[0049] Then, initialize the magnetic adsorption configuration. When initializing the magnetic adsorption configuration information, first, according to the selected workpiece information, call the magnetManage() method, pass in the workpiece ID, and query the length and width pixel values, alpha value (the long side pixel value of the minimum circumscribed rectangle of the part / the actual length of the long side in millimeters), and the magnetic chuck matching information of the workpiece picture; then call the initHeadIds() method, and according to the head_ids and angle of the returned magnetic chuck matching information, initialize the magnetic adsorption heads to be activated and the angles of the magnetic chucks. At the same time, call the setScaleInit() method, and according to the calculation formula: the physical size of the magnetic chuck in millimeters * alpha, calculate the pixel value, and initialize the center coordinates (x, y) of the workpiece according to match_center; then call the initSet() method, and according to the calculation formulas: the width and height of the fixed canvas on the outer layer of the configuration interface / the width and height of the magnetic chuck, the width and height of the fixed canvas on the outer layer of the configuration interface / the width and height of the workpiece, calculate a pageAlpha to initialize the scaling ratios of the workpiece picture, the magnetic chuck canvas, and the suction cup. The calculation of this ratio is to ensure that when initially loaded, the magnetic chuck canvas and the workpiece can be fully displayed in the fixed canvas on the outer layer of the configuration interface, eliminating the need for scaling after initial loading. According to this ratio, the initialized pixel value sizes of the workpiece and the magnetic chuck can be calculated according to the formula: width and height * pageAlpha. Finally, according to the formula: (the width of the fixed canvas / 2 - the width of the part center coordinate * pageAlpha) / the width of the fixed canvas * 100, and the same for the height, the percentage of the distance from the center point of the part to the center point of the fixed canvas above and to the left can be calculated.
[0050] After that, the above-mentioned initialized workpiece and magnetic chuck can be visually displayed in the magnetic adsorption configuration module. During magnetic adsorption configuration, visual operations on the magnetic chuck can be performed through zooming, rotating, and moving, including:
[0051] By calling the scale() function and passing in the scaling type and scale factor, the visual scaling of the canvas can be achieved. If the scaling type is "big", it means magnification; if it is "small", it means reduction. By calling the rotate() function and passing in the rotation direction and rotation angle, the visual rotation of the canvas can be achieved. If the rotation direction is "right", it rotates to the right, and the rotation angle is added to the angle of the magnetic chuck; if it is "left", it rotates to the left, and the rotation angle is subtracted from the angle of the magnetic chuck. By calling the move() function and passing in the movement direction and movement distance, the movement distance can be calculated through computation to achieve the visual movement configuration. If the movement direction is "left" or "right", it moves horizontally, and the x-coordinate of the workpiece center point is subtracted or added by the movement distance. If it is "top" or "bottom", it moves vertically, and the y-coordinate of the workpiece center point is subtracted or added by the movement distance. The movement distance can be obtained through the calculation formula: movement distance * Math.cos(angle of magnetic chuck rotation).
[0052] Finally, after the user confirms the completion of the configuration, through the configuration confirmation module, the configuration information of the magnetic chuck device after the user's configuration is confirmed. By calling the commitConfig() method and passing in the part ID, magnetic chuck ID, magnetic chuck angle, and the coordinate pixel value of the part image relative to the center point of the magnetic chuck, the corresponding configuration information can be generated. If the return value is true, it means the storage is successful; if it is false, it means the storage fails.
[0053] See Figure 2 , which is the functional module diagram provided by the present invention, includes the following modules:
[0054] Part acquisition module, used to acquire the specific information of the part;
[0055] Part selection module, used to display the information of each part, including part name, size, configuration status, etc., can also retrieve part information according to the part name, etc., and can also allow the user to select the parts to be configured;
[0056] Initial magnetic chuck configuration module, used to calculate the initial width, height, scaling ratio, and center distance percentage of the part according to the part information and magnetic chuck matching information;
[0057] Magnetic chuck configuration module, used to display the information of the initial magnetic chuck configuration module and the user's visual configuration operations;
[0058] Configuration confirmation module, used to generate and store the configuration information of the magnetic chuck device after the user's confirmation
[0059] In summary, the method of the present invention can achieve component configuration using a visualization method, without the need to write complex programs. It is flexible and convenient to use, and is not limited to standard components, making the configuration of magnetic attraction more convenient, intuitive and efficient.
Claims
1. A method for visually implementing magnetic attraction configuration, characterized in that, It includes the following steps: Part selection: Obtain and display the information of each part; Initialize magnetic adsorption configuration: Perform initialization processing on the obtained information to obtain the initialized width, height, scaling ratio, and center distance percentage of the part; Magnetic adsorption configuration: Configure the initialized data and visualize it; Configuration confirmation: Generate and store the configuration data confirmed by the user.
2. The method for visualizing the implementation of magnetic attraction configuration according to claim 1, wherein The initialization of the magnetic adsorption configuration includes the following steps: According to the part ID in the part information, query the length and width pixel values of the part image, the alpha value (i.e., the long side pixel value of the minimum bounding rectangle of the part / the actual length of the long side), and the magnetic chuck matching information; According to the head_ids and angle of the magnetic chuck matching information in the part information, initialize the magnetic heads to be activated and the angles of the magnetic chucks; Calculate the pixel values based on the physical size of the magnetic chuck and the alpha value in the part information; Initialize the center position coordinates of the part according to the match_center in the part information; Calculate a pageAlpha based on the width and height of the fixed canvas on the outer layer of the configuration interface in the part information, and initialize the scaling ratios of the part image, the magnetic chuck canvas, and the suction cup; Calculate the percentage of the distance from the part center to the upper and left sides of the fixed canvas based on the part center position coordinates, the width and height of the fixed canvas, and the pageAlpha.
3. A method for visualizing the implementation of magnetic attraction configuration according to claim 2, characterized in that, The calculation of the pixel values based on the physical size of the magnetic chuck and the alpha value in the part information is specifically as follows: Pixel value = millimeter value of the physical size of the magnetic chuck * alpha.
4. A method for visualizing the implementation of magnetic attraction configuration according to claim 2, characterized in that, The calculation of a pageAlpha based on the width and height of the fixed canvas on the outer layer of the configuration interface in the part information is specifically as follows: pageAlpha1 = width and height of the fixed canvas on the outer layer of the configuration interface / width and height of the magnetic chuck pageAlpha2 = width and height of the fixed canvas on the outer layer of the configuration interface / width and height of the workpiece Take the minimum value of pageAlpha1 and pageAlpha2 as pageAlpha.
5. A method for visualizing the implementation of magnetic attraction configuration according to claim 2, characterized in that, The calculation of the percentage of the distance from the part center to the upper and left sides of the fixed canvas based on the part center position coordinates, the width and height of the fixed canvas, and the pageAlpha is specifically as follows: Left distance percentage = ((fixed canvas width / 2 - width of the part center coordinate * pageAlpha) / fixed canvas width) * 100 Upper distance percentage = ((fixed canvas height / 2 - height of the part center coordinate * pageAlpha) / fixed canvas height) * 100.
6. A method for visualizing the implementation of magnetic attraction configuration according to claim 1, characterized in that, The magnetic adsorption configuration is specifically as follows: Call the scale() function, pass in the scaling type to perform visual scaling on the canvas; call the rotate() function, pass in the rotation direction to perform visual rotation on the canvas; call the move() function, pass in the movement direction, the physical value of the movement distance, and the initial angle of the magnetic chuck to perform visual movement on the canvas.
7. A method for visualizing the implementation of magnetic attraction configuration according to claim 1, characterized in that, The configuration confirmation is specifically as follows: Generate corresponding configuration information according to the part ID, magnetic chuck ID, magnetic chuck angle, and pixel values of the coordinates of the part image relative to the center point of the magnetic chuck.
8. A system for visually implementing magnetic attraction configuration, characterized in that It includes the following steps: Part selection, which is used to obtain and display the information of each part; Initialize the magnetic adsorption configuration to perform initialization processing on the acquired information to obtain the initialized width and height, scaling ratio, and center distance percentage of the part; The magnetic adsorption configuration is used to configure the initialized data and visualize it; Configuration confirmation is used to generate and store the configuration data confirmed by the user.