Nozzle assembly correction method, electronic equipment and computer storage medium
By acquiring and processing images of the printing platform and calculating nozzle correction parameters, the printing quality problem caused by nozzle component position offset was solved, achieving accurate correction and high-quality 3D printing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2026-03-31
AI Technical Summary
The problem of substandard print quality caused by the printhead assembly shifting after prolonged use is difficult to correct accurately with existing technology.
By acquiring images of the printing platform, a Cartesian coordinate system is established. The initial grayscale image is processed to make the line segments parallel to the coordinate axes. Pixel feature curves and line segment lengths are obtained, printhead correction parameters are calculated, and the printhead assembly is corrected.
It improves the printing quality of 3D printing equipment, ensures that the nozzle assembly does not shift during subsequent printing, and enhances printing accuracy.
Smart Images

Figure CN121756594A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of 3D printing technology, and in particular to a nozzle assembly calibration method, electronic device, and computer storage medium. Background Technology
[0002] 3D printing, also known as stereolithography or three-dimensional printing, is typically achieved using 3D printing equipment, a type of rapid prototyping device. It is commonly used in fields such as industrial design, module manufacturing, and medicine. 3D printing equipment primarily uses a model to be printed, applying a bindable material and printing a three-dimensional solid layer by layer.
[0003] Due to factors such as prolonged use of the nozzle assembly and the adhesive properties of the printing material itself, nozzle position shifts may occur. Therefore, it is necessary to calibrate the nozzle assembly before 3D printing to avoid printing quality issues caused by an uncalibrated nozzle assembly. Summary of the Invention
[0004] In view of this, this application provides a printhead assembly calibration method, an electronic device, and a computer storage medium to solve the problem of substandard print quality caused by printing directly without calibration of the printhead assembly.
[0005] The first aspect of this application provides a nozzle assembly calibration method applied to a 3D printing device. The 3D printing device includes an acquisition component, a nozzle assembly, and a printing platform. The nozzle assembly is used to print a calibration object on the printing platform. The acquisition component is used to acquire an image of the printing platform. The nozzle assembly calibration method includes: controlling the acquisition component to acquire the printing platform on which the calibration object is printed, obtaining an initial grayscale image. The calibration object includes multiple parallel first line segments and multiple parallel second line segments. The first line segments and second line segments are not parallel. The spacing between two adjacent first line segments is related to a first spacing coefficient. The spacing between two adjacent second line segments is large. The first line segment is related to the second interval coefficient; a Cartesian coordinate system is established based on the initial grayscale image; image processing is performed on the initial grayscale image to obtain a target grayscale image, wherein the first line segment or the second line segment in the target grayscale image is parallel to any coordinate axis of the Cartesian coordinate system; a pixel feature curve matching the target grayscale image is obtained, wherein the pixel feature curve characterizes the distribution of each pixel value in the target grayscale image; a first length of the first line segment and a second length of the second line segment are obtained; based on the pixel feature curve, the first length, the second length, the first interval coefficient, and the second interval coefficient, nozzle correction parameters are calculated; the nozzle correction parameters are used to correct the nozzle assembly.
[0006] Compared with related technologies, the embodiments of this application have at least the following advantages:
[0007] The initial grayscale image accurately represents the actual distribution of the object to be corrected. This involves processing the initial grayscale image so that the first or second line segment of the object to be corrected within it is parallel to any coordinate axis. This avoids inaccurate nozzle correction parameters calculated later if the first or second line segment is not parallel to the coordinate axis. Then, the pixel feature curves and line segment lengths of the target grayscale image are obtained. Finally, the pixel feature curves and line segment lengths are calculated to obtain the nozzle correction parameters. This allows the nozzle, corrected based on the nozzle correction parameters, to improve the print quality of the 3D printing equipment in subsequent 3D printing processes.
[0008] In some possible implementations, calculating the nozzle correction parameters based on the pixel feature curve, the first length, the second length, the first interval coefficient, and the second interval coefficient includes: calculating multiple peak coordinates of the pixel feature curve; obtaining the actual length of a single pixel in the correction object within the target grayscale image on the X-axis of the Cartesian coordinate system and the actual width on the Y-axis of the Cartesian coordinate system based on the multiple peak coordinates, the first length, the second length, the first interval coefficient, and the second interval coefficient; and obtaining the nozzle correction parameters based on the multiple peak coordinates, the actual length, and the actual width.
[0009] In some possible implementations, obtaining the nozzle correction parameters based on multiple peak coordinates, the actual length, and the actual width includes: obtaining a first motion gap value of the nozzle assembly on the X-axis based on the actual length and multiple peak coordinates; obtaining a second motion gap value of the nozzle assembly on the Y-axis based on the actual width and multiple peak coordinates; and obtaining the nozzle correction parameters using the first motion gap value and the second motion gap value.
[0010] In some possible implementations, the step of processing the initial grayscale image to obtain a target grayscale image includes: obtaining a target rotation angle, wherein the target rotation angle represents the angle at which the first line segment or the second line segment is parallel to the coordinate axis after the initial grayscale image is rotated; rotating the initial grayscale image based on the target rotation angle; obtaining target cropping data; and extracting the image within the region of interest in the rotated initial grayscale image based on the target cropping data to obtain the target grayscale image.
[0011] In some possible implementations, the target cropping data is obtained by: acquiring the horizontal field of view, vertical field of view, and theoretical shooting distance of the acquisition component; obtaining the theoretical acquisition width and theoretical acquisition length based on the horizontal field of view, the vertical field of view, and the theoretical shooting distance; and obtaining the target cropping data based on the first length, the second length, the theoretical acquisition width, and the theoretical acquisition length.
[0012] In some possible implementations, the target rotation angle is obtained by: cropping the initial grayscale image using the target cropping data; detecting the cropped initial grayscale image using edge detection technology to obtain an edge grayscale image; obtaining a first tilt angle between multiple first line segments in the edge grayscale image and the X-axis of the Cartesian coordinate system; obtaining a second tilt angle between multiple second line segments in the edge grayscale image and the Y-axis of the Cartesian coordinate system; and obtaining the target rotation angle based on the multiple first tilt angles and the multiple second tilt angles.
[0013] In some possible implementations, after cropping the initial grayscale image using the target cropping data, the method includes: obtaining an initial grayscale histogram of the cropped initial grayscale image; determining a pixel threshold for the initial grayscale histogram, wherein the pixel threshold is an index value of the pixel extrema in the initial grayscale histogram; and detecting the cropped initial grayscale image using edge detection technology to obtain an edge grayscale image, which includes: detecting the cropped initial grayscale image using edge detection technology based on the pixel threshold to obtain an edge grayscale image.
[0014] In some possible implementations, before controlling the acquisition component to acquire the printing platform with the calibration material printed on it to obtain an initial grayscale image, the method further includes: controlling the acquisition component to acquire the printing platform without the calibration material printed on it to obtain a blank image of the printing platform; the step of controlling the acquisition component to acquire the printing platform with the calibration material printed on it to obtain an initial grayscale image includes: controlling the acquisition component to acquire the printing platform with the calibration material printed on it to obtain an initial image of the printing platform; calculating the pixel difference between the blank image and the initial image, obtaining a difference image based on the pixel difference; and converting the difference image into the initial grayscale image.
[0015] A second aspect of this application discloses an electronic device including a memory and a processor, the processor being communicatively connected to the memory, the processor being used to execute the above-described nozzle assembly calibration method.
[0016] A third aspect of this application discloses a computer storage medium that stores computer instructions, which, when executed on the electronic device, cause the electronic device to perform the above-described nozzle assembly calibration method.
[0017] Understandably, the electronic device of the second aspect and the computer storage medium of the third aspect provided above correspond to the method of the first aspect. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart of a nozzle assembly calibration method provided in an embodiment of this application.
[0020] Figure 2 This is a schematic diagram of an initial grayscale image provided in a Cartesian coordinate system according to an embodiment of this application.
[0021] Figure 3 This is a schematic diagram of a target grayscale image in a Cartesian coordinate system according to an embodiment of this application.
[0022] Figure 4 This is a schematic diagram of a pixel feature curve provided in an embodiment of this application.
[0023] Figure 5 It shows Figure 1 A sub-flowchart of the nozzle assembly calibration method.
[0024] Figure 6 This is a flowchart illustrating a target cropping data calculation method provided in an embodiment of this application.
[0025] Figure 7 This is a schematic diagram illustrating the use of target cropping data to crop an image according to an embodiment of this application.
[0026] Figure 8 This is a schematic diagram illustrating the calculation of the tilt angle of the first line segment and the tilt angle of the second line segment, provided as an embodiment of this application.
[0027] Figure 9 This is a flowchart illustrating a method for calculating the target rotation angle according to an embodiment of this application.
[0028] Figure 10 This is a functional block diagram of a nozzle assembly calibration module provided in an embodiment of this application.
[0029] Figure 11 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0030] To better understand the above-mentioned objectives, features, and advantages of this application, the application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0031] The following description sets forth many specific details to provide a full understanding of this application. The described embodiments are only some, not all, of the embodiments of this application.
[0032] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the specification of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application.
[0033] It should be further noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0034] In this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, or B exists alone, where A and B can be singular or plural.
[0035] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0036] 3D printing equipment is a type of rapid prototyping technology, also known as additive manufacturing, three-dimensional printer, or stereo printer. 3D printing is a technology that uses digital model files as a basis and employs powdered metals or plastics and other bondable materials to construct objects layer by layer.
[0037] During printing, the 3D printing equipment continuously extrudes printing material from the nozzle assembly to dissolve it into lines. Then, the nozzle assembly is controlled to continuously change position to spread the printing material evenly onto the printing platform or the previous layer of printed material. The continuously laid-out printing material is stacked layer by layer to form the final printed object.
[0038] The 3D printing equipment includes a nozzle assembly, a data acquisition assembly, and a printing platform. The data acquisition assembly is connected to the nozzle assembly, which is used to print a three-dimensional entity on the printing platform based on the model to be printed. The data acquisition assembly is used to acquire images of the printing platform. In this embodiment, the data acquisition assembly can be a camera, video camera, etc., and this application does not limit the type of data acquisition assembly.
[0039] Please refer to Figure 1 This is a flowchart of a nozzle assembly calibration method provided in an embodiment of this application, which is applied to a 3D printing device.
[0040] The nozzle assembly calibration method includes the following steps:
[0041] Step 101: Control the acquisition component to acquire the printing platform with the calibration material printed on it, and obtain an initial grayscale image. The calibration material includes multiple parallel first line segments and multiple parallel second line segments. The first line segments and the second line segments are not parallel. The interval between two adjacent first line segments is related to the first interval coefficient. The interval between two adjacent second line segments is related to the second interval coefficient.
[0042] In some embodiments, the number of first line segments needs to be at least 3, and similarly, the number of second line segments also needs to be at least 3. The interval value between two adjacent first line segments can be obtained and denoted as the first interval value. Since the number of first line segments is at least 3, the number of first interval values is at least 2. The average of the multiple first interval values can be used as the first interval coefficient, or the variance of the multiple first interval values can be used as the first interval coefficient. The method for determining the first interval coefficient is not limited in this application. Furthermore, the specific values of the multiple first interval values can be set according to actual needs. Similarly, the method for determining the second interval coefficient is the same as that for determining the first interval coefficient, and will not be repeated here.
[0043] It should be noted that the first interval coefficient and the second interval coefficient can be equal or unequal. The specific values of the first and second interval coefficients can be set according to the actual calibration requirements.
[0044] In this embodiment, as Figure 2 As shown, there are three first line segments and three second line segments. The first line segments are parallel to each other and equally spaced, and the second line segments are also parallel to each other and equally spaced. Each first line segment is perpendicular to a second line segment. The length of each first line segment is set to d1, and the length of each second line segment is set to d2. The first interval value is... The first interval coefficient is equal to the first interval value. The second interval value is... The second interval coefficient is equal to the second interval value. Here, h represents the preset equidistant coefficient, which can be set to 6 or 7. The specific value of the preset equidistant coefficient is related to the image size reserved when cropping the initial grayscale image; the preset equidistant coefficient can be set according to the actual cropping requirements. In other embodiments, multiple first line segments may not intersect with the second line segments. Alternatively, the first and second line segments may form an acute or obtuse angle. The number of first and second line segments may be the same or different.
[0045] In this embodiment, multiple first line segments are set to be parallel to each other and equally spaced, and multiple second line segments are set to be parallel to each other and equally spaced. The first line segments are perpendicular to the second line segments, which can reduce the number of subsequent calculation steps and improve calculation efficiency.
[0046] Step 102: Establish a Cartesian coordinate system based on the initial grayscale image.
[0047] In this embodiment, a Cartesian coordinate system is established with the lower left corner of the image acquired by the acquisition component as the origin, and the two vertical sides of the image as the X-axis and Y-axis, respectively. In other embodiments, the lower right corner of the image acquired by the acquisition component can also be used as the origin, with the two vertical sides of the image as the X-axis and Y-axis, respectively. Alternatively, any point within the image acquired by the acquisition component can be used as the origin, with the directions extending from that point along the two vertical sides of the image as the X-axis and Y-axis, respectively. This application does not limit the method of establishing the Cartesian coordinate system.
[0048] In some embodiments, to obtain an initial grayscale image, the acquisition component needs to acquire a blank image of the printing platform without the calibration material printed on it. The acquisition component then acquires an initial image of the printing platform with the calibration material printed on it. The pixel difference between the blank image and the initial image is calculated, and a difference image is obtained based on this difference. Finally, the difference image is converted into the initial grayscale image.
[0049] The `absdiff` function is used to calculate the pixel difference between the blank image and the initial image. The `absdiff` function is a function in OpenCV primarily used to calculate the pixel difference between two images. The `absdiff` function takes two images as input parameters and returns a new function where the value of each pixel is the absolute value of the difference between the pixels in the two input images. The difference image contains closed shapes. Although this embodiment uses the `absdiff` function to calculate the pixel difference between two images, this application does not limit the use of the `absdiff` function. In other embodiments, if other functions or algorithms can also calculate the pixel difference between two images, those functions or algorithms can also be used.
[0050] In this embodiment, the maximum value method can be used to convert the difference image into an initial grayscale image. The maximum value method is prior art and will not be described in detail here. Alternatively, the average value method or the weighted average method can be used to process the difference image to obtain the initial grayscale image. The maximum value method directly takes the value of the component with the largest value among the three primary colors for grayscale processing. The average value method directly takes the average value of the three primary colors for grayscale processing. The weighted average method weights the three primary colors with different weights according to importance and other indicators to obtain a weighted average value, and uses the weighted average value for grayscale processing. This application does not limit this approach.
[0051] Step 103: Perform image processing on the initial grayscale image to obtain the target grayscale image, wherein the first or second line segment in the target grayscale image is parallel to any coordinate axis of the Cartesian coordinate system.
[0052] In this embodiment, for illustrative purposes, the example given is that the first line segment is parallel to the X-axis of the Cartesian coordinate system. In other embodiments, the second line segment may also be parallel to the X-axis of the Cartesian coordinate system.
[0053] In this embodiment, please refer to... Figure 2It can be seen that the first line segment in the initial grayscale image acquired by the acquisition component is not parallel to the X-axis. To ensure that in the subsequent printing process, the acquisition component acquires the first line segment in the calibration material printed by the printhead assembly that is parallel to the X-axis, thus proving that the printhead assembly does not need calibration or that the calibration is successful, firstly, the target rotation angle is obtained. The target rotation angle represents the angle between the first line segment and the X-axis after the initial grayscale image is rotated. That is, the angle between the first line segment and the square of the X-axis is the target rotation angle. The specific calculation method of the target rotation angle will be described in detail below. It will not be repeated here. In other embodiments, the initial grayscale image can also be rotated so that the second line segment remains parallel to the Y-axis of the Cartesian coordinate system. Then, the initial grayscale image is rotated based on the target rotation angle. Next, target cropping data is acquired. Finally, based on the target cropping data, the image within the region of interest in the rotated initial grayscale image is extracted to obtain the target grayscale image. The target grayscale image is represented in the Cartesian coordinate system as follows: Figure 3 As shown.
[0054] In some embodiments, since the initial grayscale image contains many interfering regions, it is necessary to use target cropping data to crop the rotated initial grayscale image, extracting the region of interest and removing interfering regions. That is, the region of interest is the area in the target grayscale image where the correction object is located. The target cropping data is used to crop the rotated initial grayscale image. The specific calculation method for the target cropping data is described in detail below and will not be repeated here.
[0055] In this embodiment, the initial grayscale image is first rotated using the target rotation angle, and then the rotated initial grayscale image is cropped using the target cropping data. This solves the problem of incomplete correction objects within the image when the initial grayscale image is cropped first and then rotated. This ensures the accuracy of the nozzle correction parameters for subsequent calculations of the acquisition components.
[0056] Step 104: Obtain the pixel feature curve that matches the target grayscale image, where the pixel feature curve represents the distribution of each pixel value in the target grayscale image.
[0057] In this embodiment, in order to obtain the pixel feature curve that matches the target grayscale image, the target grayscale image needs to be binarized first to obtain an initial black and white image that matches the target grayscale image.
[0058] The initial black-and-white image is obtained as follows: First, a first histogram matching the target grayscale image is acquired. Next, the first histogram is cropped to reduce image interference. Then, normalization and smoothing techniques are used to process the cropped first histogram to determine the index value of the pixel extrema in the processed first histogram. In this embodiment, the pixel extrema is the minimum pixel value. In other embodiments, depending on processing requirements, the pixel extrema can be set to the maximum pixel value. Finally, this index value is used as an initial grayscale threshold to convert the target grayscale image into an initial black-and-white image.
[0059] The step of cropping the first histogram includes: extracting the first pixel value from the first histogram, where the first pixel value is the pixel value that appears most frequently in the first histogram; and cropping the first histogram to the right from the first pixel value. The step of converting the target grayscale image to an initial black and white image using an initial grayscale threshold includes: setting pixels in the initial grayscale image with pixel values greater than the initial grayscale threshold to 255, and setting the remaining pixels to 0.
[0060] Normalization is a data processing method that limits processed data to a fixed range. Smoothing enhances low frequencies incrementally while filtering out high frequencies, essentially acting as a background filter to eliminate random noise in an image. It can be used to remove noise, improve image quality, and reduce interference. In this embodiment, the erode function is used to eliminate smaller noise points in the binarized image. The dilate function is used to merge disconnected white regions into connected regions in the binarized image. The filter2D function is used to smooth the image. In other embodiments, if other algorithms, functions, or methods exist to eliminate smaller noise points in a binarized image or merge disconnected white regions into connected regions, the corresponding algorithms, functions, or schemes can also be used; this application is not limited in this regard.
[0061] Furthermore, such as Figure 4 The image shown is a pixel feature curve matched to the initial black and white image. The initial black and white image includes multiple first pixel groups arranged along the X-axis and multiple second pixel groups arranged along the Y-axis.
[0062] The pixel feature curve is obtained as follows:
[0063] In the initial black and white image, the sum of the first pixel values of each first pixel group and the sum of the second pixel values of each second pixel group are obtained. One sum of first pixel values corresponds to one first pixel group, and one sum of second pixel values corresponds to one second pixel group.
[0064] In this embodiment, for the values of each pixel in the initial black and white image, the sum of the pixel values is calculated in both the X-axis and Y-axis directions. The sum obtained by calculating the values of each pixel in the first pixel group in the X-axis direction is denoted as SUM. X1 Let SUM be the sum of the pixel values in the second first pixel group. X2 ...; The cumulative sum SUM obtained by calculating the values of each pixel in the first and second pixel groups along the Y-axis direction is denoted as SUM. Y1 The sum of the pixel values in the second pixel group is denoted as SUM. Y2 ...for SUM respectively X1 SUM X2 and SUM Y1 SUM Y2 ...perform normalization, and then normalize the SUM. X1 SUM X2 and SUM Y1 SUM Y2 ...Perform one-dimensional Gaussian low-pass filtering on the data. Finally, the filtered SUM... X1 SUM X2 and SUM Y1 SUM Y2 ...After normalization, multiple sums of the first pixel values are obtained (denoted as SUM). X And the sum of multiple sets of second pixel values (denoted as SUM) Y Gaussian low-pass filtering is a linear smoothing filter suitable for eliminating Gaussian noise and widely used in image processing noise reduction. It can effectively suppress noise and smooth images.
[0065] Then, symmetrical calculations are performed on the sum of multiple sets of first pixel values and the sum of multiple sets of second pixel values to obtain the pixel feature curve.
[0066] In this embodiment, SUM is respectively X and SUM Y Sum all the values in the array, then divide the sum by the array length to get SUM. X and SUM Y The first average (denoted as Avg) X ) and the second average (denoted as Avg) Y Please continue to combine. Figure 4 There are two pixel feature curves. One pixel feature curve represents the distribution of pixel values along the X-axis in the initial grayscale image (compared to SUM). X Matching, denoted as SUM XPixel feature curves); another pixel feature curve characterizes the distribution of pixel values along the Y-axis in the initial grayscale image (compared to SUM). Y Matching, denoted as SUM Y (Pixel feature curve).
[0067] Step 105: Obtain the first length of the first line segment and the second length of the second line segment.
[0068] Step 106: Calculate the nozzle correction parameters based on the pixel feature curve, the first length, the second length, the first interval coefficient, and the second interval coefficient.
[0069] like Figure 5 The diagram shows a flowchart of the nozzle calibration parameter calculation method. The steps are as follows:
[0070] Step 1061: Calculate the coordinates of multiple peaks of the pixel feature curve.
[0071] Specifically, from SUM X Determining the relationship between pixel feature curves and Avg X Multiple equal first X-coordinate values. Similarly, from SUM... Y Determining the relationship between pixel feature curves and Avg Y Multiple equal first Y-coordinate values. In this embodiment, there are six first X-coordinate values, denoted as X1, X2, X3, X4, X5, and X6. There are also six first Y-coordinate values, denoted as Y1, Y2, Y3, Y4, Y5, and Y6.
[0072] It should be noted that SUM X The number of peaks in the pixel feature curve is the same as the number of the first line segment. Similarly, SUM Y The number of peaks in the pixel feature curve is the same as the number of the second line segment.
[0073] Furthermore, in SUM X The x-coordinates of the multiple peaks in the pixel feature curve are: X top1 = (X2-X1) / 2, X top2 = (X4-X3) / 2, X top3 = (X6-X5) / 2. In SUM Y The x-coordinates of the multiple peaks in the pixel feature curve are: Y top1 = (Y2-Y1) / 2, Y top2 = (Y4-Y3) / 2, Y top3 = (Y6-Y5) / 2. Therefore, multiple peak coordinates are included in SUM. X The x-coordinates of multiple peaks in the pixel feature curve and in SUM YThe horizontal coordinates of multiple peaks in the pixel feature curve.
[0074] Step 1062: Based on multiple peak coordinates, the first length, the second length, and the preset interval coefficient, obtain the actual length of a single pixel in the calibration object on the X-axis and the actual width on the Y-axis.
[0075] In this embodiment, the preset interval coefficient is h, the first length is d1, and the second length is d2. The actual length of a single pixel in the calibration object on the X-axis is denoted as K1. Let K2 be the actual length of a single pixel in the calibration object on the Y-axis.
[0076] Step 1063: Based on the actual length and multiple peak coordinates, obtain the first motion gap value of the nozzle assembly on the X-axis.
[0077] In this embodiment, the first movement clearance value of the nozzle assembly on the X-axis is denoted as G. X Then G X =((X) top3 -X top2 )-(X top2 -X top1 ))*K1.
[0078] Step 1064: Based on the actual width and multiple peak coordinates, obtain the second motion gap value of the nozzle assembly on the Y-axis.
[0079] In this embodiment, the first movement clearance value of the nozzle assembly on the Y-axis is denoted as G. Y Then G Y =((Y) top2 -Y top1 )-(Y top3 -Y top2 ))*K2.
[0080] Step 1065: Use the first motion gap value and the second motion gap value as nozzle calibration parameters.
[0081] The main point is that by setting the number of both the first and second line segments to three or more, there will be at least two first interval values between multiple first line segments and at least two second interval values between multiple second line segments. Only in this way can the nozzle correction parameters be obtained based on the first and second interval values and other parameters.
[0082] Step 107: Use the nozzle calibration parameters to calibrate the nozzle assembly.
[0083] In this embodiment, it is assumed that the acceleration of the nozzle assembly before calibration is a0, and the acceleration of the nozzle assembly during calibration is a. fThe speed is v f The correction time is t1+t2, where t1 represents the time during which the 3D printing equipment controls the nozzle assembly to accelerate, and t2 represents the time during which the 3D printing equipment controls the nozzle assembly to decelerate.
[0084] Furthermore, to calibrate the nozzle assembly, the 3D printing equipment needs to control the nozzle assembly to move an additional distance in the X direction, which is the first motion gap value, and move an additional distance in the Y axis, which is the second motion gap value. First, before calibrating the nozzle assembly, based on the acceleration a0 of the nozzle assembly before calibration and the calibration time (t1+t2), the displacement of the nozzle assembly during the calibration time is obtained as follows:
[0085] Then, during calibration, based on the acceleration and velocity of the nozzle assembly during calibration, the displacement of the nozzle assembly within the calibration time is obtained as follows:
[0086] To accurately calibrate the position of the nozzle assembly, in the X-axis direction, s f +G X =s0. In the Y-axis direction, s f +G Y =s0.
[0087] Specifically, the speed of the nozzle assembly during calibration can be further adjusted to make s f +G X =s0 and s f +G Y =s0. Alternatively, adjust the acceleration of the nozzle assembly during calibration to make s f +G X =s0 and s f +G Y =s0. In this way, the position of the nozzle assembly in the X-axis and Y-axis directions can be accurately corrected.
[0088] Compared with related technologies, the embodiments of this application have at least the following advantages:
[0089] The initial grayscale image is processed to remove irrelevant areas, and the region of interest (ROI) is extracted from the rotated initial grayscale image for direct analysis, improving overall processing efficiency. Then, the cropped initial grayscale image is converted to an initial black and white image. By analyzing the distribution of pixel values in the initial black and white image, the distribution of the correction material within the image can be accurately determined. Pixel feature curves are obtained by calculating the distribution of pixel values along the X and Y axes in the initial black and white image. Next, based on the multiple peak coordinates of the pixel feature curves, the lengths of the first and second line segments, and the first and second interval coefficients, precise nozzle correction parameters are calculated. This ensures that the nozzle assembly does not shift during subsequent printing, improving the quality of 3D printing.
[0090] Please refer to Figure 6 This is a flowchart illustrating a target cropping data calculation method provided in an embodiment of this application. The steps are as follows:
[0091] Step 201: Obtain the horizontal field of view, vertical field of view, and theoretical shooting distance of the acquisition component.
[0092] In this embodiment, the theoretical shooting distance refers to the distance between the acquisition component and the printing platform.
[0093] Step 202: Calculate the horizontal field of view, the vertical field of view, and the theoretical shooting distance to obtain the theoretical acquisition width and the theoretical acquisition length.
[0094] In some embodiments, the theoretical acquisition width characterizes the width of the acquisition area acquired by the acquisition component on the printing platform, and the theoretical acquisition length characterizes the length of the acquisition area acquired by the acquisition component on the printing platform.
[0095] In this embodiment, the horizontal field of view is denoted as θ. hor The vertical field of view is denoted as θ. ver The theoretical shooting distance is denoted as D. cam The theoretical acquisition length is denoted as... The theoretical acquisition width is denoted as
[0096] Step 203: Calculate the first length, the second length, the theoretical acquisition width, and the theoretical acquisition length to obtain the target cropping data.
[0097] In this embodiment, as Figure 7 As shown, the target cropping data includes the cropping start point coordinates, cropping length, and cropping width. Obtain the pixel length and pixel width of the initial grayscale image. Let the pixel length be P. x Let the pixel width be P. yLet the starting point coordinates be (X0, Y0), and the cutting length be d. X Let the cutting width be d. Y Obtain the preset cropping factor and denote it as f. Then d X =P x *d1*f / W cam d Y =P y *d2*f / L cam , X0 = (P x -d X ) / 2, Y0=(P y -d Y ) / 2. In the embodiment, f can be In other embodiments, f can be set to [value] according to the trimming requirements. or
[0098] Compared with related technologies, the embodiments of this application have at least the following advantages:
[0099] Because the types and ranges of acquisition components vary, it is necessary to calculate the theoretical acquisition length and width of the printing platform captured by the acquisition component based on its horizontal and vertical field of view angles and theoretical shooting distance, thus obtaining accurate target cropping data. This allows the cropped image based on the target cropping data to eliminate interference areas, thereby extracting the region of interest containing the correction object.
[0100] Please refer to Figure 9 This is a flowchart illustrating a method for calculating the target rotation angle according to an embodiment of this application.
[0101] The specific process of this embodiment is as follows: Figure 9 As shown, it includes the following steps:
[0102] Step 301: Crop the initial grayscale image using the target cropping data.
[0103] Please refer to the above embodiments. Figure 7 and Figure 8 The target cropping data is the cropping origin (X0, Y0) and the cropping length is d. X and the cutting width is d Y The initial grayscale image is cropped using the target cropping data to obtain the cropped initial grayscale image. In this embodiment, the cropped initial grayscale image is denoted as the initial cropped image. It is understood that, compared to the initial cropped grayscale image, the initial cropped image does not contain interfering regions, such as numerous blank areas within the image.
[0104] Step 302: Obtain the initial grayscale histogram of the cropped initial grayscale image.
[0105] Step 303: Determine the pixel threshold of the initial grayscale histogram. The pixel threshold is the index value of the pixel extremum in the initial grayscale histogram.
[0106] Step 304: Based on the pixel threshold, use edge detection technology to detect the cropped initial grayscale image to obtain the edge grayscale image.
[0107] In some embodiments, firstly, a histogram corresponding to the initial cropped image is obtained. This is denoted as the initial grayscale histogram. To obtain an accurate pixel threshold, the initial grayscale histogram can be cropped first. The most frequently occurring pixel value is determined from the initial grayscale histogram, and the initial grayscale histogram is cropped to the right from this pixel value to avoid interference from pixels to the left of that pixel value. The cropped initial grayscale histogram is then normalized and smoothed to obtain an intermediate grayscale histogram. The image after normalization and smoothing has removed the interference from pixels. Then, the index value of the pixel extremum in the intermediate grayscale histogram is determined; in this embodiment, the pixel extremum is the smallest pixel value. The index value of the smallest pixel value is used as the minimum threshold C of the Canny edge detection operator. min .
[0108] Furthermore, a first threshold is set (denoted as C). max1 ) and the second threshold (C max2 Wherein, the first threshold is the sum of the minimum threshold and the first preset value, and the second threshold is the second preset value. In this embodiment, the first preset value can be 50, and the second preset value can be 255. In other embodiments, the specific values of the first and second preset values can be adjusted according to actual processing needs, and this is not limited.
[0109] The minimum value between the first threshold and the second threshold is recorded as the target threshold. Then, the target threshold and the Canny edge detection operator are used to perform edge detection on the initial cropped image to obtain the edge grayscale image of the object to be corrected.
[0110] The Canny edge detection operator is a technique that extracts useful structural information from different visual objects and significantly reduces the amount of data to be processed. It mainly includes five steps: using a Gaussian filter to smooth the image and eliminate noise; calculating the gradient intensity and direction of each pixel in the image; applying non-maximum suppression to eliminate stray responses introduced by edge detection; applying double threshold detection to determine real and potential edges; and completing edge detection by suppressing isolated weak edges.
[0111] Step 305: Obtain the first tilt angle between the first line segments and the X-axis in the edge grayscale image.
[0112] Step 306: Obtain the second tilt angle between multiple second line segments and the Y-axis in the edge grayscale image.
[0113] Step 307: Obtain the target rotation angle based on multiple first tilt angles and multiple second tilt angles.
[0114] In this embodiment, the HoughLines line segment detection algorithm is used to calculate the first tilt angle between multiple first line segments and the X-axis and the second tilt angle between multiple second line segments and the Y-axis in the edge grayscale image.
[0115] The HoughLines algorithm is a function that implements the standard Hough Transform. The Hough Transform is a feature extraction technique primarily used to detect geometric shapes in images, most commonly line segments and circles. The basic idea of the Hough Transform is to identify specific shapes by utilizing the transformation between image space and parameter space.
[0116] In this embodiment, as Figure 8 Calculate the median of multiple first tilt angles as the first line segment tilt angle (denoted as θ). X The difference between the median of multiple second tilt angles and a preset tilt threshold is taken as the second line segment tilt angle (denoted as θ). Y The preset tilt threshold value is 90°.
[0117] It should be noted that in order to calculate the target rotation angle using the first and second line segment tilt angles, the reference for obtaining the first line segment tilt angle (which is based on the angle between the first line segment and the X-axis) and the reference for obtaining the second line segment tilt angle (which is based on the angle between the second line segment and the Y-axis) must be kept the same. The angle between the X-axis and the Y-axis is 90°. Therefore, the median of multiple second tilt angles is subtracted by 90° to obtain the second line segment tilt angle.
[0118] In this embodiment, the angle between the first line segment and the X-axis is an acute angle. To ensure that the first line segment in the image rotated based on the target rotation angle is parallel to the X-axis, in steps 305 and 306, the first tilt angle between the multiple first line segments in the edge grayscale image and the X-axis, and the second tilt angle between the multiple second line segments in the edge grayscale image and the Y-axis, are obtained respectively. In other embodiments, if the angle between the first line segment and the Y-axis is an acute angle, to ensure that the first line segment in the image rotated based on the target rotation angle is parallel to the Y-axis, in steps 305 and 306, the following adjustments should be made simultaneously: obtaining the first tilt angle between the multiple first line segments in the edge grayscale image and the Y-axis, and the second tilt angle between the multiple second line segments in the edge grayscale image and the X-axis, respectively.
[0119] Furthermore, the average of the tilt angles of the first and second line segments is taken as the target rotation angle.
[0120] Compared with related technologies, the embodiments of this application have at least the following advantages:
[0121] The initial grayscale image is cropped using target cropping data to obtain an initial cropped image. This avoids excessively high image resolution, which could lead to numerous interference areas in the initial grayscale image affecting the accuracy of edge detection. Furthermore, the cropped initial grayscale image more accurately reflects the characteristics of the calibration object within the image, facilitating improved efficiency in subsequent edge detection of the calibration object. Edge detection techniques are then used to detect the edge grayscale images of the calibration object in the initial cropped image. Based on these edge grayscale images, the first tilt angles between multiple first line segments and the X-axis, and the second tilt angles between multiple second line segments and the Y-axis are calculated. Finally, the average of the first and second line segment tilt angles is used as the target rotation angle. This allows for the acquisition of an accurate target rotation angle.
[0122] Please refer to Figure 10 This is a functional block diagram of the nozzle assembly calibration device 200 provided in this application embodiment. The nozzle assembly calibration device 200 includes: a data acquisition module 210, a data establishment module 220, a processing module 230, a first acquisition module 240, a second acquisition module 250, a calculation module 260, and a calibration module 270.
[0123] The acquisition module 210 controls the acquisition component to acquire the printing platform with the calibration material printed on it, obtaining an initial grayscale image. The calibration material consists of multiple equally spaced and parallel first line segments and multiple equally spaced and parallel second line segments, with the lines containing the first line segments perpendicular to the lines containing the second line segments. The establishment module 220 establishes a Cartesian coordinate system based on the initial grayscale image. The processing module 230 processes the initial grayscale image to make the first line segments parallel to any coordinate axis of the Cartesian coordinate system. The first acquisition module 240 acquires pixel feature curves that match the processed initial grayscale image, where the pixel feature curves characterize the distribution of pixel values in the processed initial grayscale image. The second acquisition module 250 acquires the first length of the first line segment and the second length of the second line segment. The calculation module 260 calculates the nozzle correction parameters based on the pixel feature curves, the first length, and the second length. The correction module 270 corrects the nozzle assembly using the nozzle correction parameters.
[0124] Please refer to Figure 11 This is a schematic diagram of the hardware structure of the electronic device 1000 provided in an embodiment of this application. Figure 11As shown, the electronic device 1000 may include a processor 1001 and a memory 1002. The memory 1002 is used to store one or more computer programs 1003. The one or more computer programs 1003 are configured to be executed by the processor 1001. The one or more computer programs 1003 include instructions that can be used to implement the methods described above in the electronic device 1000.
[0125] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 1000. In other embodiments, the electronic device 1000 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements.
[0126] Processor 1001 may include one or more processing units, such as application processors (APs), modems, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0127] The processor 1001 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 1001 is a cache memory. This memory can store instructions or data that the processor 1001 has just used or that are used repeatedly. If the processor 1001 needs to use the instruction or data again, it can retrieve it directly from this memory. This avoids repeated accesses, reduces the waiting time of the processor 1001, and thus improves the efficiency of the system.
[0128] In some embodiments, the processor 1001 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM interface, and / or a USB interface, etc.
[0129] In some embodiments, memory 1002 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0130] This embodiment also provides a computer-readable storage medium storing computer instructions. When the instructions are executed on an electronic device, the electronic device performs the aforementioned method steps to implement the methods described in the above embodiments.
[0131] In this embodiment, the electronic device and computer storage medium are used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects of the corresponding methods provided above, and will not be repeated here.
[0132] In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0133] In the several embodiments provided in this application, the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are illustrative. For instance, the division of modules or units is a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0134] The unit described as a separate component may or may not be physically separate. The component shown as a unit can be one physical unit or multiple physical units, that is, it can be located in one place or distributed in multiple different places. Some or all of the units can be selected to achieve the purpose of the solution in this embodiment according to actual needs.
[0135] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0136] If the integrated unit is implemented as a software functional unit and sold or used as an independent molded product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software molded product. This software molded product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0137] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be covered within the scope of protection of this application.
Claims
1. A method for calibrating a nozzle assembly for use in a 3D printing device, the method comprising: determining a distance between a nozzle and a build plate; and adjusting a height of the nozzle based on the determined distance. The 3D printing device comprises a collection assembly, a nozzle assembly and a printing platform, the nozzle assembly is used for printing a correction object on the printing platform, the collection assembly is used for collecting an image of the printing platform, and the nozzle assembly correction method comprises: controlling the collection assembly to collect the printing platform on which the correction object is printed to obtain an initial gray image, wherein the correction object comprises a plurality of first line segments parallel to each other and a plurality of second line segments parallel to each other, the first line segments are not parallel to the second line segments, the interval between two adjacent first line segments in the plurality of first line segments is related to a first interval coefficient, and the interval between two adjacent second line segments in the plurality of second line segments is related to a second interval coefficient; a plane rectangular coordinate system is established based on the initial gray image; the initial gray image is processed to obtain a target gray image, wherein the first line segments or the second line segments in the target gray image are parallel to any coordinate axis of the plane rectangular coordinate system; a pixel feature curve matched with the target gray image is obtained, wherein the pixel feature curve represents the distribution of each pixel value in the target gray image; a first length of the first line segments and a second length of the second line segments are obtained; a nozzle correction parameter is calculated based on the pixel feature curve, the first length, the second length, the first interval coefficient and the second interval coefficient; the nozzle assembly is corrected using the nozzle correction parameter.
2. The showerhead assembly correction method of claim 1, wherein The calculation of the nozzle correction parameter based on the pixel feature curve, the first length, the second length, the first interval coefficient and the second interval coefficient comprises: a plurality of peak value coordinates of the pixel feature curve are calculated; based on the plurality of peak value coordinates, the first length, the second length, the first interval coefficient and the second interval coefficient, the actual length of a single pixel point in the correction object in the target gray image on the X-axis of the plane rectangular coordinate system and the actual width of the single pixel point on the Y-axis of the plane rectangular coordinate system are obtained; the nozzle correction parameter is obtained based on the plurality of peak value coordinates, the actual length and the actual width.
3. The showerhead assembly correction method of claim 2, wherein, The calculation of the nozzle correction parameter based on the plurality of peak value coordinates, the actual length and the actual width comprises: a first motion gap value of the nozzle assembly on the X-axis is obtained based on the actual length and the plurality of peak value coordinates; a second motion gap value of the nozzle assembly on the Y-axis is obtained based on the actual width and the plurality of peak value coordinates; the first motion gap value and the second motion gap value are taken as the nozzle correction parameter.
4. The method of claim 1, wherein, The processing of the initial gray image to obtain a target gray image comprises: a target rotation angle is obtained, the target rotation angle representing an angle at which the first line segments or the second line segments are parallel to the coordinate axis after the initial gray image is rotated; the initial gray image is rotated based on the target rotation angle; target clipping data is obtained; Based on the target clipping data, an image in a region of interest in the initial gray image after rotation is extracted to obtain the target gray image.
5. The method of claim 4, wherein, The target clipping data is obtained by the following method: An angle of horizontal field of view, an angle of vertical field of view and a theoretical shooting distance of the acquisition component are obtained. Based on the angle of horizontal field of view, the angle of vertical field of view and the theoretical shooting distance, a theoretical acquisition width and a theoretical acquisition length are obtained. Based on the first length, the second length, the theoretical acquisition width and the theoretical acquisition length, the target clipping data is obtained.
6. The showerhead assembly correction method of claim 4, wherein, The target rotation angle is obtained by the following method: The initial gray image is clipped using the target clipping data; An edge gray image is obtained by detecting the clipped initial gray image using an edge detection technology; A first inclination angle between a plurality of the first line segments in the edge gray image and an X-axis of the plane rectangular coordinate system is obtained; A second inclination angle between a plurality of the second line segments in the edge gray image and a Y-axis of the plane rectangular coordinate system is obtained; Based on a plurality of the first inclination angles and a plurality of the second inclination angles, the target rotation angle is obtained.
7. The showerhead assembly correction method of claim 6, wherein, After the initial gray image is clipped using the target clipping data, the following steps are included: An initial gray histogram of the clipped initial gray image is obtained; A pixel threshold value of the initial gray histogram is determined, the pixel threshold value being an index value of a pixel extreme value in the initial gray histogram; The edge gray image is obtained by detecting the clipped initial gray image using an edge detection technology, including: The edge gray image is obtained by detecting the clipped initial gray image using an edge detection technology based on the pixel threshold value.
8. The showerhead assembly correction method of claim 1, wherein, Before the initial gray image is obtained by controlling the acquisition component to acquire the printing platform on which the correction object is printed, the following step is further included: The blank image of the printing platform is obtained by controlling the acquisition component to acquire the printing platform on which the correction object is not printed; The initial gray image is obtained by controlling the acquisition component to acquire the printing platform on which the correction object is printed, including: The initial image of the printing platform is obtained by controlling the acquisition component to acquire the printing platform on which the correction object is printed; A pixel difference between the blank image and the initial image is calculated, and a difference image is obtained based on the pixel difference; The difference image is converted into the initial gray image.
9. An electronic device, comprising: The electronic device includes a memory and a processor, the processor is in communication connection with the memory, and the processor is configured to execute the nozzle assembly correction method in any one of claims 1 to 8.
10. A computer storage medium, characterized in that, The computer storage medium stores computer instructions, when the computer instructions are executed on an electronic device, the electronic device executes the nozzle assembly correction method in any one of claims 1 to 8.