A printing parameter automatic adjustment method of an extrusion type 3D printer based on machine vision
By automatically adjusting the printing parameters of the extrusion 3D printer through machine vision and artificial neural networks, the printing defect problems caused by inappropriate movement speed and ink extrusion are solved, and fast and low-cost automated adjustment is achieved, improving printing quality and efficiency.
Patent Information
- Application Number
- CN202410566419.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-09
- Publication Date
- 2025-10-14
- Estimated Expiration
- 2044-05-09
AI Technical Summary
Existing extrusion 3D printers are prone to printing defects when the moving speed, ink extrusion volume and nozzle height are not appropriate. Manual monitoring methods are costly and unreliable, which limits the automation and intelligent development of 3D printing technology.
A machine vision-based method is used to capture the printing process image in real time through a camera, and an artificial neural network is used to automatically adjust the nozzle movement rate, extrusion rate and height to achieve automatic adjustment of parameters and avoid manual intervention.
It achieves fast and low-cost automatic adjustment of printing parameters, avoids printing defects, improves the automation and intelligence level of 3D printing, saves materials and reduces manual intervention.
Smart Images

Figure CN118358169B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of 3D printing, and in particular to a method for automatically adjusting printing parameters of an extrusion-type 3D printer based on machine vision. Background Art
[0002] Extrusion-based 3D printers are prone to irregular filament production and various defects during the printing process due to inappropriate movement speeds and excessive or insufficient ink extrusion. Precisely controlling extrusion and movement speeds is extremely difficult. Furthermore, the distance between the nozzle tip and the platform—the nozzle height—can also affect print quality. These unfavorable factors can cause defects, making it difficult for printed parts to meet the desired structural or functional requirements. Manual monitoring methods are both costly and unreliable, as even experts struggle to accurately interpret printing phenomena and adjust appropriate printing parameters in the fast-paced manufacturing process. Furthermore, this manual intervention severely limits the automated and intelligent development of 3D printing technology. Several approaches have been developed to address these issues. For example, physical sensors are used to monitor key parameters of the 3D printing process, such as temperature and pressure. These parameters serve as system inputs, and feedback loops generate voltage or current as system outputs to control the printer's process parameters, such as extrusion rate and temperature. However, sensors are costly, and most require physical contact with the printed part, which can cause additional damage. Summary of the Invention
[0003] In view of the shortcomings of the existing technology, the present invention proposes a method for automatically adjusting the printing parameters of an extrusion-type 3D printer based on machine vision. The specific technical solution is as follows:
[0004] A method for automatically adjusting printing parameters of an extrusion-type 3D printer based on machine vision comprises the following steps:
[0005] Step 1: A camera mounted on the printer captures real-time images of the printing process, including the nozzle tip area and the underlying print platform. The printer's printing parameters are changed every time a certain number of images are captured. The images are preprocessed to a uniform size centered on the nozzle tip, and the resulting printing parameter classification is used as the image label to create a training dataset.
[0006] Step 2: Using the training data set to train an artificial neural network, the input of the artificial neural network is the image, and the output is the classification result of the printing parameters;
[0007] Step 3: After preprocessing, the newly captured printing process image is input into the trained artificial neural network to obtain the classification results of the printing parameters; the parameter adjustment strategy is determined by using the adjustment mode judgment rule and the adjustment amplitude judgment rule;
[0008] Among them, the adjustment mode judgment rules are:
[0009] Use lists to store the classification results of each printing parameter output by the trained artificial neural network. The maximum length of each list is L0. When the number of stored prediction results exceeds L0, the list clears the earliest prediction result. For each parameter, if a specific prediction result appears frequently and the number of times it appears in the current list θ reaches the pattern number threshold θ mode , then the parameter needs to be adjusted, the predicted error type is accepted, and the printing mode is "too high" or "too low"; if the number of predictions of various results of all parameters in the current list does not reach θ mode , that is, if no adjustment mode is found, no update is performed, and the printing parameters are considered acceptable and the printing mode is "good";
[0010] The rules for determining the adjustment range are as follows:
[0011] If the adjustment mode is "high", then lower the parameter. The adjustment range is calculated as follows:
[0012]
[0013] If the adjustment mode is "low", then increase the parameter. The adjustment range is calculated as follows:
[0014]
[0015] Among them, U represents the adjustment range of printing parameters, I min Indicates the minimum change in printing parameters; θ mode Indicates the mode number threshold; L indicates the current list length; L0 indicates the maximum list length; A + and A - Indicates the maximum amount by which a parameter can be adjusted up or down.
[0016] Step 4: Send the instruction to adjust the printing parameters to the printer to complete the automatic adjustment of the printing parameters.
[0017] Furthermore, the printing parameters of the printer include the movement rate, extrusion rate and height of the nozzle.
[0018] Furthermore, the classification results of printing parameters include high, good and low. The optimal printing range of printing parameters corresponding to the printing material is obtained by single-factor experiments and response surface experiments. When the data is higher than the optimal printing range, it is marked as high, the data in the optimal printing range is marked as good, and the data below the optimal printing range is marked as low.
[0019] Furthermore, in the step three, when adjusting the printing parameters, the movement rate or extrusion rate of the nozzle is adjusted to an integer, and the height of the nozzle is adjusted to two decimal places.
[0020] Furthermore, in step 4, when sending an instruction to adjust the printing parameters to the printer, only one parameter is adjusted at a time, and after adjusting one printing parameter, all lists are cleared.
[0021] Furthermore, when multiple printing parameters need to be adjusted, single parameter adjustments are made in the order of nozzle movement rate, extrusion rate, and height.
[0022] The beneficial effects of the present invention are as follows:
[0023] The method for automatically adjusting printing parameters of an extrusion-type 3D printer based on machine vision of the present invention does not require manual continuous monitoring and parameter setting. Compared with traditional control methods, it has a fast response speed and low cost. It does not require physical contact with the printed parts and does not need to stop printing. It can automatically adjust printing parameters and does not require reprinting, thus saving materials. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 This is a flow chart of a method for automatically adjusting printing parameters of an extrusion-type 3D printer based on machine vision according to an embodiment of the present invention.
[0025] Figure 2 Schematic diagram of the simple structure of an extrusion-type 3D printer according to an embodiment of the present invention.
[0026] Figure 3 3D printer nozzle height automatic adjustment model decision diagram in an embodiment of the present invention.
[0027] Figure 4 This is a diagram showing the actual printing effect of automatically adjusting the nozzle height of a 3D printer in an embodiment of the present invention. DETAILED DESCRIPTION
[0028] The present invention will be described in detail below with reference to the accompanying drawings and preferred embodiments, and the purpose and effects of the present invention will become more apparent. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0029] like Figure 1 As shown, the method for automatically adjusting printing parameters of an extrusion-type 3D printer based on machine vision provided by an embodiment of the present invention includes the following steps:
[0030] Step 1: Use a camera installed on the printer to capture real-time images of the printer's manufacturing process, including the nozzle tip area and the printing platform below. Change the printer's printing parameters every time a certain number of images are collected. Preprocess the images to the same size centered on the nozzle tip, and use the printing parameters as image labels to organize them into a training dataset.
[0031] In this embodiment, the extrusion 3D printer, referring to Figure 2 , including an actuator 301, a plunger 302, a syringe 303, a nozzle 304 and a workbench 305. The camera is installed in a position with a clear field of view and can capture most of the images of the printer manufacturing process, including the nozzle tip area and the printing platform below. The collected images include a side view image of the printing state of the printing material. The printing material of this embodiment is PF127 hydrogel material. A random hydrogel scaffold model is selected, sliced, and an STL file is generated. The maximum movement distance is reduced and printing is started. A real-time picture of the printing is collected every 0.25 seconds. The actual collection speed can be adjusted according to the size of the print part, the specifications of the printer, etc. The printing parameters of the printer are changed every 150 images. The current printing image and printing parameters are obtained and recorded until printing is completed. Among them, reducing the maximum movement distance refers to modifying the Gcode file, cutting the path into shorter segments, and limiting the maximum movement distance of the printer nozzle to 2cm. Repeat the collection work to obtain sufficient rich data. The printing parameters include the nozzle movement rate, extrusion rate and height, which serve as image labels. The optimal printing range for PF127 hydrogel material was determined through single-factor and response surface experiments. Data above the optimal printing range were labeled as high, data within the optimal range were labeled as good, and data below the optimal range were labeled as low. Thus, the printing parameters were labeled as high, good, and low on the image.
[0032] Image preprocessing includes rotation, perspective transformation, cropping, resizing, flipping and color jittering. Specifically, each image will be rotated in a random direction within the range of ±10%, and then a small perspective transformation will be performed with a probability of 20%. Next, according to the saved nozzle coordinates, the image will be automatically cropped into a 320×320 pixel square area centered on the nozzle tip. Then, a square part with an area of 90% to 100% of the original will be randomly cropped from the 320×320 image and adjusted to the network input size of 224×224 pixels. The image will then be horizontally flipped with a probability of 50%, and color jitter of hue, saturation, brightness and contrast within the range of ±10% will be added to the image. Finally, the mean and variance of each channel of the image will be normalized.
[0033] Step 2: Use the training data set to train the artificial neural network. The input of the artificial neural network is the image, and the output is the classification result of the printing parameters.
[0034] In this embodiment, the artificial neural network adopts a convolutional neural network, the network adopts a hard parameter sharing structure, multi-task learning of various printing parameters, and the output head of the network outputs the classification results of various printing parameters.
[0035] Step 3: After preprocessing, the newly captured printing process image is input into the trained artificial neural network to obtain the classification results of the printing parameters. The parameter adjustment strategy is determined using the adjustment mode judgment rules and adjustment amplitude judgment rules.
[0036] The specific rules for determining the adjustment mode are as follows:
[0037] Lists L1 to L3 are used to store the classification results of the neural network for the nozzle movement rate, extrusion rate and height of the printing parameters in the real-time printing image. For each list, the maximum length of the list is L0. When the number of stored prediction results exceeds L0, the list will clear the first prediction result. For each parameter, if a specific prediction result appears frequently and the number of times it appears in the current list θ reaches the pattern number threshold θ mode , then the parameter needs to be adjusted, the error type of the prediction is accepted, and the printing mode is "too high" or "too low". Among them, if the number of predictions of various results of all parameters in the current list does not reach θ mode , that is, no adjustment mode is found, no update is performed, and the printing parameters are considered acceptable and the printing mode is "good".
[0038] The rules for determining the adjustment range are as follows:
[0039] If the adjustment mode is "high", then lower the parameter. The adjustment range is calculated as follows:
[0040]
[0041] If the adjustment mode is "low", then increase the parameter. The adjustment range is calculated as follows:
[0042]
[0043] Among them, U represents the change amount of printing parameters, that is, the adjustment range; I min Indicates the minimum change in printing parameters; θ mode Indicates the mode number threshold; L indicates the current list length; L0 indicates the maximum list length; A + and A - Indicates the maximum change in the parameter when the value of θ reaches the threshold value of the mode. mode, immediately accept the error type prediction and use θ and the current list length L to determine the adjustment range of the printing parameters. mode / The range between L and 1 is mapped to I min and A + (A - ), the adjustment amplitude U is obtained by linear interpolation method, thereby realizing rapid correction of parameters.
[0044] The update amount of the printing parameters is U0, and the integer is used when adjusting the movement rate or extrusion rate, and two decimal places are retained when adjusting the Z-axis offset. The calculation formula of U0 is as follows:
[0045] U0=U0+U
[0046] Step 4: Send the instruction to adjust the printing parameters to the printer to complete the automatic adjustment of the printing parameters.
[0047] In this embodiment, the instruction to adjust the printing parameters is sent to the printer through the OctoPrint API. After determining the adjustment parameters, Gcode commands such as M221 S75, M220 S100, M290 Z-0.08, etc. are sent to the printer. To minimize incorrect adjustments, only one parameter is adjusted at a time. After adjusting a printing parameter to U0, all lists are cleared. Even if multiple parameter adjustment modes are found, single parameter adjustments should be made in the order of nozzle movement rate, extrusion rate, and height. The purpose of this is to prioritize the adjustment of parameters that have less impact on the printing status and to maintain the clarity of the camera image as much as possible to prevent secondary manufacturing defects in the printing caused by incorrect model judgment.
[0048] In this embodiment, after the nozzle height increase interference is introduced, the image acquisition system collects real-time images of the extrusion 3D printer during printing, and submits them to the trained artificial neural network model for judgment. Based on the adjustment mode and amplitude judgment rules, the parameter adjustment strategy is determined and the instruction to adjust the printing parameters is sent to the printer. From the decision-making process, please refer to Figure 3 In the period of 0s to 25.25s, the model believes that the nozzle height is normal. In the period of 25.25s to 35.75s, the model predicts that the nozzle height is high for 31 frames and normal for 4 frames. The model makes decisions to lower the nozzle height by 0.04mm, 0.1mm, and 0.08mm at 31.25s, 33.25s, and 35.75s, respectively, to complete the adjustment of the interference. From the actual nozzle height of the printer, please refer to Figure 4The initial working state of the printer is an actual nozzle height of 0mm. After the interference is introduced at 25s, it changes to 0.2mm. At 31.25s, the Z-axis height is lowered to 0.16mm. At 33.25s, the actual nozzle height is lowered to 0.06mm. At 35.75s, the actual nozzle height is adjusted to 0.02mm and remains unchanged, completing the adjustment of the interference.
[0049] Those skilled in the art will understand that the foregoing descriptions are merely preferred embodiments of the invention and are not intended to limit the invention. Although the invention has been described in detail with reference to the foregoing examples, those skilled in the art will still be able to modify the technical solutions described in the foregoing examples or substitute equivalents for some of the technical features. Any modifications, equivalent substitutions, etc. made within the spirit and principles of the invention shall be included within the scope of protection of the invention.
Claims
1. A method for automatically adjusting printing parameters of an extrusion 3D printer based on machine vision, characterized in that: The steps include: Step 1: A camera mounted on the printer captures real-time images of the printing process, including the nozzle tip area and the underlying print platform. The printer's printing parameters are changed every time a certain number of images are captured. The images are preprocessed to a uniform size centered on the nozzle tip, and the resulting printing parameter classification is used as the image label to create a training dataset. Step 2: Using the training data set to train an artificial neural network, the input of the artificial neural network is the image, and the output is the classification result of the printing parameters; Step 3: After preprocessing, the newly captured printing process image is input into the trained artificial neural network to obtain the classification results of the printing parameters; the parameter adjustment strategy is determined by using the adjustment mode judgment rule and the adjustment amplitude judgment rule; Among them, the adjustment mode judgment rules are: Use lists to store the classification results of each printing parameter output by the trained artificial neural network. The maximum length of each list is L0. When the number of stored prediction results exceeds L0, the list clears the earliest prediction result. For each parameter, if a specific prediction result appears frequently and the number of times it appears in the current list θ reaches the pattern number threshold θ mode , then the parameter needs to be adjusted, the predicted error type is accepted, and the printing mode is "too high" or "too low"; if the number of predictions of various results of all parameters in the current list does not reach θ mode , that is, if no adjustment mode is found, no update is performed, and the printing parameters are considered acceptable, and the printing mode is "good"; The rules for determining the adjustment range are as follows: If the adjustment mode is "high", then lower the parameter. The adjustment range is calculated as follows: If the adjustment mode is "low", increase the parameter. The adjustment range is calculated as follows: Among them, U represents the adjustment range of printing parameters, I min Indicates the minimum change in printing parameters; θ mode Indicates the mode number threshold; L indicates the current list length; L0 indicates the maximum list length; A + and A - Indicates the maximum change in the parameter when adjusting it up or down; Step 4: Send the instruction to adjust the printing parameters to the printer to complete the automatic adjustment of the printing parameters.
2. The method for automatically adjusting printing parameters of an extrusion-type 3D printer based on machine vision according to claim 1, characterized in that: The printing parameters of the printer include the movement rate, extrusion rate and height of the nozzle.
3. The method for automatically adjusting printing parameters of an extrusion-type 3D printer based on machine vision according to claim 2, characterized in that: The classification results of printing parameters include high, good and low. The optimal printing range of printing parameters corresponding to the printing material is obtained by single-factor experiments and response surface experiments. When the data is higher than the optimal printing range, it is marked as high, the data in the optimal printing range is marked as good, and the data below the optimal printing range is marked as low.
4. The method for automatically adjusting printing parameters of an extrusion-type 3D printer based on machine vision according to claim 3, characterized in that: In the step 3, when adjusting the printing parameters, the movement rate or extrusion rate of the nozzle is adjusted to an integer, and the height of the nozzle is adjusted to two decimal places.
5. The method for automatically adjusting printing parameters of an extrusion-type 3D printer based on machine vision according to claim 3, characterized in that: In the step 4, when sending the instruction for adjusting the printing parameters to the printer, only one parameter is adjusted at a time, and after adjusting one printing parameter, all lists are cleared.
6. The method for automatically adjusting printing parameters of an extrusion-type 3D printer based on machine vision according to claim 4, characterized in that: When multiple printing parameters need to be adjusted, adjust the parameters individually in the order of nozzle movement rate, extrusion rate, and height.
Citation Information
Patent Citations
Powder bed type 3D printing closed-loop control device, system and method based on visual monitoring
CN110052607A
Multi-degree-of-freedom 3D printing correction method based on deep learning
CN116197904A