Method and system for calibrating position of nozzle of three-dimensional printer and related equipment
By acquiring and segmenting multi-view images of three-dimensional printer nozzles, combining color thresholds and image processing algorithms, the position of the nozzle in multiple directions is accurately determined, which solves the problem of inaccurate nozzle calibration in the prior art and improves the printing accuracy of three-dimensional printers.
Patent Information
- Application Number
- CN202510183647.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-18
- Publication Date
- 2025-07-01
AI Technical Summary
The existing three-dimensional printer nozzle position calibration method is not accurate enough due to the inaccurate image recognition technology, resulting in low accuracy in nozzle position calibration, which affects printing accuracy.
By acquiring the nozzle image including the first view and the second view, segmenting the image using a preset color threshold, determining the initial position of the nozzle, and combining the Hough circle detection algorithm and the contour detection algorithm, the position of the nozzle in both directions is accurately determined, and finally performing position calibration.
Improve the accuracy of nozzle position calibration, reduce the motion error caused by position deviation and time interval caused by separate shooting of different views, and ensure the consistency and accuracy of nozzle position information.
Smart Images

Figure CN120228909A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of three-dimensional printers, and in particular to a nozzle position calibration method and system for a three-dimensional printer, and related equipment. Background Art
[0002] 3D printing technology is a technology that uses a 3D printer to manufacture physical parts according to a 3D digital model. The purpose is to manufacture products with a three-dimensional structure by stacking materials layer by layer.
[0003] However, the printing tasks for some parts require 3D printers to have high-precision printing capabilities and high accuracy, otherwise the printed parts will have problems such as model misalignment and blurred boundaries. The existing calibration method uses image recognition technology to calibrate the nozzle position, but this image recognition technology simply calibrates the position based on the image of the nozzle. The position information obtained from the image is not accurate enough, which leads to low accuracy in the position calibration of the 3D printer nozzle. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to provide a nozzle position calibration method and system, and related equipment for a 3D printer, aiming to improve the accuracy of the position calibration of the nozzle of the 3D printer.
[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application provides a nozzle position calibration method for a 3D printer, the method comprising:
[0006] Obtaining a target printing position of a target printing nozzle of the 3D printer;
[0007] Acquire an image of the target printing nozzle to obtain a nozzle image; wherein the nozzle image includes a first view and a second view of the target printing nozzle, and a first direction corresponding to the first view and a second direction corresponding to the second view are perpendicular to each other;
[0008] Segmenting the nozzle image according to a preset first direction color threshold to obtain a first direction mask image;
[0009] Determine the initial nozzle first direction position of the target printing nozzle according to the first direction mask image;
[0010] Segmenting the second view according to a preset second direction color threshold to obtain a second direction mask image;
[0011] Determine the initial nozzle second direction position of the target printing nozzle according to the second direction mask image;
[0012] The target printing nozzle is calibrated according to the target printing position, the initial nozzle first direction position and the initial nozzle second direction position, so that the target printing nozzle moves to the target printing position.
[0013] In some embodiments, determining the initial nozzle first direction position of the target printing nozzle according to the first direction mask image includes:
[0014] Searching for a circular or nearly circular contour from the first directional mask image by using a Hough circle detection algorithm, so as to use a region containing the circular or nearly circular contour as a first directional contour region;
[0015] The initial nozzle first direction position of the target printing nozzle is determined according to the position of the first direction contour area in the nozzle image.
[0016] In some embodiments, determining the initial nozzle first direction position of the target printing nozzle according to the position of the first direction contour area in the nozzle image includes:
[0017] Segmenting the first direction contour area according to a preset nozzle center color threshold to obtain a nozzle center mask area;
[0018] A circular or nearly circular contour is found in the nozzle center mask area by using a Hough circle detection algorithm, so that the center point position of the circular or nearly circular contour area is used as the initial nozzle first view direction position.
[0019] In some embodiments, determining the initial nozzle second direction position of the target printing nozzle according to the second direction mask image includes:
[0020] Segment the second directional mask image according to a contour detection algorithm to obtain a second directional candidate contour;
[0021] Determine a target contour in the second direction according to the area of the candidate contour in the second direction; wherein the area of the target contour in the second direction is the maximum value among all the areas;
[0022] The initial nozzle second direction position of the target printing nozzle is determined according to the second direction target profile.
[0023] In some embodiments, determining the initial nozzle second direction position of the target printing nozzle according to the target profile in the second direction includes:
[0024] Determine the discharge point of the target printing nozzle according to the target contour in the second direction to obtain the target discharge point;
[0025] The initial nozzle second direction position of the target printing nozzle is determined according to the position of the target discharge point in the nozzle image.
[0026] In some embodiments, there are at least two nozzle images, and the position calibration of the target printing nozzle according to the target printing position, the initial nozzle first direction position and the initial nozzle second direction position so as to move the target printing nozzle to the target printing position includes:
[0027] Smoothing the initial nozzle first direction positions of the at least two nozzle images to obtain smoothed nozzle first direction positions;
[0028] Smoothing the initial nozzle second direction positions of the at least two nozzle images to obtain smoothed nozzle second direction positions;
[0029] The target printing nozzle is calibrated according to the first direction position of the smoothing nozzle, the second direction position of the smoothing nozzle and the target printing position, so that the target printing nozzle moves to the target printing position.
[0030] In some embodiments, acquiring the image of the target printing nozzle to obtain the nozzle image includes:
[0031] Reflecting the first view to the second direction by a right-angle reflection prism arranged on the printing plane;
[0032] The target printing nozzle and the right-angle reflection prism are imaged by a camera to obtain the nozzle image.
[0033] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a nozzle position calibration system for a 3D printer, the system comprising:
[0034] A position acquisition module, used to acquire a target printing position of a target printing nozzle of the 3D printer;
[0035] An image acquisition module, used to acquire an image of the target printing nozzle to obtain a nozzle image; wherein the nozzle image includes a first view and a second view of the target printing nozzle, and a first direction corresponding to the first view and a second direction corresponding to the second view are perpendicular to each other;
[0036] A first segmentation module, used for segmenting the nozzle image according to a preset first direction color threshold to obtain a first direction mask image;
[0037] A first positioning module, used for determining the initial nozzle first direction position of the target printing nozzle according to the first direction mask image;
[0038] A second segmentation module, configured to segment the second view according to a preset second direction color threshold to obtain a second direction mask image;
[0039] A second positioning module, used for determining the initial nozzle second direction position of the target printing nozzle according to the second direction mask image;
[0040] The position calibration module is used to calibrate the position of the target printing nozzle according to the target printing position, the first direction position of the initial nozzle and the second direction position of the initial nozzle, so as to move the target printing nozzle to the target printing position.
[0041] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0042] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0043] The nozzle position calibration method and system of the three-dimensional printer and the related equipment proposed in the present application, for the target printing nozzle, firstly collects the nozzle image including the first view and the second view. Then, the nozzle image is segmented according to the preset first direction color threshold to obtain the first direction mask image, and the initial nozzle first direction position of the target printing nozzle is determined according to the first direction mask image. Next, the second view is segmented according to the preset second direction color threshold to obtain the second direction mask image, and the initial nozzle second direction position of the target printing nozzle is determined according to the second direction mask image. Finally, the target printing nozzle is calibrated according to the target printing position, the initial nozzle first direction position and the initial nozzle second direction position, so that the target printing nozzle moves to the target printing position, and the first view and the second view are respectively extracted to obtain the initial nozzle first direction position and the initial nozzle second direction position. Therefore, the nozzle position calibration method and system of the three-dimensional printer and the related equipment provided in the embodiment of the present application can synchronously image the target printing nozzle in two directions to obtain the initial position of the nozzle in two directions from the nozzle image, thereby improving the information richness of the nozzle position obtained from the nozzle image, and accurately determining the initial nozzle first direction position and the initial nozzle second direction position based on the rich nozzle position information. In addition, by collecting the nozzle image including the first view and the second view, the state of the target printing nozzle in different directions can also be captured at the same time to reduce the position deviation caused by the separate shooting of different views, and reduce the motion error caused by the time interval, thereby ensuring the consistency and accuracy of the nozzle position information in different views. Finally, the embodiment of the present application can calibrate the target printing nozzle according to the accurate initial nozzle first direction position, the initial nozzle second direction position and the target printing position, thereby accurately moving the target printing nozzle to the target printing position, thereby improving the accuracy of the position calibration of the target printing nozzle. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is a flow chart of a nozzle position calibration method for a 3D printer provided in an embodiment of the present application;
[0045] Figure 2 yes Figure 1 Flow chart of step S102 in FIG.
[0046] Figure 3 is a schematic diagram of a nozzle image provided in an embodiment of the present application;
[0047] Figure 4 is a schematic diagram of an implementation of a nozzle position calibration method for a 3D printer provided in an embodiment of the present application;
[0048] Figure 5 yes Figure 1Flow chart of step S104 in FIG.
[0049] Figure 6 yes Figure 5 Flow chart of step S502 in FIG.
[0050] Figure 7 yes Figure 1 Flow chart of step S106 in FIG.
[0051] Figure 8 yes Figure 7 Flow chart of step S702 in FIG.
[0052] Fig. 9 yes Figure 1 ] is a flowchart of step S107;
[0053] Fig.10 It is a structural schematic diagram of a nozzle position calibration system for a 3D printer provided in an embodiment of the present application;
[0054] Fig.11 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] It should be noted that, although the functional modules are divided in the system schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0058] First, some nouns involved in this application are analyzed:
[0059] Three-Dimensional Printing (3DP): Also known as Additive Manufacturing (AM), it can transform digital models into physical objects by stacking materials layer by layer without the need for complex molds. 3D printing technology has been widely used in aerospace, medical, automotive, construction, education, cultural creativity and other fields. In the aerospace field, it is used to manufacture lightweight, high-strength parts to help reduce the weight of aircraft and improve fuel efficiency; in the medical field, 3D printing can customize implants and prostheses according to the patient's specific anatomical structure, significantly improving treatment effects and the patient's quality of life; in automotive manufacturing, it is used for rapid prototyping and small-batch production, which accelerates the R&D cycle and reduces costs.
[0060] Nozzle position calibration technology for 3D printers: Existing nozzle position calibration technology for 3D printers is mainly divided into three categories: manual calibration, semi-automatic calibration and visual calibration. Manual calibration is the most traditional calibration method, and the "paper method" is usually used to adjust the distance between the nozzle and the printing platform. Specifically, when calibrating the nozzle position, the user inserts a piece of paper with a thickness of about 0.1 mm between the nozzle and the printing platform, and continuously fine-tunes the Z-axis height of the nozzle at the four corners of the printing platform. After each fine-tuning, the paper is pulled until a slight friction resistance is felt. This process needs to be repeated to ensure that the relative height between the two nozzles and the platform is consistent. For calibration in the X and Y directions, the corresponding offset is set by printing the same model and comparing the alignment lines. The semi-automatic calibration method uses sensors such as load sensors, automatic leveling sensors, photoelectric sensors or piezoelectric diaphragm sensors to measure the nozzle position in real time and perform automatic calibration to improve the calibration accuracy. The visual calibration method uses a machine vision system to image the nozzle and the printing platform, and uses image processing technology to analyze the relative position of the nozzle to achieve position calibration of the printing nozzle.
[0061] In the process of 3D printers printing parts, some printing tasks require the 3D printer to have high-precision printing capabilities and high accuracy, otherwise the printed parts will have problems such as model misalignment and blurred boundaries. Although the existing visual calibration method can use image recognition technology to calibrate the nozzle position, this image recognition technology simply calibrates the position based on the image of the nozzle. The position information obtained from the image is not accurate enough, which leads to low accuracy in the position calibration of the 3D printer nozzle.
[0062] Based on this, the embodiments of the present application provide a nozzle position calibration method and system for a 3D printer, and related equipment, aiming to improve the position calibration accuracy of the nozzle of the 3D printer.
[0063] The nozzle position calibration method and system of the 3D printer and related equipment provided in the embodiments of the present application are specifically described through the following embodiments. First, the nozzle position calibration method of the 3D printer in the embodiments of the present application is described.
[0064] The nozzle position calibration method of a three-dimensional printer provided in the embodiment of the present application relates to the technical field of three-dimensional printers. The nozzle position calibration method of a three-dimensional printer provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server side, and can also be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the nozzle position calibration method of a three-dimensional printer, etc., but is not limited to the above forms.
[0065] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0066] Figure 1 is an optional flow chart of a nozzle position calibration method for a 3D printer provided in an embodiment of the present application. Figure 1The method in [description] is applied to the nozzle of a 3D printer. The 3D printer can be a single-nozzle 3D printer or a multi-nozzle printer. Among them, a single-nozzle 3D printer has one nozzle and uses the same printing material for 3D printing. A multi-nozzle printer has at least two nozzles. It can output one printing material through one nozzle for component printing, or output different printing materials through multiple nozzles to print components made of multiple materials. Common multi-nozzle 3D printers are mainly divided into two designs: one is the fixed multi-nozzle design, that is, multiple nozzles are installed on the same moving head and their positions are fixed; the other is the independent multi-nozzle design, that is, multiple nozzles are respectively installed on multiple independent moving heads. The nozzle of a 3D printer usually adopts an X, Y, Z three-axis motion structure in terms of motion form to ensure that the nozzle precisely covers the entire printing plane, thereby realizing multi-material 3D printing. For a single-nozzle printer, there may be a positional deviation between the nozzle and the printing platform; for a multi-nozzle 3D printer, in addition to the positional deviation between the nozzle and the printing platform, there may also be a positional deviation between multiple nozzles. The above-mentioned positional deviations may cause problems such as uneven material mixing or nozzle collision. Therefore, it is necessary to detect and calibrate the position of each nozzle before formal printing.
[0067] Figure 1 The method in [description] may include but is not limited to steps S101 to S107.
[0068] Step S101, obtain the target printing position of the target printing nozzle of the 3D printer;
[0069] Step S102, obtain an image of the target printing nozzle to obtain a nozzle image; among them, the nozzle image includes a first view and a second view of the target printing nozzle, and the first direction corresponding to the first view is perpendicular to the second direction corresponding to the second view;
[0070] Step S103, segment the nozzle image according to a preset first-direction color threshold to obtain a first-direction mask image;
[0071] Step S104, determine the initial nozzle first-direction position of the target printing nozzle according to the first-direction mask image;
[0072] Step S105, segment the second view according to a preset second-direction color threshold to obtain a second-direction mask image;
[0073] Step S106, determine the initial nozzle second-direction position of the target printing nozzle according to the second-direction mask image;
[0074] Step S107: Calibrate the position of the target printing nozzle according to the target printing position, the initial nozzle first-direction position, and the initial nozzle second-direction position, so that the target printing nozzle moves to the target printing position.
[0075] For steps S101 to S107 illustrated in the embodiments of the present application, the nozzle position calibration method, system, and related equipment of the three-dimensional printer proposed in the present application. For the target printing nozzle, it first acquires a nozzle image including a first view and a second view. Then, the nozzle image is segmented according to a preset first-direction color threshold to obtain a first-direction mask image, and the initial nozzle first-direction position of the target printing nozzle is determined according to the first-direction mask image. Next, the second view is segmented according to a preset second-direction color threshold to obtain a second-direction mask image, and the initial nozzle second-direction position of the target printing nozzle is determined according to the second-direction mask image. Finally, the position of the target printing nozzle is calibrated according to the target printing position, the initial nozzle first-direction position, and the initial nozzle second-direction position, so that the target printing nozzle moves to the target printing position. The position extractions of the first view and the second view are respectively performed to obtain the initial nozzle first-direction position and the initial nozzle second-direction position. Therefore, the nozzle position calibration method, system, and related equipment of the three-dimensional printer provided by the embodiments of the present application can perform synchronous imaging of the target printing nozzle in two directions to obtain the initial positions of the nozzle in two directions from the nozzle image, improving the information richness of the nozzle position obtained from the nozzle image, and can accurately determine the initial nozzle first-direction position and the initial nozzle second-direction position according to the rich nozzle position information. Moreover, by acquiring a nozzle image including a first view and a second view, it is also possible to capture the states of the target printing nozzle in different directions at the same moment, so as to reduce the position deviation caused by separately shooting different views and reduce the motion error caused by the time interval, ensuring the consistency and accuracy of the nozzle position information in different views. Finally, the embodiments of the present application can calibrate the position of the target printing nozzle according to the accurate initial nozzle first-direction position, the initial nozzle second-direction position, and the target printing position, so as to accurately move the target printing nozzle to the target printing position, improving the accuracy of calibrating the position of the target printing nozzle.
[0076] Before step S101 of some embodiments, a printer displacement control instruction and an image acquisition instruction may be generated according to a preset calibration configuration file and component information input by a user. The calibration configuration file may include, but is not limited to: printer initialization data, camera initialization data, and camera distortion correction data. The printer initialization data is used to set the API key and communication port of the nozzle position calibration system of the three-dimensional printer, so that the three-dimensional printer is connected to the nozzle position calibration system of the three-dimensional printer. The component information may include, but is not limited to: the size of the component, the material of the component, and the target printing position. The component information is used to set the nozzle displacement control parameters of the printer, and a printer displacement control instruction may be generated according to the nozzle displacement control parameters of the printer. The printer displacement control instruction is used to control the displacement of the printer nozzle. The camera initialization data is used to connect the camera and the nozzle position calibration system of the three-dimensional printer and set the imaging parameters of the camera. The imaging parameters may include, but are not limited to: camera aperture, imaging field of view, acquisition frequency, and acquisition duration. An image acquisition instruction may be generated according to the imaging parameters. The image acquisition instruction is used to control the camera to acquire the nozzle image of the target printing nozzle.
[0077] In step S101 of some embodiments, the target printing position of the target printing nozzle of the three-dimensional printer may be obtained from the component information input by the user. The target printing nozzle is the printing nozzle that needs to be displacement-calibrated. If the three-dimensional printer that needs to be nozzle-position-calibrated is a single-nozzle three-dimensional printer, then the single nozzle is the target printing nozzle. If the three-dimensional printer that needs to be nozzle-position-calibrated is a multi-nozzle three-dimensional printer, the target printing nozzle is selected from multiple candidate printing nozzles. The target printing position refers to the starting position where the target printing nozzle performs three-dimensional printing on the component, and is represented by the X, Y, and Z coordinates in three-dimensional space.
[0078] It should be noted that if the three-dimensional printer that needs to be nozzle-position-calibrated is a multi-nozzle three-dimensional printer, the operation of selecting the target printing nozzle may be sequentially selected by the system according to the identifiers of the candidate printing nozzles, or may be selected by the user through the operation interface, or other target printing nozzle selection methods may be set according to the actual needs of those skilled in the art.
[0079] Before step S102 of some embodiments, the target printing nozzle can be roughly displaced according to the target printing position, so that the target printing nozzle moves near the target printing position, and then the nozzle image of the target printing nozzle is collected by a camera to perform precise position calibration on the target printing nozzle. Therefore, a camera with a smaller imaging field of view can be selected, which expands the selection range of the camera and reduces the hardware cost of the camera. It should be noted that when the target printing nozzle is roughly displaced, the target printing nozzle needs to be moved to the middle area of the imaging field of view of the camera, so that the target printing nozzle can be located in the optimal field of view range of the camera, reducing the degree of nozzle deformation caused by the edge distortion of the imaging field of view of the camera, and thus improving the accuracy of determining the initial position of the nozzle from the nozzle image.
[0080] In step S102 of some embodiments, an image of the target printing nozzle is collected by a camera, and a nozzle image can be obtained. On this basis, a two-dimensional coordinate system can be established according to the nozzle image, and a coordinate conversion table can be established according to the two-dimensional coordinate system and the three-dimensional space coordinate system, so as to convert the three-dimensional space position of the target printing nozzle into a two-dimensional position on the nozzle image according to the coordinate conversion table. Among them, in the coordinate conversion table, each pixel corresponds to a coordinate position in the three-dimensional coordinate system. Specifically, each coordinate in the two-dimensional coordinate system is a pixel of the nozzle image. In the three-dimensional coordinate system, the unit coordinate length on the X, Y, and Z coordinate axes can be 0.045 mm, that is, the conversion relationship for converting the initial position of the target printing nozzle from the three-dimensional space coordinate system to the two-dimensional coordinate system is 0.045 mm / pixel.
[0081] In addition, the nozzle image includes a first view and a second view of the target printing nozzle. Among them, the first view is the view of the target printing nozzle in the first direction, which can reflect the information of the target printing nozzle on the first plane, and the first plane is perpendicular to the first direction; the second view is the view of the target printing nozzle in the second direction, which can reflect the information of the target printing nozzle on the second plane, and the second plane is perpendicular to the second direction. Among them, the first direction is any one of the X, Y, and Z coordinate axes, and the second direction is any one of the X, Y, and Z coordinate axes different from the first direction. Therefore, the first direction and the second direction are perpendicular. For example, the first direction can be the Z-axis direction, then the first view can be a bottom view, and the first view is used to describe the position of the target printing nozzle on the XY plane, that is, the positions on the X-axis and Y-axis; the second direction can be the X-axis direction, then the second view can be a front view, and the second view is used to describe the position of the target printing nozzle on the YZ plane, that is, the positions on the Y-axis and Z-axis.
[0082] It should be noted that since the nozzle image includes the first view and the second view of the target printing nozzle, and each view can reflect the position of the target printing nozzle on a plane, during the process of establishing the coordinate conversion table, two coordinate axes on the plane can be used as the two coordinate axes of the two-dimensional coordinate system to convert each coordinate axis of the three-dimensional space coordinate system into the coordinate axes of the two-dimensional coordinate system. Specifically, first, the two coordinate axes corresponding to the first view are respectively used as the X-axis and the Y-axis in the nozzle image. Then, the two coordinate axes corresponding to the second view are respectively used as the X-axis and the Y-axis in the nozzle image. For example, when the first view reflects the positions of the X-axis and the Y-axis of the target printing nozzle in the three-dimensional space, the X-axis in the three-dimensional space can be used as the Y-axis in the nozzle image, and the Y-axis in the three-dimensional space can be used as the X-axis in the nozzle image. When the second view reflects the positions of the Y-axis and the Z-axis of the target printing nozzle in the three-dimensional space, the Y-axis in the three-dimensional space can be used as the X-axis in the nozzle image, and the Z-axis in the three-dimensional space can be used as the Y-axis in the nozzle image.
[0083] Please refer to Figure 2 , in some embodiments, step S102 may include but is not limited to steps S201 to S202:
[0084] Step S201, reflecting the first view to the second direction through a right-angled reflecting prism arranged on the printing plane;
[0085] Step S202, imaging the target printing nozzle and the right-angled reflecting prism through a camera to obtain a nozzle image.
[0086] In step S201 of some embodiments, the printing plane is a plane parallel to the printing platform, and the printing platform is used to place the component being printed during the three-dimensional printing process. The right-angled reflecting prism is detachably arranged on the printing area on the printing plane, so that the right-angled reflecting prism is only arranged on the printing plane during the position calibration process of the target printing nozzle, facilitating the position calibration of the target printing nozzle and not interfering with the printing of the component by the target printing nozzle.
[0087] It should be noted that the hypotenuse of the right-angled reflecting prism is a mirror surface, and the included angle between the hypotenuse and the base of the right-angled reflecting prism is set to 45 degrees to reduce the optical distortion caused by other included angles and weaken the deformation degree of the reflected first view. The size of the right-angled reflecting prism needs to meet the requirement of being able to reflect the first view of the target printing nozzle during the position process of the target printing nozzle.
[0088] In step S202 of some embodiments, a camera can be set on the printing plane. The imaging plane of the camera's lens is parallel to the second direction, and the lens of the camera faces the hypotenuse of the right-angle reflecting prism, so that the lens of the camera can collect the nozzle image, and the nozzle image includes a first view and a second view. The camera can be a high-definition camera for high-definition imaging of the target printing nozzle, so that more position information is included in the nozzle image.
[0089] It should be noted that in the field of view of the camera's lens, the first view reflected by the right-angle reflecting prism can only occupy a part of the camera's area, and the other part of the area is used to collect the second view of the target printing nozzle.
[0090] Figure 3 This is a specific embodiment of the nozzle image. For example, Figure 3 As shown, the first direction of the target printing nozzle is the XY-axis direction, the first view is the bottom view of the target printing nozzle, the second direction is the Z-axis direction, the second view is the side view of the target printing nozzle, the upper half of the nozzle image is the second view of the target printing nozzle, and the lower half of the nozzle image is the first view of the target printing nozzle.
[0091] In some embodiments, the target printing position of the target printing nozzle may exceed the field of view of the camera's lens. Therefore, the height of the camera can be changed by setting a bracket. Specifically, a bracket with adjustable height is set on the printing platform, and the camera is set on the bracket to flexibly adjust the height of the camera according to the acquisition requirements of the nozzle image, so as to ensure that the nozzle can be clearly captured by the camera at any printing position, ensuring the flexibility of the camera to capture the nozzle image. In addition, the right-angle reflecting prism can also be set on the bracket to ensure that the camera can obtain the first view of the target printing nozzle.
[0092] It should be noted that the bracket is set according to the fixing requirements of the camera and the right-angle reflecting prism, so that during the process of calibrating the position of the target printing nozzle, the vibration caused by the displacement of the target printing nozzle has a reduced impact on the displacement of the camera and the right-angle reflecting prism, enabling the camera to stably image the target printing nozzle and reducing the error between the initial position and the actual position of the target printing nozzle in the nozzle image. For example, the bracket can adopt a multi-layer structure design to enhance its mechanical strength and stability, and at the same time, by selecting earthquake-resistant materials to manufacture the bracket, the earthquake-resistant ability of the bracket is further improved.
[0093] For example, Figure 4As shown, a bracket is provided on the printing platform, and the lens of the camera and a right-angle reflecting prism are installed on the bracket. A target printing nozzle is placed above the hypotenuse of the right-angle reflecting prism, such that a right-angle relationship is formed among the lens of the camera, the right-angle reflecting prism, and the target printing nozzle. It should be noted that when setting the lens of the camera and the right-angle reflecting prism, the lens of the camera and the right-angle reflecting prism can be set according to the target printing position, so that the camera can capture an image including the target printing position, then move the target printing nozzle into the field of view of the camera lens, and then collect the nozzle image of the target printing nozzle.
[0094] In some other embodiments, the right-angle reflecting prism can also be provided on the moving head. The right-angle reflecting prism can be fixedly provided or detachably provided on the moving head. The size of the right-angle reflecting prism and the position where the right-angle reflecting prism is provided need to satisfy reflecting the second view of the target printing nozzle to the first direction, so that the camera can indirectly image the second view of the target printing nozzle. The camera is provided on the printing plane, and the imaging plane of the lens of the camera is parallel to the first direction and can directly image the first view of the target printing nozzle.
[0095] In the steps S201 to S202 illustrated in the embodiments of the present application, the first view is reflected to the second direction by the right-angle reflecting prism provided on the printing plane, and the camera images the target printing nozzle and the right-angle reflecting prism to obtain a nozzle image. Therefore, the nozzle position calibration method of the 3D printer illustrated in the embodiments of the present application can include the first view and the second view in the same nozzle image, reflect the position of the target printing nozzle on the three coordinate axes of X, Y, and Z, reduce the time and computing resources required for obtaining the position of the target printing nozzle on the three coordinate axes of X, Y, and Z multiple times, simplify the calibration process, and thus improve the efficiency and reliability of the entire 3D printing system. Moreover, the nozzle position calibration method of the 3D printer illustrated in the embodiments of the present application captures the state of the target printing nozzle at the same moment, ensures the consistency and accuracy of the nozzle position information in the nozzle image, reduces the position deviation caused by separately shooting different views, and reduces the motion error caused by the time interval, thereby improving the accuracy of nozzle calibration.
[0096] In step S103 of some embodiments, since the color of the three-dimensional printer nozzle has a large difference from the background color, the first-direction color threshold can be determined in advance according to the color of the three-dimensional printer nozzle. Therefore, during the process of calibrating the position of the three-dimensional printer nozzle, the first-direction mask image can be segmented from the nozzle image by the first-direction color threshold. For example, if the color of the three-dimensional printer nozzle is gold and the background color is black, the first-direction color threshold can be set according to gold and black. It should be noted that the first-direction color threshold is a value in the hue-saturation-value (HSV) color space, including the first-direction hue threshold, the first-direction saturation threshold, and the first-direction value threshold. Moreover, since the color of the three-dimensional printer nozzle is not a single color but has a certain color range, the first-direction color threshold can be understood as the upper and lower color limits set for the color range. Therefore, the first-direction color range can be determined according to the first-direction color threshold. The first-direction mask image refers to the area of the nozzle image where the color is within the first-direction color range. Specifically, first, the nozzle image is converted into the HSV color space, and then the first-direction hue value range, the first-direction saturation value range, and the first-direction value range of the color of the three-dimensional printer nozzle in the HSV color space are determined according to the first-direction color threshold. Then, the area within the first-direction hue value range, the first-direction saturation value range, and the first-direction value range is segmented from the nozzle image as the first-direction mask image.
[0097] In step S103 of some other embodiments, it is necessary to first segment the first view and the second view from the nozzle image, and then segment the first view according to the first-direction color threshold to obtain the first-direction mask image. Among them, the specific implementation manner of segmenting the first view and the second view from the nozzle image can be: segmenting the nozzle image according to the boundary of the right-angle reflection prism, or segmenting the nozzle image according to the positional relationship between the first view and the second view, or segmenting the nozzle image according to the positional relationship between the two views and the nozzle image. The specific implementation manner of segmenting the first view according to the first-direction color threshold is similar to the above specific embodiments of segmenting the nozzle image according to the first-direction color threshold. The only difference is whether to segment the first view or the nozzle image. This application will not elaborate further.
[0098] After step S103 of some embodiments, Gaussian blur processing may also be performed on the first-direction mask image to reduce noise and details in the first-direction mask image, reduce the computational amount for determining the initial nozzle position in the first direction based on the first-direction mask image, and improve the efficiency of determining the initial nozzle position in the first direction. It should be noted that after determining the second-direction mask image, Gaussian blur processing may also be performed on the second-direction mask image; after determining the nozzle center mask region, Gaussian blur processing may also be performed on the nozzle center mask region.
[0099] In step S104 of some embodiments, the initial position of the target printing nozzle includes the initial nozzle position in the first direction, where the initial nozzle position in the first direction refers to the position of the discharging point of the target printing nozzle in the first view. Since the nozzle image includes the first view, after extracting the first-direction mask image from the nozzle image, the initial nozzle position in the first direction of the target printing nozzle can be determined based on the first-direction mask image.
[0100] It should be noted that since the first view can reflect the positions of the target printing nozzle on two coordinate axes in the first plane, the initial nozzle position in the first direction may include the positions of the discharging point of the target printing nozzle on the above two coordinate axes.
[0101] It should be noted that in the first view of this embodiment, the discharging point of the target printing nozzle is located at the center of the target printing nozzle. Therefore, the center position of the target printing nozzle can be regarded as the discharging point of the target printing nozzle, that is, the center point position of the target printing nozzle can be determined as the initial nozzle position in the first view direction.
[0102] Please refer to Figure 5 , in some embodiments, step S104 may include but is not limited to steps S501 to S502:
[0103] Step S501, searching for circular or nearly circular contours from the first-direction mask image through the Hough circle detection algorithm, and taking the region containing the circular or nearly circular contours as the first-direction contour region;
[0104] Step S502, determining the initial nozzle position in the first direction of the target printing nozzle according to the position of the first-direction contour region in the nozzle image.
[0105] In step S501 of some embodiments, the first-direction contour region refers to the region of the outer contour of the target printing nozzle in the first view. The Hough circle detection algorithm is a classic image processing method based on the Hough transform, which can effectively determine the circular or nearly circular contour features in an image by identifying the center and radius of the circle in the image. Since there may be more than one nozzle image region within the first-direction color range, and the contour of the target printing nozzle in the first view is circular or nearly circular, the circular or nearly circular contour can be accurately identified from the first-direction mask image through the Hough circle detection algorithm, and the circular or nearly circular contour is determined as the contour of the target printing nozzle. Then, the region containing the circular or nearly circular contour is determined as the first-direction contour region.
[0106] In steps S501 to S502 illustrated in the embodiments of the present application, first, the circular or nearly circular contour is searched from the first-direction mask image through the Hough circle detection algorithm, and the region containing the circular or nearly circular contour is used as the first-direction contour region. Then, the initial nozzle first-direction position of the target printing nozzle is determined according to the position of the first-direction contour region in the nozzle image. Therefore, in the nozzle position calibration method of the 3D printer illustrated in the embodiments of the present application, after the first-direction contour region is determined through the Hough circle detection algorithm, the initial nozzle first-direction position of the target printing nozzle is further identified on the first-direction contour region, which can limit the range for identifying the initial nozzle first-direction position and effectively exclude the interference of other regions outside the contour region on the identification of the initial nozzle first-direction position, thereby improving the identification accuracy of the initial nozzle first-direction position.
[0107] Please refer to Figure 6 , in some embodiments, step S502 may include but is not limited to steps S601 to S602:
[0108] Step S601: Segment the first-direction contour region according to a preset nozzle center color threshold to obtain a nozzle center mask region;
[0109] Step S602: Search for a circular or nearly circular contour from the nozzle center mask region through the Hough circle detection algorithm, and use the center point position of the region of the circular or nearly circular contour as the initial nozzle first-view direction position.
[0110] In step S601 of some embodiments, in the first view, since the middle part of the target printing nozzle is the discharge port of the target printing nozzle, the center point of the discharge port can be regarded as the discharge point of the target printing nozzle. Moreover, since the color of the discharge port is quite different from the color of the target printing nozzle, the nozzle center color threshold can be determined in advance according to the color of the discharge port of the 3D printer nozzle. Therefore, during the process of calibrating the position of the nozzle of the 3D printer, the nozzle center mask region can be segmented from the nozzle image by the nozzle center color threshold. For example, the color of the 3D printer nozzle can be gold, and the color of the discharge port can be gray, then the nozzle center color threshold can be set according to gold and gray. It should be noted that similar to the first direction color threshold, the nozzle center color threshold is also a value in the HSV color space, including the nozzle center hue threshold, the nozzle center saturation threshold, and the nozzle center lightness threshold. Moreover, since the color of the discharge port is not a single color but has a certain color range, the nozzle center color threshold can also be understood as the upper and lower color limits set for the color range. Therefore, the nozzle center color range determined by the nozzle center color threshold can be obtained. The nozzle center mask region refers to the region of the nozzle image where the color is within the nozzle center color range. The specific implementation of segmenting the first direction contour region according to the nozzle center color threshold to obtain the nozzle center mask region is similar to the specific implementation of determining the first direction mask image according to the first direction color threshold in step S103. The specific implementation of step S103 can be referred to, and details are not described herein again.
[0111] In step S602 of some embodiments, the Hough circle detection algorithm can be used to find circular or nearly circular contours from the nozzle center mask region, and the center point position of the region of the circular or nearly circular contour can be used as the initial nozzle first view direction position. Specifically, since the Hough circle detection algorithm can determine the center point of the circular or nearly circular contour during the process of finding the circular or nearly circular contour, and in the first view, the center point of the discharge port can be regarded as the discharge point of the target printing nozzle. Therefore, the center point of the circular or nearly circular contour identified from the nozzle center mask region can be regarded as the center point of the discharge port, and the position of the center point of the discharge port in the nozzle image can be used as the initial nozzle first view direction position.
[0112] Steps S601 to S602 shown in the embodiments of the present application first segment the first-direction contour region according to a preset nozzle center color threshold to obtain a nozzle center mask region. Then, a circular or nearly circular contour is found from the nozzle center mask region through the Hough circle detection algorithm, and the center point position of the region of the circular or nearly circular contour is used as the initial nozzle first-view direction position, which can further exclude the interference of the region outside the nozzle center mask region on the identification of the discharge point of the target printing nozzle, more accurately determine the discharge point of the target printing nozzle, and then determine the initial nozzle first-view direction position according to the discharge point of the target printing nozzle, improving the accuracy of extracting the initial nozzle first-view direction position.
[0113] Before step S105 in some embodiments, after determining the initial nozzle first-view direction position, the second view can be segmented from the nozzle image according to the initial nozzle first-view direction position and the positional relationship between the first view and the second view, or the second view can be segmented from the nozzle image according to the initial nozzle first-view direction position and the region of the second view in the nozzle image, so as to prevent the target printing nozzle in the first view.
[0114] In step S105 of some embodiments, since the color difference between the target printing nozzle and the background color is large, a second-direction color threshold can be determined in advance according to the three-dimensional printer nozzle color and the background color. Therefore, during the process of calibrating the position of the nozzle of the three-dimensional printer, the second-direction mask image can be segmented from the second view through the second-direction color threshold. The second-direction mask image refers to the nozzle image region where the color is within the second-direction color range. The specific implementation of segmenting the second view according to the preset second-direction color threshold to obtain the second-direction mask image is similar to the specific implementation of step S103. Please refer to the specific embodiments of step S103, and the present application will not elaborate.
[0115] In step S106 of some embodiments, the initial position of the target printing nozzle further includes the initial nozzle second-direction position; wherein, the initial nozzle second-direction position refers to the position of the discharging point of the target printing nozzle in the second view. Since the second view can reflect the position of the target printing nozzle in the second plane, therefore, the initial nozzle second-direction position of the target printing nozzle can be determined according to the second-direction mask image. It should be noted that since the positions of the discharging point of the target printing nozzle on two coordinate axes can be determined according to the first view, that is, the initial nozzle first-direction position includes the positions of the discharging point of the target printing nozzle on two coordinate axes of the three-dimensional space coordinate system, therefore, in the process of determining the initial nozzle second-direction position according to the second view, only the position of the target printing nozzle on the third coordinate axis needs to be determined, that is, the initial nozzle second-direction position is the position of the discharging point of the target printing nozzle on the third coordinate axis of the three-dimensional space coordinate system.
[0116] In some other embodiments, the initial nozzle second-direction position may also include the positions of the discharging point of the target printing nozzle on two coordinate axes of the three-dimensional space coordinate system reflected by the second plane.
[0117] It should be noted that in the second view of this embodiment, the discharging point of the target printing nozzle is located on the edge contour of the target printing nozzle. Therefore, the edge contour of the target printing nozzle, that is, the second-direction target contour, can be extracted from the second-direction mask image, and then the initial nozzle second-direction position can be determined according to the second-direction target contour.
[0118] Please refer to Figure 7 , in some embodiments, step S106 may further include but is not limited to steps S701 to S703:
[0119] Step S701, segment the second-direction mask image according to the contour detection algorithm to obtain the second-direction candidate contour;
[0120] Step S702, determine the second-direction target contour according to the area of the second-direction candidate contour; wherein, the area of the second-direction target contour is the maximum value among all areas;
[0121] Step S703, determine the initial nozzle second-direction position of the target printing nozzle according to the second-direction target contour.
[0122] Before step S701 of some embodiments, the nozzle position calibration method of the above three-dimensional printer further includes performing an expansion operation on the image to reduce the influence of the noise in the second-direction mask image on the contour detection and enhance the accuracy of the contour detection.
[0123] In step S701 of some embodiments, since there may be more than one nozzle image area within the color range in the second direction, a contour detection algorithm is required to segment the mask image in the second direction to obtain the contour of each nozzle image area, that is, the candidate contour in the second direction. The contour detection algorithm is used to identify the contour in the image that shows the color threshold in the second direction, and the contour that shows the color threshold in the second direction is used as the candidate contour in the second direction.
[0124] In step S702 of some embodiments, the target contour in the second direction refers to the contour of the target printing nozzle in the second view. Since the color threshold in the second direction is set according to the color of the nozzle of the 3D printer, and the area of the contour of the target printing nozzle in the second view is the largest, after obtaining the candidate contour in the second direction, the area of each candidate contour in the second direction can be calculated, and then the candidate contour in the second direction with the largest area is determined as the target contour in the second direction.
[0125] Steps S701 to S703 illustrated in the embodiments of the present application first segment from the mask image in the second direction according to the contour detection algorithm to obtain the candidate contour in the second direction, and determine the target contour in the second direction according to the area of the candidate contour in the second direction, and then determine the initial nozzle position in the second direction of the target printing nozzle according to the target contour in the second direction, which can screen out the target contour in the second direction that most conforms to the characteristics of the target printing nozzle from multiple candidate contours in the second direction, and determine the initial nozzle position in the second direction according to the target contour in the second direction, improving the accuracy of determining the initial nozzle position in the second direction.
[0126] Please refer to Figure 8 , in some embodiments, step S702 includes but is not limited to steps S801 to S802:
[0127] Step S801, determine the discharging point of the target printing nozzle according to the target contour in the second direction to obtain the target discharging point;
[0128] Step S802, determine the initial nozzle position in the second direction of the target printing nozzle according to the position of the target discharging point in the nozzle image.
[0129] In step S801 of some embodiments, since the discharging point of the target printing nozzle in the second view is on the contour of the target printing nozzle, the discharging point of the target printing nozzle can be found on the target contour in the second direction to obtain the target discharging point. As Figure 3 shown, since the Y-axis direction of the second view corresponds to the Z-axis of the target printing nozzle in the three-dimensional space, the position of each pixel point of the target contour in the second direction in the second view can be determined first, and then the lowest position of the target contour in the second direction on the Y-axis of the second view can be determined, and the pixel point with the lowest position of the target contour in the second direction is used as the target discharging point.
[0130] In step S802 of some embodiments, after determining the target discharging point, the position of the target discharging point in the nozzle image can be used as the initial nozzle second-direction position.
[0131] Steps S801 to S802 illustrated in the embodiments of the present application first determine the discharging point of the target printing nozzle according to the second-direction target contour to obtain the target discharging point, and then determine the initial nozzle second-direction position of the target printing nozzle according to the position of the target discharging point in the nozzle image, which can accurately determine the initial nozzle second-direction position.
[0132] In step S107 of some embodiments, the target printing positions include: the first-direction target position and the second-direction target position. Among them, the first-direction target position is used to describe the starting position of the target printing nozzle in the first direction, and the second-direction target position is used to describe the starting position of the target printing nozzle in the second direction. On this basis, after determining the initial nozzle first-direction position and the initial nozzle second-direction position, the position of the target printing nozzle can be calibrated according to the target printing position, the initial nozzle first-direction position, and the initial nozzle second-direction position, so that the target printing nozzle moves to the target printing position. Specifically, first record the initial nozzle first-direction position and the initial nozzle second-direction position. Then, determine the offset of the target printing nozzle in the first direction according to the initial nozzle first-direction position and the first-direction target position to obtain the first offset, and determine the offset of the target printing nozzle in the second direction according to the initial nozzle second-direction position and the second-direction target position to obtain the second offset. Then, generate a target displacement instruction according to the first offset and the second offset to control the target printing nozzle to move to the target printing position through the target displacement instruction.
[0133] In some other embodiments, after the initial nozzle first-direction position, the offset of the target printing nozzle in the first direction can be first determined according to the initial nozzle first-direction position and the first-direction target position to obtain the first offset. Then, generate a first displacement instruction according to the first offset to control the target printing nozzle to move to the first-direction target position through the first displacement instruction. After the target printing nozzle moves to the first-direction target position, collect the nozzle image of the target printing nozzle again. Then, determine the initial nozzle second-direction position according to the nozzle image of the target printing nozzle collected again, and determine the offset of the target printing nozzle in the second direction according to the initial nozzle second-direction position and the second-direction target position to obtain the second offset. Finally, generate a second displacement instruction according to the second offset to control the target printing nozzle to move to the second-direction target position through the second displacement instruction.
[0134] Please refer to Fig. 9, in some embodiments, a nozzle video can be collected for the target printing nozzle, and then at least two nozzle images can be extracted from the nozzle video at a specific time interval. Alternatively, two nozzle images can be directly collected according to the specific time interval. Among them, the duration of the nozzle video can be 3 s, and the time interval can be 0.3 s. The duration of the nozzle video and the time interval can also be other specific values. Step S107 can include but is not limited to steps S901 to S903:
[0135] Step S901, smooth the initial nozzle first-direction position of at least two nozzle images to obtain a smoothed nozzle first-direction position;
[0136] Step S902, smooth the initial nozzle second-direction position of at least two nozzle images to obtain a smoothed nozzle second-direction position;
[0137] Step S903, calibrate the position of the target printing nozzle according to the smoothed nozzle first-direction position, the smoothed nozzle second-direction position, and the target printing position, so that the target printing nozzle moves to the target printing position.
[0138] In step S901 of some embodiments, for multiple nozzle images, the initial nozzle first-direction position in each nozzle image can be determined first, and then all the initial nozzle first-direction positions can be smoothed to obtain a smoothed nozzle first-direction position. Alternatively, after determining the initial nozzle first-direction position in each nozzle image, the smoothed nozzle first-direction position can be obtained by smoothing according to the determined initial nozzle first-direction positions until each nozzle image is traversed, and the last intermediate nozzle first-direction position is determined as the smoothed nozzle first-direction position. By smoothing the initial nozzle first-direction positions in at least two nozzle images, a more stable and accurate smoothed nozzle first-direction position can be obtained, effectively reducing the interference of the image noise of a single nozzle image on the judgment of the smoothed nozzle first-direction position.
[0139] For example, the smoothing algorithm can be the Kalman filtering algorithm. The specific implementation of smoothing the initial nozzle first direction position of at least two nozzle images through the Kalman filtering algorithm can be as follows: First, create a cv2.KalmanFilter object and set the parameters of the cv2.KalmanFilter object to 4 state variables and 2 measurement values; then, configure the measurement matrix, transition matrix, and process noise covariance of the cv2.KalmanFilter object. Among them, the measurement matrix maps the detected initial nozzle first direction position to the first two dimensions of the nozzle image state variables, the transition matrix describes the law of change of the state variables over time and takes into account the image noise of the nozzle image, and the process noise covariance adjusts the noise magnitude of the image noise by multiplying by a coefficient of 0.03. After detecting the initial nozzle first direction position of at least two nozzle images, correct the initial nozzle first direction position through the kalman.correct method and update the state estimate of the Kalman filter. Subsequently, call the kalman.predict method to obtain the predicted value of the initial nozzle first direction position, and extract the smoothed nozzle first direction position from the predicted value.
[0140] In step S902 of some embodiments, for multiple nozzle images, the initial nozzle second direction position in each nozzle image can be determined first, and then all the initial nozzle second direction positions are smoothed to obtain the smoothed nozzle second direction position. The specific implementation of smoothing the initial nozzle second direction position of at least two nozzle images is similar to the specific embodiment of smoothing the initial nozzle first direction position of at least two nozzle images, and the specific embodiment of step S901 can be referred to, which will not be elaborated in this application.
[0141] In step S903 of some embodiments, the target printing nozzle is position-calibrated according to the smoothed nozzle first direction position, the smoothed nozzle second direction position, and the target printing position, so that the target printing nozzle moves to the target printing position. The specific implementation of position-calibrating the target printing nozzle according to the smoothed nozzle first direction position, the smoothed nozzle second direction position, and the target printing position is similar to the specific implementation of position-calibrating the target printing nozzle according to the initial nozzle first direction position, the initial nozzle second direction position, and the target printing position, and the specific embodiment of step S107 can be referred to, which will not be elaborated in this application.
[0142] Steps S901 to S903 shown in the embodiments of the present application first smooth the initial nozzle first-direction positions of at least two nozzle images to obtain the smoothed nozzle first-direction positions, and smooth the initial nozzle second-direction positions of at least two nozzle images to obtain the smoothed nozzle second-direction positions. Then, based on the smoothed nozzle first-direction positions, the smoothed nozzle second-direction positions, and the target printing position, position calibration is performed on the target printing nozzle so that the target printing nozzle moves to the target printing position. Therefore, in the nozzle position calibration method of the 3D printer shown in the embodiments of the present application, by smoothing the initial nozzle first-direction positions and the initial nozzle second-direction positions, and then performing position calibration on the target printing nozzle, a more accurate initial position of the target printing nozzle can be obtained, so that when position calibration is performed on the target printing nozzle, a more accurate displacement of the target printing nozzle can be achieved.
[0143] After step S107 in some embodiments, the nozzle position calibration method of the above 3D printer further includes calculating a position calibration error amount based on the current position and the target printing position of the target printing nozzle, and comparing the preset calibration error threshold with the position calibration error amount to obtain calibration error comparison information, which is used to describe whether the calibration error threshold is greater than the position calibration error amount. When the calibration error comparison information indicates that the calibration error threshold is greater than the position calibration error amount, the position calibration of the target printing nozzle is ended; when the calibration error comparison information indicates that the calibration error threshold is less than the position calibration error amount, step S101 is executed to perform position calibration on the target printing nozzle again. Among them, the calibration error threshold can be 0.1 mm, or can be set to other specific values according to the actual needs of those skilled in the art.
[0144] In some embodiments, if the 3D printer has at least two nozzles, position calibration needs to be performed on at least two nozzles separately, and after calibrating at least two nozzles, the relative offset amount between the two nozzles is determined according to the current positions of the nozzles whose position calibration has ended. Specifically, each nozzle has a nozzle identifier. For any two nozzles corresponding to two adjacent nozzle identifiers, the relative offset amount between the two nozzles is determined, so that during the printing of a component, a printing displacement control instruction is generated based on the target printing position of each nozzle and the relative offset amount between the two nozzles, and the nozzle is controlled to move to the target printing position according to the printing displacement control instruction to print the component.
[0145] Please refer to Fig.10 , the embodiments of the present application also provide a nozzle position calibration system for a 3D printer, which can implement the above nozzle position calibration method of the 3D printer. The system includes:
[0146] A position acquisition module 1001, configured to acquire a target printing position of a target printing nozzle of a 3D printer;
[0147] An image acquisition module 1002, configured to acquire an image of the target printing nozzle to obtain a nozzle image; wherein, the nozzle image includes a first view and a second view of the target printing nozzle, and a first direction corresponding to the first view and a second direction corresponding to the second view are perpendicular to each other;
[0148] A first segmentation module 1003, configured to segment the nozzle image according to a preset first-direction color threshold to obtain a first-direction mask image;
[0149] A first positioning module 1004, configured to determine an initial nozzle first-direction position of the target printing nozzle according to the first-direction mask image;
[0150] A second segmentation module 1005, configured to segment the second view according to a preset second-direction color threshold to obtain a second-direction mask image;
[0151] A second positioning module 1006, configured to determine an initial nozzle second-direction position of the target printing nozzle according to the second-direction mask image;
[0152] A position calibration module 1007, configured to calibrate the position of the target printing nozzle according to the target printing position, the initial nozzle first-direction position, and the initial nozzle second-direction position, so that the target printing nozzle moves to the target printing position.
[0153] The specific implementation manner of the nozzle position calibration system of this 3D printer is basically the same as the specific embodiments of the above-mentioned nozzle position calibration method of the 3D printer, and will not be elaborated here.
[0154] An embodiment of the present application further provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the above-mentioned nozzle position calibration method of the 3D printer. This electronic device can be any intelligent terminal including a tablet computer, an in-vehicle computer, etc.
[0155] Please refer to Fig.11 , Fig.11 which schematically shows the hardware structure of an electronic device according to another embodiment. The electronic device includes:
[0156] A processor 1101, which can be implemented in a general-purpose CPU (Central Processing Unit, central processor), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc., and is configured to execute relevant programs to implement the technical solutions provided by the embodiments of the present application;
[0157] The memory 1102 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM), etc. The memory 1102 can store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 1102 and are called by the processor 1101 to execute the nozzle position calibration method of the 3D printer in the embodiments of this application;
[0158] The input / output interface 1103 is used to implement information input and output;
[0159] The communication interface 1104 is used to implement communication and interaction between this device and other devices. It can achieve communication through a wired manner (such as USB, network cable, etc.) or through a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);
[0160] The bus 1105 transmits information between the various components of the device (such as the processor 1101, the memory 1102, the input / output interface 1103, and the communication interface 1104);
[0161] Among them, the processor 1101, the memory 1102, the input / output interface 1103, and the communication interface 1104 are communicatively connected to each other inside the device through the bus 1105.
[0162] The embodiments of this application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the above-mentioned nozzle position calibration method of the 3D printer.
[0163] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory can include a high-speed random access memory, and can also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory optionally includes a memory remotely provided relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above-mentioned network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0164] The nozzle position calibration method, system and related devices of the 3D printer provided by the embodiments of the present application first collect nozzle images including a first view and a second view. Then, the nozzle images are segmented according to a preset first-direction color threshold to obtain a first-direction mask image, and the initial nozzle first-direction position of the target printing nozzle is determined according to the first-direction mask image. Next, the second view is segmented according to a preset second-direction color threshold to obtain a second-direction mask image, and the initial nozzle second-direction position of the target printing nozzle is determined according to the second-direction mask image. Finally, the target printing nozzle is position-calibrated according to the target printing position, the initial nozzle first-direction position and the initial nozzle second-direction position, so that the target printing nozzle moves to the target printing position to extract the positions of the first view and the second view respectively, and the initial nozzle first-direction position and the initial nozzle second-direction position are obtained. Therefore, the nozzle position calibration method, system and related devices of the 3D printer provided by the embodiments of the present application can perform synchronous imaging of the target printing nozzle in two directions to obtain the initial positions of the nozzle in two directions from the nozzle images, improving the information richness of the nozzle positions obtained from the nozzle images, and can accurately determine the initial nozzle first-direction position and the initial nozzle second-direction position according to the rich nozzle position information. Moreover, by collecting nozzle images including a first view and a second view, the states of the target printing nozzle in different directions can also be captured at the same time, so as to reduce the position deviation caused by separately shooting different views and reduce the motion error caused by the time interval, ensuring the consistency and accuracy of the nozzle position information in different views. Finally, the embodiments of the present application can perform position calibration on the target printing nozzle according to the accurate initial nozzle first-direction position, the initial nozzle second-direction position and the target printing position, so as to accurately move the target printing nozzle to the target printing position, improving the accuracy of the position calibration of the target printing nozzle.
[0165] The embodiments described in the embodiments of the present application are for more clearly explaining the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art know that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
[0166] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than those shown, or combine some steps, or different steps.
[0167] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed over multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solution of this embodiment.
[0168] Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices can be implemented as software, firmware, hardware, and appropriate combinations thereof.
[0169] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of this application and the above-mentioned drawings are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of this application described here can be implemented in an order different from those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.
[0170] It should be understood that in this application, "at least one (item)" means one or more, and "a plurality" means two or more.
[0171] In the several embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the above-mentioned units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling, direct coupling, or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of systems or units can be in electrical, mechanical, or other forms.
[0172] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they may be located in one place or distributed over multiple network units. Some or all of the units can be selected according to actual needs to achieve the objectives of the solution of this embodiment.
[0173] In addition, in each embodiment of the present application, each functional unit may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of a software functional unit.
[0174] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product. The computer software product is stored in a storage medium and includes multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of the present application. The foregoing storage medium includes: various media that can store programs, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs.
[0175] The preferred embodiments of the embodiments of the present application have been described above with reference to the accompanying drawings, and thus do not limit the scope of rights of the embodiments of the present application. Any modification, equivalent replacement, and improvement made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of rights of the embodiments of the present application.
Claims
1. A method for calibrating the nozzle position of a 3D printer, characterized in that: The method comprises: Obtaining a target printing position of a target printing nozzle of the 3D printer; Acquire an image of the target printing nozzle to obtain a nozzle image; wherein the nozzle image includes a first view and a second view of the target printing nozzle, and a first direction corresponding to the first view and a second direction corresponding to the second view are perpendicular to each other; Segmenting the nozzle image according to a preset first direction color threshold to obtain a first direction mask image; Determine the initial nozzle first direction position of the target printing nozzle according to the first direction mask image; Segmenting the second view according to a preset second direction color threshold to obtain a second direction mask image; Determine the initial nozzle second direction position of the target printing nozzle according to the second direction mask image; The target printing nozzle is calibrated according to the target printing position, the initial nozzle first direction position and the initial nozzle second direction position, so that the target printing nozzle moves to the target printing position.
2. The method according to claim 1, characterized in that The step of determining the initial nozzle first direction position of the target printing nozzle according to the first direction mask image comprises: Searching for a circular or nearly circular contour from the first directional mask image by using a Hough circle detection algorithm, so as to use a region containing the circular or nearly circular contour as a first directional contour region; The initial nozzle first direction position of the target printing nozzle is determined according to the position of the first direction contour area in the nozzle image.
3. The method according to claim 2, characterized in that The step of determining the initial nozzle first direction position of the target printing nozzle according to the position of the first direction contour area in the nozzle image comprises: Segmenting the first direction contour area according to a preset nozzle center color threshold to obtain a nozzle center mask area; A circular or nearly circular contour is found in the nozzle center mask area by using a Hough circle detection algorithm, so that the center point position of the circular or nearly circular contour area is used as the initial nozzle first view direction position.
4. The method according to claim 1, characterized in that: The step of determining the initial nozzle second direction position of the target printing nozzle according to the second direction mask image comprises: Segment the second directional mask image according to a contour detection algorithm to obtain a second directional candidate contour; Determine a target contour in the second direction according to the area of the candidate contour in the second direction; wherein the area of the target contour in the second direction is the maximum value among all the areas; The initial nozzle second direction position of the target printing nozzle is determined according to the second direction target profile.
5. The method according to claim 4, characterized in that The step of determining the initial nozzle second direction position of the target printing nozzle according to the target contour in the second direction comprises: Determine the discharge point of the target printing nozzle according to the target contour in the second direction to obtain the target discharge point; The initial nozzle second direction position of the target printing nozzle is determined according to the position of the target discharge point in the nozzle image.
6. The method according to claim 1, characterized in that There are at least two nozzle images, and the position calibration of the target printing nozzle is performed according to the target printing position, the first direction position of the initial nozzle, and the second direction position of the initial nozzle, so that the target printing nozzle moves to the target printing position, including: Smoothing the initial nozzle first direction positions of the at least two nozzle images to obtain smoothed nozzle first direction positions; Smoothing the initial nozzle second direction positions of the at least two nozzle images to obtain smoothed nozzle second direction positions; The target printing nozzle is calibrated according to the first direction position of the smoothing nozzle, the second direction position of the smoothing nozzle and the target printing position, so that the target printing nozzle moves to the target printing position.
7. The method according to claim 1, characterized in that The step of acquiring the image of the target printing nozzle to obtain the nozzle image comprises: Reflecting the first view to the second direction by a right-angle reflection prism arranged on the printing plane; The target printing nozzle and the right-angle reflection prism are imaged by a camera to obtain the nozzle image.
8. A nozzle position calibration system for a 3D printer, characterized in that: The system comprises: A position acquisition module, used to acquire a target printing position of a target printing nozzle of the 3D printer; An image acquisition module, used to acquire an image of the target printing nozzle to obtain a nozzle image; wherein the nozzle image includes a first view and a second view of the target printing nozzle, and a first direction corresponding to the first view and a second direction corresponding to the second view are perpendicular to each other; A first segmentation module, used for segmenting the nozzle image according to a preset first direction color threshold to obtain a first direction mask image; A first positioning module, used for determining the initial nozzle first direction position of the target printing nozzle according to the first direction mask image; A second segmentation module, used to segment the second view according to a preset second direction color threshold to obtain a second direction mask image; A second positioning module, used for determining the initial nozzle second direction position of the target printing nozzle according to the second direction mask image; The position calibration module is used to calibrate the position of the target printing nozzle according to the target printing position, the first direction position of the initial nozzle and the second direction position of the initial nozzle, so as to move the target printing nozzle to the target printing position.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the nozzle position calibration method of a three-dimensional printer as claimed in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, a nozzle position calibration method for a three-dimensional printer according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Visual calibration method based on multiple printing nozzles and multicolor 3D printing system
CN121224137A