A machine vision consumable management method and system for 3D printing
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN ELEGOO TECH CO LTD
- Filing Date
- 2026-05-14
- Publication Date
- 2026-08-04
AI Technical Summary
[0003]然而,这种间接计量方式存在固有缺陷:其计量结果完全依赖于送丝齿轮与耗材之间的理想啮合状态
本发明通过在送丝导管外侧安装微型摄像头,直接对移动中的耗材进行光学成像,将图像序列组织为时空图矩阵,并利用方向选择性滤波与线段聚类算法提取材料的真实位移轨迹。该方案绕开了对机械传动系统的依赖,从物理源头直接观测材料流动状态,再结合几何标定与喷嘴参数计算出连续的体积流率,最终积分获得累计挤出体积并换算为质量消耗。由于计量过程基于实际可见的材料运动,即使发生送丝打滑或阻力波动,系统仍能准确反映真实挤出情况,从而有效克服了传统方法因机械假设失效而导致的计量偏差,显著提升了耗材用量统计的准确性与可信度。
Smart Images

Figure CN122500950A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of 3D printing technology, specifically to a machine vision consumable management method and system for 3D printing. Background Technology
[0002] In fused deposition modeling (FDM) 3D printing, accurately determining the actual consumption of filament is crucial for ensuring successful printing, optimizing material usage efficiency, and managing the production process. Currently, most 3D printing equipment employs an indirect measurement method based on the motion parameters of the filament feeding mechanism. This involves calculating the length of the fed filament using drive pulses from a stepper motor or encoder feedback, and then combining this with a preset material diameter to calculate volume and mass consumption. This method is simple in structure and low in cost, making it the mainstream technology in the industry.
[0003] However, this indirect metering method has inherent flaws: its metering results rely entirely on the ideal meshing state between the filament feeding gear and the filament. When issues arise during actual printing, such as filament surface slippage, material expansion due to moisture, batch-to-batch diameter differences, slight nozzle blockage, or delayed retraction response, the theoretical output of the filament feeding mechanism will deviate significantly from the actual extrusion volume at the nozzle. Because the system cannot detect these non-ideal conditions, the recorded "used filament" data is distorted, making it difficult for users to accurately estimate whether the remaining material is sufficient to complete the current task. This easily leads to printing failures such as material shortages and interlayer breakage, severely impacting print quality and process reliability. Summary of the Invention
[0004] This invention aims to provide a machine vision-based consumable management method and system for 3D printing, which effectively overcomes the measurement deviation caused by the failure of mechanical assumptions in traditional methods, and significantly improves the accuracy and reliability of consumable usage statistics.
[0005] To achieve the above objectives, the technical solution adopted by this invention is: a machine vision-based consumable management method for 3D printing, comprising: A miniature camera with a constant focal length is installed on the outside of the wire feeding guide tube, and periodic single-line sampling is performed at a uniform frame rate. White balance and gain self-correction are applied to the acquired images to generate normalized images. The normalized single-line images are then organized into a spatiotemporal map matrix in chronological order. Direction-selective filtering is applied to the spatiotemporal map matrix to enhance the angular fringe response, detect edges, and extract candidate line segment sets. Candidate line segments are clustered and merged based on directional consistency and spatiotemporal proximity. A weighted fitting is performed on the line segments in the largest energy cluster to generate a global displacement-time function. Static geometric calibration is performed using standard parts of known dimensions to obtain the lateral scaling factor, and edge positioning deviations are corrected by combining the guide tube inner diameter constraint. The global displacement function is multiplied by the corrected scaling factor to obtain the physical spatial position-time series. The physical displacement series mapped to the nozzle exit plane is differentiated by central difference to obtain the instantaneous velocity flow pattern at the nozzle exit. The nozzle inner diameter is measured to calculate the cross-sectional area, and the volumetric flow rate series is calculated based on the instantaneous velocity flow pattern at the nozzle exit and the nozzle inner cross-sectional area. The volumetric flow rate series is integrated over time to obtain the cumulative extrusion volume, which is then converted into mass consumption based on the material density.
[0006] Preferably, the installation of the miniature camera with a constant focal length includes: An unobstructed duct section was selected as the observation window; Adjust the camera so that its optical axis is perpendicular to the direction of the consumable's movement and points towards the central axis of the conduit; Configure a light-shielding structure to eliminate interference from stray external light sources, and verify that the outline of the consumables is centered and the two edges are symmetrical in the monitoring screen.
[0007] Preferably, applying direction-selective filtering to the spatiotemporal graph matrix includes: Perform a two-dimensional Fourier transform on the spatiotemporal graph matrix; Define a polar coordinate mask and set the orientation tolerance parameter to control the range of allowed frequency component angles; The filtered result is obtained by performing an inverse transform on the spectrum after masking, and the fringe response of the enhanced angle is based on the filtered result.
[0008] Preferably, the static geometric calibration using a standard part of known dimensions includes: A standard rod of known size is placed in the observation window to replace the actual consumables and form a calibration image; Multiple single-row images are acquired from the calibration image and averaged to reduce noise; The horizontal scaling factor is obtained by measuring the pixel width occupied by the standard bar in the average image and comparing the nominal diameter of the standard bar with the measured pixel width.
[0009] Preferably, the calculation of the cross-sectional area by measuring the inner diameter of the nozzle includes: Disassemble the extruder assembly to expose the nozzle outlet and directly measure the inner diameter of the nozzle outlet orifice; Substitute the measured inner diameter into the formula for the area of a circle to calculate the cross-sectional area; The average value of the cross-sectional area calculation results for multiple nozzle samples of the same model is taken.
[0010] Preferably, the calculation of the volumetric flow rate sequence based on the instantaneous velocity flow pattern at the nozzle outlet and the cross-sectional area of the nozzle orifice includes: Within a sliding window, the mean and standard deviation of recent volumetric flow rates are statistically analyzed to form a local benchmark; The normalized residual of the volumetric flow rate at the current moment is calculated using a local benchmark; Based on the normalized residuals, a dual-threshold hysteresis comparator is used to distinguish between transient fluctuations and persistent anomalies; The system classifies anomaly types based on the current motion command status flags and generates corresponding alarms.
[0011] Preferably, the configuration of the dual-threshold hysteresis comparator includes: Set warning upper and lower limits, as well as trigger upper and lower limits; When the normalized residual exceeds the warning limit, a high-level warning state is entered; When the normalized residual exceeds the trigger limit, it is determined to be a persistent anomaly; The warning state will exit when the normalized residual falls back to the preset range.
[0012] Preferably, the determination of the anomaly type includes: Query the current motion command status; When a pullback instruction exists and the normalized residual is below the trigger lower limit, it is classified as a normal pullback. When there is no pullback instruction and the normalized residual shows a negative peak, it is marked as an unexpected backflow. When the normalized residual is higher than the trigger limit and the current state is static, it is judged as hot end leakage.
[0013] Preferably, the step of integrating the volumetric flow rate sequence over time to obtain the cumulative extrusion volume includes: Obtain the instantaneous displacement increment of the print head on each axis; The required volume increment is calculated based on the instantaneous displacement increment and path design parameters. A correction signal is generated by comparing the theoretically required volume increment with the actual measured extrusion volume difference. The correction signal is applied to the wire feeding rate control of subsequent path segments to achieve overall balance.
[0014] On the other hand, this invention proposes a machine vision consumable management system for 3D printing, comprising: A miniature camera, installed on the outside of the wire feeding guide, has a constant focal length and is used to set a uniform frame rate for periodic single-line sampling. The image processor, connected to a miniature camera, is used to perform white balance and gain self-correction to generate normalized images, organize the normalized single-row images into a spatiotemporal map matrix, apply direction-selective filtering to the spatiotemporal map matrix, detect edges and extract candidate line segment sets, cluster and merge the candidate line segments, and weight-fit the line segments in the largest energy cluster to generate a global displacement-time function. The calibration module, connected to the image processor, is used to perform static geometric calibration to obtain the lateral scaling factor, correct edge positioning deviations by combining the inner diameter constraint of the duct, convert the global displacement function into a physical space position-time series, perform central difference differentiation on the physical displacement series mapped to the nozzle exit plane, and obtain the instantaneous velocity flow pattern at the nozzle exit. The volume calculator, connected to the calibration module, is used to measure the nozzle inner diameter to calculate the cross-sectional area, calculate the volumetric flow rate based on the instantaneous velocity flow pattern and cross-sectional area, and obtain the cumulative extrusion volume by integrating the volumetric flow rate over time, which is then converted into mass consumption based on the material density.
[0015] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention utilizes a miniature camera mounted on the outside of the wire feeding guide to directly optically image the moving consumable. The image sequence is organized into a spatiotemporal graph matrix, and the true displacement trajectory of the material is extracted using directional selective filtering and line segment clustering algorithms. This approach bypasses reliance on mechanical transmission systems, directly observing the material flow state from its physical source. Combined with geometric calibration and nozzle parameters, a continuous volumetric flow rate is calculated, and finally, the cumulative extrusion volume is obtained through integration and converted into mass consumption. Because the metering process is based on actual, visible material movement, even if wire slippage or resistance fluctuations occur, the system can still accurately reflect the actual extrusion situation. This effectively overcomes the metering deviations caused by the failure of mechanical assumptions in traditional methods, significantly improving the accuracy and reliability of consumable usage statistics. Attached Figure Description
[0016] Figure 1 The flowchart shows the machine vision consumable management method for 3D printing according to the present invention. Figure 2 This is a block diagram of the machine vision consumable management system for 3D printing according to the present invention. Detailed Implementation
[0017] The following description is intended to disclose the invention and enable those skilled in the art to implement it. The preferred embodiments described below are merely examples, and other obvious variations will occur to those skilled in the art.
[0018] like Figure 1As shown, this invention proposes a machine vision-based consumable management method for 3D printing, aiming to solve the problem of deviation in actual material consumption caused by traditional equipment relying solely on encoders or counting devices to estimate filament length during operation. It introduces image-based real-time monitoring methods, combined with dynamic geometric modeling and continuous state tracking logic, to construct a closed-loop processing flow from original image acquisition to consumable volumetric flow rate derivation; specifically including the following steps: Install a miniature camera with a constant focal length on the outside of the wire feeding guide tube, and perform periodic single-line sampling at a uniform frame rate; specifically, this includes: selecting an unobstructed section of the guide tube as the observation window; adjusting the camera so that its optical axis is perpendicular to the direction of material movement and points to the central axis of the guide tube; configuring a light-shielding structure to eliminate interference from external stray light sources, and verifying that the outline of the material is centered and the two edges are symmetrical in the monitoring image.
[0019] By establishing stable and controllable imaging conditions outside the wire feeding guide, the surface motion characteristics of the consumable were continuously and clearly captured. This setup effectively suppressed the impact of ambient light fluctuations and viewing angle distortion on image quality, providing a reliable visual input basis for the subsequent accurate extraction of material displacement information from the spatiotemporal map, and significantly improving the repeatability and stability of displacement measurements.
[0020] The acquired images are subjected to white balance and gain self-correction to generate normalized images. The normalized single-row images are then organized into a spatiotemporal map matrix in chronological order. Direction-selective filtering is applied to the spatiotemporal map matrix to enhance the angular fringe response, and edges are detected and candidate line segment sets are extracted. Specifically, this includes: performing a two-dimensional Fourier transform on the spatiotemporal map matrix; defining a polar coordinate mask and setting a direction tolerance parameter to control the allowed frequency component angle range; performing an inverse transform on the spectrum after mask processing to obtain the filtering result; and enhancing the angular fringe response based on the filtering result.
[0021] By combining image normalization and frequency domain directional filtering, the stripe features caused by consumable movement are effectively separated from background noise, enhancing the consistency of spatiotemporal response along a specific tilt angle. This processing method improves the tolerance of edge detection to low contrast and local blurring, enabling stable extraction of motion trajectories even under uneven lighting or weak surface texture conditions. This provides high signal-to-noise ratio feature input for subsequent displacement calculation, ensuring the continuity and robustness of velocity perception.
[0022] Candidate line segments are clustered and merged based on directional consistency and spatiotemporal proximity. A global displacement-time function is generated by weighted fitting of line segments in the largest energy cluster. Static geometric calibration is performed using standard parts of known dimensions to obtain the lateral scaling factor. The edge positioning deviation is corrected by combining the inner diameter constraint of the conduit. Specifically, this includes: placing a standard rod of known dimensions in the observation window to replace the real consumable to form a calibration image; acquiring multiple frames of single-line images from the calibration image and averaging them to reduce noise; measuring the pixel width occupied by the standard rod in the average image, and comparing the nominal diameter of the standard rod with the measured pixel width to obtain the lateral scaling factor.
[0023] This processing method significantly improves the accuracy and reliability of global displacement measurement. By clustering and merging candidate line segments based on directional consistency and spatiotemporal proximity, interference from noise and irrelevant features is effectively filtered out, ensuring accurate capture of the consumable's motion trajectory. The global displacement-time function generated by weighted fitting provides smoother and more continuous displacement measurement results, laying a solid foundation for velocity and acceleration calculations.
[0024] Multiply the global displacement function by the corrected scaling factor to obtain the physical spatial position-time series. Perform central difference differentiation on the physical displacement series mapped to the nozzle exit plane to obtain the instantaneous velocity flow pattern at the nozzle exit. The calculation of the cross-sectional area by measuring the nozzle inner diameter specifically includes: disassembling the extruder assembly to expose the nozzle outlet and directly measuring the inner diameter of the nozzle outlet channel; substituting the measured inner diameter into the formula for the area of a circle to calculate the cross-sectional area; and averaging the cross-sectional area calculation results of multiple nozzle samples of the same model. The volumetric flow rate sequence is then calculated based on the instantaneous velocity flow pattern at the nozzle outlet and the cross-sectional area of the nozzle inner diameter. The cumulative extrusion volume is obtained by integrating the volumetric flow rate sequence over time, and then converted into mass consumption based on the material density. Specifically, this includes: calculating the mean and standard deviation of the recent volumetric flow rate within a sliding window to form a local benchmark; using the local benchmark to calculate the normalized residual of the volumetric flow rate at the current moment; distinguishing between transient fluctuations and persistent anomalies based on the normalized residual using a dual-threshold hysteresis comparator; and classifying the anomaly type by combining the current motion command status flag and generating corresponding alarms.
[0025] By establishing a precise mapping relationship from pixel displacement to physical space motion and integrating the actual geometric features of the nozzle, a high-fidelity dynamic characterization of the material extrusion process is achieved. This method combines visual observation results with physical parameters, enabling continuous and accurate tracking of instantaneous flow rate changes and effectively eliminating systematic deviations caused by individual equipment differences or manufacturing tolerances. An anomaly identification mechanism based on real-time flow rate statistical analysis can keenly capture abnormal fluctuations in the extrusion process without relying on prior models, distinguishing between normal changes caused by operational commands and abnormal behaviors caused by potential malfunctions. This enhances early warning capabilities for key issues such as material blockage, leakage, and backflow, ensuring the stability of the printing process and the consistency of finished product quality.
[0026] Furthermore, the settings for the dual-threshold hysteresis comparator include: setting an upper and lower warning limit, as well as an upper and lower trigger limit; entering a high-level warning state when the normalized residual exceeds the upper warning limit; determining a persistent anomaly when the normalized residual exceeds the upper trigger limit; and exiting the warning state when the normalized residual falls back to the preset range.
[0027] Furthermore, the judgment of abnormal types includes: querying the motion command status at the current moment; when there is a pullback command and the normalized residual is lower than the trigger lower limit, it is classified as normal pullback; when there is no pullback command and the normalized residual shows a negative peak, it is marked as unexpected backflow; when the normalized residual is higher than the trigger upper limit and it is currently in the static segment, it is judged as hot end leakage.
[0028] By introducing a dual-threshold hysteresis mechanism, false alarms caused by flow fluctuations are effectively suppressed, avoiding frequent alarms due to instantaneous disturbances and improving the stability and reliability of anomaly detection. Contextual recognition of residual patterns based on motion command states enables accurate differentiation between normal process actions and actual faults, significantly reducing the false alarm rate during the backfeeding process and reliably identifying hidden faults such as non-command backflow and hot-end leakage in static states.
[0029] The above-mentioned method of time integration of volumetric flow rate sequence to obtain cumulative extrusion volume includes: obtaining the instantaneous displacement increment of the printhead on each axis; calculating the theoretically required volume increment based on the instantaneous displacement increment and path design parameters; comparing the difference between the theoretically required volume increment and the measured extrusion volume to generate a correction signal; and applying the correction signal to the filament feed rate control of subsequent path segments to achieve total balance.
[0030] By dynamically comparing the measured extrusion amount with the path requirements and generating a closed-loop correction signal, an adaptive match between material supply and geometric shaping requirements is achieved. This mechanism effectively compensates for extrusion deviations caused by changes in material properties or process disturbances, avoids stacking defects caused by over-extrusion or poor interlayer bonding caused by insufficient material supply, and improves the dimensional accuracy and structural density of printed parts.
[0031] On the other hand, this invention proposes a machine vision consumable management system for 3D printing, such as... Figure 2 As shown, it includes: A miniature camera, installed on the outside of the wire feeding guide, has a constant focal length and is used to set a uniform frame rate for periodic single-line sampling. The image processor, connected to a miniature camera, is used to perform white balance and gain self-correction to generate normalized images, organize the normalized single-row images into a spatiotemporal map matrix, apply direction-selective filtering to the spatiotemporal map matrix, detect edges and extract candidate line segment sets, cluster and merge the candidate line segments, and weight-fit the line segments in the largest energy cluster to generate a global displacement-time function. The calibration module, connected to the image processor, is used to perform static geometric calibration to obtain the lateral scaling factor, correct edge positioning deviations by combining the inner diameter constraint of the duct, convert the global displacement function into a physical space position-time series, perform central difference differentiation on the physical displacement series mapped to the nozzle exit plane, and obtain the instantaneous velocity flow pattern at the nozzle exit. The volume calculator, connected to the calibration module, is used to measure the nozzle inner diameter to calculate the cross-sectional area, calculate the volumetric flow rate based on the instantaneous velocity flow pattern and cross-sectional area, and obtain the cumulative extrusion volume by integrating the volumetric flow rate over time, which is then converted into mass consumption based on the material density.
[0032] In addition, the components of the above system also perform other steps in implementing a machine vision-based consumable management method for 3D printing, as follows: Step 1: Establish a line scan image acquisition framework based on a fixed viewpoint To achieve non-contact observation of the consumable's movement, a stable and repeatable optical acquisition environment must first be constructed. This environment should ensure that each image is taken under the same spatial reference, thus laying the foundation for the subsequent mapping between the pixel coordinate system and the physical coordinate system. The core of this framework lies in configuring a two-dimensional area array sensor in line scan mode, activating only one row of photosensitive units for periodic exposure, thereby simulating a one-dimensional visual array distributed along the consumable's axis.
[0033] Step 1.1: Install a miniature camera with a constant focal length and vertical orientation on the outside of the wire feeding guide tube. Outside the rigid duct near the extruder inlet, a section with good straightness and no obstructions was selected as the observation window. A small digital camera with a fixed-focus lens was fixedly installed at this location, with its optical axis strictly perpendicular to the direction of material movement and pointing towards the central axis of the duct. The camera's housing was designed with a light-shielding structure to prevent stray light sources from affecting image contrast. After installation, its pitch and yaw angles were adjusted until the outline of the material was centered in the monitoring image and its two edges were symmetrical, ensuring that the field of view completely covered the cross-section of the area under test. This physical layout, once determined, remained unchanged, forming the spatial origin reference for all subsequent image analysis.
[0034] Step 1.2: Set a uniform frame rate and clock synchronization signal to drive periodic single-line sampling. After activating the camera device, configure its working mode to "line scan triggered acquisition," meaning it will acquire data at fixed time intervals. (For example, 50 milliseconds), only the pixel values of the central horizontal row of the sensor are read, generating a grayscale data sequence with a width equal to the image resolution and a height of 1. This time interval is controlled by a unified synchronization pulse signal issued by the main control unit to ensure that image acquisition and other motion control commands are on the same time reference. Let the... The time of the next collection is The corresponding data acquisition behavior ,in Indicates the horizontal pixel index. The image width is represented by [value]. This discretized time series forms the basic input source for subsequent motion analysis.
[0035] Step 1.3: Perform white balance and gain self-calibration before each sampling to maintain illumination consistency. Because ambient lighting may experience slow drift or power fluctuations, directly using the raw grayscale values can lead to feature extraction errors. Therefore, in each... Before generation, the system automatically performs a background brightness assessment: turns off the active fill light (if present), and collects a reference line under the current environment when no consumables are passing through. Then, the standard brightness light source was turned on, and the response line was recorded when the full-width white calibration plate filled the field of view. Based on these two benchmarks, the following normalization transformation was applied to this data collection: ; This operation compresses the original output to a standard 8-bit dynamic range while eliminating the effects of lens vignetting and uneven sensor response, making the grayscale values at the same location comparable across different time periods and ensuring feature stability.
[0036] Step 1.4: Organize the normalized single-row images into a spatiotemporal graph matrix in chronological order. Continuously collected The normalized data rows are stacked vertically to form a size of Two-dimensional matrix Each row represents the spatial grayscale distribution at a given moment, and each column reflects the brightness change of a pixel location over time. This matrix is called a "space-time image," and its internal diagonal stripe structure visually depicts the migration trajectory of the consumable surface texture along the time axis. If the consumable moves at a constant speed, the stripes are regularly slanted; if there is a pause or regression, horizontal segments or reverse slopes will appear. This representation elevates the one-dimensional time-series signal to a two-dimensional image structure, facilitating subsequent processing using mature edge detection and optical flow estimation algorithms, while also providing a visual interface for manual verification.
[0037] By fixing the imaging geometry, locking the sampling rhythm, compensating for optical biases, and constructing a spatiotemporal representation, a controlled and reproducible data input channel is established. The resulting spatiotemporal map matrix... As the information source of the entire method, its quality directly determines the reliability of reasoning in subsequent stages.
[0038] Step 2: Extract the dominant motion trend line from the spatiotemporal graph and fit the global displacement trajectory. After obtaining a high-quality spatiotemporal graph matrix, the next goal is to separate the main directional clues representing the overall movement of the consumables from the complex grayscale texture. Since the actual surface of consumables often has non-uniform features such as printing marks, scratches, and weld lines, these local details form multiple sets of intersecting diagonal line structures in the spatiotemporal graph. If these are not distinguished, it can easily lead to branching errors in motion estimation. Therefore, a combination of hierarchical filtering and directional clustering is needed. First, high-frequency components with collinearity are enhanced, then the set of trend lines with the strongest energy and best continuity is selected. Finally, a weighted averaging strategy is used to synthesize a main trajectory curve reflecting the macroscopic displacement law.
[0039] Step 2.1: Apply direction-selective filtering to the spatiotemporal graph matrix to enhance the fringe response at specific angles. To highlight the oblique structure aligned with the direction of consumable movement, a set of fan-shaped bandpass filters was designed to cover the possible tilt angle range (e.g., within ±30°). Specifically, this was achieved by applying a matrix in the frequency domain... Perform a two-dimensional Fourier transform to obtain Then define a polar coordinate mask. Only those conditions are allowed to be met. and The frequency components pass through, where Center orientation (initially set to -45°, corresponding to forward feeding). Control the directional tolerance (e.g., 10°). Low-frequency background drift is eliminated. The filtered result is obtained after inverse transform. In this process, stripes matching the set direction are significantly enhanced, while cluttered textures and noise are suppressed. This operation is equivalent to performing a "motion orientation selection" on the image plane, improving the signal-to-noise ratio.
[0040] Step 2.2: Detect edges and extract candidate line segment sets in the filtered spatiotemporal map. right The Canny edge detection method is applied to identify all locations where intensity changes abruptly, forming a binarized edge map. Then, the probabilistic Hough Transform was used to extract line segments from the graph: a sufficient number of edge point pairs were randomly selected, and the parameters (slope) of the lines they determined were calculated. and intercept The votes are accumulated in the parameter space. When the cumulative votes for a certain parameter combination exceed a preset threshold, the corresponding line segment is added to the candidate set. Each line segment includes a starting point. ,end and its direction angle These line segments represent observable local motion fragments at different times and locations, but it has not yet been determined whether they belong to the overall behavior of the same physical object.
[0041] Step 2.3: Cluster and merge candidate line segments based on directional consistency and spatiotemporal proximity. Considering that the same consumable should exhibit similar speed and direction of movement within a continuous time period, it can be based on the direction angle. The degree of overlap with the time span Group the elements. First, set the directional tolerance. (e.g., 5°) and time adjacency threshold (e.g., 200ms) Iterate through all line segment pairs If satisfied Conversely, if they do not belong to the same continuous feeding process, they are considered to belong to the same cluster. After initial clustering, the line segments within each cluster are arranged chronologically, and attempts are made to connect segments with similar beginnings and ends to extend the trajectory. For isolated short line segments (length less than...), ... ), are considered transient interferences and are therefore eliminated.
[0042] Step 2.4: Generate a global displacement-time function by weighted fitting of line segments in the maximum energy cluster. Among all clustering results, select the cluster that contains the largest number of line segments or the longest total pixel length. As the primary motion source. For the endpoint coordinates of all line segments within this cluster. Construct a linear regression model in the least squares sense: ; Where the slope This is the estimated average pixel velocity (unit: pixels / second), intercept. This represents the initial position offset. To improve robustness, each point is assigned a weight. The support of the line segment it belongs to (such as its length or number of votes) is proportional to the support of the line segment it belongs to. Solve the weighted least squares problem: ; Optimal parameters obtained The overall displacement law of consumables in the image coordinate system is defined. This function describes the evolution path of the consumable front end in the horizontal pixel coordinates from the start time to the end of the current observation window, serving as a bridge connecting visual observation and physical motion.
[0043] The spacetime graph generated in the previous step After a series of operations including directional filtering, edge extraction, clustering screening, and curve fitting, an analytical function representing the main movement trend of consumables was successfully extracted. This process essentially deduces global patterns from a large number of local observations, preserving the rich details of the original data while avoiding random errors caused by single short-term measurements. In particular, by introducing direction selection and clustering mechanisms, the system can effectively distinguish between the main motion and other secondary disturbances (such as artifacts caused by vibration), thereby improving the purity of trajectory estimation.
[0044] Step 3: Calibrate pixel scale relationships and convert them into real-time displacement sequences in physical space. Although the displacement function of the consumable has been obtained in the image domain However, this result remains at the pixel level and cannot be directly used to quantify material consumption. A mapping between pixel coordinates and real-world lengths must be established to bridge the gap from "visual movement" to "physical propulsion." This calibration process must consider various factors such as lens magnification, installation distance, and the actual diameter of the consumable material, and ensure the accuracy of the conversion coefficients through both static and dynamic verification. Once a stable scale factor is obtained, the pixel position at each moment can be converted into a corresponding millimeter-level displacement value, forming a continuous physical displacement time series, providing the basic input for subsequent volume integration.
[0045] Step 3.1: Perform static geometric calibration using standard parts of known dimensions to obtain the lateral scaling factor. Prepare a standard rod with a precisely known diameter (e.g., a stainless steel cylinder with a diameter of Φ1.75±0.05mm) and place it in the original observation window to replace the actual consumable material. Align its axis with the center of the guide tube and ensure its surface is clean and free of reflection. Start the camera device, acquire several frames of single-line images, and average them to reduce noise. Measure the pixel width it occupies in the image. Therefore, the horizontal scaling factor is calculated. (Unit: mm / pixel): ; in This is the nominal diameter of the standard rod. This factor reflects the actual lateral distance corresponding to a unit pixel and is the core bridge connecting image space and physical space. To improve accuracy, measurements can be repeated three or more times under different brightness conditions, and the result should be taken as the standard value. The median value is used as the final calibration result.
[0046] Step 3.2: Correct edge positioning deviations by incorporating catheter inner diameter constraints to improve radial measurement consistency. Because standard rods differ from actual consumables in terms of material, reflective properties, and surface roughness, directly applying... This could introduce systematic offsets in practical applications. Therefore, the inner wall of the catheter is introduced as an auxiliary reference: the internal contour of the catheter is photographed without consumables, and the pixel coordinates of its left and right edges in the image are measured. Calculate the pixel span corresponding to the theoretical inner diameter. When the actual consumable is inserted, if its detection width is... The actual effective scaling factor should be dynamically adjusted according to the ratio of the inner and outer diameters. ; in This is the measured value of the catheter's inner diameter. This refers to the nominal diameter of the consumable (e.g., 1.75mm). This correction compensates for contour extraction deviations caused by differences in edge sharpness, making the scale mapping closer to the actual contact state.
[0047] Step 3.3: Multiply the global displacement function by a scaling factor to obtain the position-time series within the physical domain. The pixel-level displacement function obtained in step two With the corrected scaling factor Multiplying these together yields the lateral position function of the consumable in physical space: ; The function outputs in millimeters, representing the cumulative push distance from the reference zero point. Because... It is a smooth curve obtained by weighted fitting of multiple local line segments. It also exhibits good continuity and noise resistance. It is worth noting that "lateral" here refers to the axial direction of the consumable. Since the camera's viewing angle is perpendicular to its direction of movement, the horizontal displacement in the image directly corresponds to the actual advance length.
[0048] Step 3.4: Differentiate the physical displacement sequence to obtain the instantaneous velocity manifold at each time step. To further reveal the details of the movement, Perform numerical differentiation to calculate the instantaneous velocity at each sampling point: ; Using the central difference scheme can effectively reduce high-frequency oscillations during the differentiation process, resulting in... This reflects the consumables in the first The actual travel speed at any given moment (unit: mm / s). This velocity sequence can not only identify constant speed, acceleration, and stationary periods, but also capture minute pullbacks or temporary pauses, providing a refined time-resolution basis for subsequent volume integration. Simultaneously, velocity abrupt changes can also serve as event markers, used to coordinate responses from other control systems.
[0049] By introducing dual constraints of standard components and conduit geometry, this step achieves a reliable conversion from pixel scale to physical scale. The obtained physical displacement function... and its derived velocity sequence Instead of abstract image coordinates, these are motion parameters with clear engineering implications. This method, based on physical calibration, effectively avoids calculation errors caused by near-field effects and non-ideal focusing in micro-imaging systems, ensuring the accuracy of length measurements. Especially when dealing with consumables from different brands or batches, as long as their diameter falls within the allowable range of the conduit, dynamic correction factors can be used to ensure accuracy. It adapts and adjusts automatically, demonstrating strong universality.
[0050] Step 4: Derive real-time volumetric flow rate by fusing nozzle geometry parameters and motion state. Axial displacement information alone is insufficient to fully characterize the material consumption process, as the material ultimately deposited on the molding platform exists in a three-dimensional volume. To accurately measure material consumption, the measured linear velocity must be converted into the volume of molten material flowing out of the nozzle per unit time. This conversion relies on two key factors: the effective flow cross-sectional area of the nozzle outlet and the density and flow uniformity of the material in the high-temperature zone. By pre-determining the nozzle orifice size and combining it with real-time velocity data, a simplified plunger flow model can be established to estimate the volumetric output rate at each instant, and the cumulative consumption can be obtained through time integration.
[0051] Step 4.1: Measure the diameter of the nozzle's inner bore and calculate its corresponding cross-sectional area. Disassemble the extruder assembly and use a high-powered microscope or laser diameter gauge to measure the actual inner diameter of the nozzle outlet orifice. (Unit: mm). Since most nozzles have a cylindrical straight-hole structure, their cross-sectional area... It can be calculated using the circular formula: ; This area represents the size of the final confined channel through which the molten material exits the nozzle, and is a key parameter determining the maximum flow rate. To eliminate the influence of manufacturing tolerances, it is recommended to average the values from multiple samples of the same model. If the nozzle is a non-circular orifice design (such as a flat die), its effective projected area must be accurately calculated using image segmentation.
[0052] Step 4.2: Assume that the material forms a continuous dense stream at the nozzle exit and neglect the expansion effect. At normal operating temperatures, the thermoplastic filament is sufficiently softened and propelled through narrow channels under high pressure, forming a continuous melt flow. During this process, it is assumed that the material density remains constant and that the material immediately adheres to the previously cured surface after extrusion, without significant mold expansion. This simplifying assumption allows the volumetric flow rate to be directly given by the product of the cross-sectional area and the instantaneous linear velocity at the nozzle exit. ; in Instantaneous volumetric flow rate (unit: mm³ / s). This represents the instantaneous linear velocity at the nozzle exit. Although slight expansion or stretching may occur in practice, this deviation is small and tends to stabilize under most desktop printing conditions, and can be compensated for later using empirical coefficients.
[0053] Step 4.3: Integrate the volumetric flow rate sequence over time to obtain the cumulative extrusion volume. At each sampling time The values are arranged in chronological order and the trapezoidal rule is used for cumulative integration: ; in Indicates from the start of observation to the [number]th [number]. The total extruded volume (in mm³) up to this point. This accumulation process covers all forward feeding stages while automatically excluding the stationary and retraction periods (because of their...). (Or a negative value). The starting point for integration is usually set to the zero point when each new task is started, to ensure that the usage of each job is counted independently.
[0054] Step 4.4: Convert the material density into mass consumption and update the inventory ledger. To obtain further consumption information in the mass dimension, material volume density can be introduced. (Unit: g / mm³, typical PLA is approximately 0.00124 g / mm³), convert cumulative volume to mass: ; This value represents the net weight of consumables used to date. The system can periodically write this data to local storage or upload it to the central management platform to update the estimated available length of remaining rolls, trigger low-material warnings, or participate in task allocation decisions during multi-machine collaboration. Compared to traditional estimation methods that rely on the number of stepper motor steps, this result better reflects the actual physical discharge volume, especially demonstrating stronger fidelity when dealing with slippage, idling, and variable-speed extrusion.
[0055] By combining visual observation with geometric calibration, motion analysis with simplified fluid dynamics models, a high-fidelity inversion of material usage during 3D printing was achieved. This approach is no longer limited by idealized assumptions about mechanical transmission systems, but is based on observable surface movement, fundamentally avoiding measurement inaccuracies caused by insufficient friction or structural wear. Simultaneously, the entire process possesses excellent online processing capabilities, enabling real-time output of volume and mass data without affecting printing progress, providing solid support for refined cost control and intelligent operation and maintenance.
[0056] Step 5: Establish an abnormal extrusion behavior identification mechanism based on volumetric flow rate deviation. After completing the simulation of real-time extrusion volume of consumables, the system has the foundation to sense the actual material output. However, simply providing cumulative usage information is insufficient for proactive management and process intervention. To improve the reliability of the entire machine operation, it is necessary to further analyze the temporal evolution characteristics of the volumetric flow rate to identify behavioral patterns that deviate from the normal process window. Such anomalies typically manifest as feed interruptions, partial nozzle blockage, excessive backflow, or unplanned material leakage. If not detected in time, these can lead to poor interlayer bonding, dimensional deviations, or even printing failures. Therefore, this step introduces a deviation detection logic based on dynamic benchmark comparison. By constructing a short-term reference interval and setting multi-level threshold criteria, early warnings for typical fault scenarios can be achieved.
[0057] Step 5.1: Within the sliding window, calculate the mean and standard deviation of recent volumetric flow rates to form a local benchmark. Considering that path planning in 3D printing tasks leads to frequent speed changes, low flow cannot be simply equated with anomalies. Therefore, an adaptive approach is used to define the "expected" flow range: selecting a time length of... A sliding window (e.g., 2 seconds) covering the current moment. and its predecessor Data from each sampling point Calculate the arithmetic mean within this interval. and sample standard deviation : ; These two statistics together constitute a description of the local flow characteristics under the current operating conditions, reflecting the system's average output capacity and fluctuation level over a recent period. Because the window moves continuously over time, this benchmark can automatically adjust to changes in the printing strategy, avoiding false alarms caused by normal speed variations.
[0058] Step 5.2: Calculate the normalized residual of the current volumetric flow rate relative to the local baseline. The current measurement As mentioned above By comparison, normalized residual variables are constructed. : ; in This is a very small constant (e.g., 0.01 mm³ / s) used to prevent the denominator from being zero. This residual value measures how much the current flow rate deviates from the historical average, and is expressed as a multiple of the standard deviation. A value significantly greater than 1 indicates a substantial discrepancy between the current state and recent trends; a sustained high amplitude suggests a potential systemic disturbance. This normalization process ensures the criterion is unaffected by specific printing speeds, making it suitable for various scenarios ranging from slow, fine-grained printing to high-speed filling.
[0059] Step 5.3: Set up a dual-threshold hysteresis comparator to distinguish between transient fluctuations and persistent anomalies. To avoid noise-induced alarm jitter, a dual-threshold judgment rule with hysteresis is adopted. A warning upper limit is set. Warning lower limit and stricter trigger limits Triggering lower limit The initial state is idle, when... If the upper limit was not reached in the previous moment, it enters a "high-level warning" state; if it does not reach the upper limit in the subsequent moment... Continue to rise to If the above occurs, it is determined to be an "excessive extrusion" event and a timestamp is recorded; otherwise, when The price enters a "low level warning" phase; if it falls further below this level... This is then confirmed as a "supply shortage" event. Only when... Falling back to The warning state is only lifted when the deviation is within the specified range. This design effectively filters out transient spikes, ensuring that the response only targets persistent and significant deviations.
[0060] Step 5.4: Determine the anomaly type and generate a categorized alarm based on the motion command status flags. Simple dependence The polarity of the signal cannot completely determine the cause of the fault; context analysis must be performed in conjunction with the original motion commands issued by the controller. Check if a "retract" command (i.e., a negative wire feed command) exists at the same time. If it exists and If a negative residual peak occurs without a pullback command, it is classified as "normal pullback" rather than a fault; if an unexpected backflow or "reverse leakage" occurs without a pullback command, it is marked as "unexpected backflow" or "backflow leakage"; if If the current condition is in a static phase (such as waiting for layer switching), it is judged as "hot end leakage" or "pressure accumulation and release"; if it is during the expected feeding period... If the value remains consistently low, it may indicate "feed slippage" or "nozzle micro-clogging." Each category corresponds to different handling suggestions, which are transmitted to the operating interface or central monitoring system via a communication interface to help users quickly locate the root cause of the problem.
[0061] The volumetric flow rate sequence generated in the previous step Through sliding statistics, residual modeling, and state linkage analysis, it is transformed into a series of abnormal event identifiers with semantic meaning.
[0062] Step Six: Dynamically adjust the drive parameters of the wire feeding mechanism based on the anomaly identification results. Once an extrusion behavior deviates from the ideal state, simply issuing an alarm is insufficient to resolve the issue, especially in unattended or remote maintenance scenarios. To enhance the system's autonomous response capabilities, it needs to be endowed with a certain degree of self-adjustment. This step focuses on correcting the drive signal of the wire feeding motor through a feedback mechanism, enabling it to offset the effects of external interference to a certain extent, thereby restoring a volume output close to the target. The core idea of the adjustment is to generate a corresponding compensation factor based on the direction and intensity of the deviation identified in the previous step, and then superimpose it onto the original speed command to form a new execution target. This process must balance response speed and system stability to avoid over-correction that could cause oscillations.
[0063] Step 6.1: Select the corresponding compensation strategy direction for different anomaly types. Based on the classification results in step 5.4, determine the appropriate adjustment direction. If the issue is determined to be "insufficient material supply" and not caused by backflow, it indicates that the actual discharge volume is lower than expected, requiring an increase in the wire feeding rate to improve the supply pressure; in this case, positive compensation should be activated. If "excessive extrusion" is detected and it is not in the acceleration phase, it indicates that too much material is being pushed; the drive speed should be appropriately reduced, and negative compensation should be activated. For "hot end leakage" events, although it is impossible to directly stop the melt flow, additional accumulation can be reduced by briefly pausing the feeding, and then resuming after the temperature stabilizes. For "backflow leakage," consider inserting a small amount of positive pre-push before the next startup to fill the cavity. Each situation corresponds to a set of preset operation response paths to ensure that the adjustment action matches the physical mechanism.
[0064] Step 6.2: Calculate the initial compensation ratio coefficient based on the normalized residual amplitude. The compensation level should not be fixed, but should increase linearly with the severity of the deviation. Taking insufficient material supply as an example, an initial compensation ratio is defined. for: ; in This is the gain factor (recommended value 0.3-0.6), used to limit the maximum adjustment range and prevent aggressive correction. If using residual form, it can be expressed as: ; in For residual sensitivity parameters, To activate the threshold (e.g., 2.0), ensuring that minor fluctuations do not trigger adjustment. The resulting... This indicates the percentage increase that should be made based on the original commanded speed, for example... This translates to a 15% speed increase. This percentage reflects the relative extent of the current missing traffic, providing a quantitative basis for gradually applying the impact later.
[0065] Step 6.3: Introduce an integral accumulation mechanism to gradually correct persistent bias. If the abnormal state persists, it indicates that the one-time compensation failed to completely eliminate the error, and a long-term memory mechanism needs to be activated. An independent integration term should be established. Its update rules are as follows: ; in The integral gain (much smaller than the proportional gain) This term is used to control the accumulation rate. It is specifically designed to address slowly developing systemic offsets, such as the gradual expansion of consumables due to moisture or minor carbon buildup in the nozzle. The final overall compensation is a combination of the proportional and integral terms. ; in This represents the original command speed. This structure mimics the PI combination in classical control laws, responding to both sudden disturbances and correcting steady-state residual error.
[0066] Step 6.4: Apply upper and lower limit constraints to the compensated speed command and smoothly transition to the execution phase. To ensure mechanical safety and material properties, all adjusted speed commands must fall within a reasonable range. Set the minimum wire feed speed. (e.g., 0.5 mm / s) and maximum permissible speed (Determined based on motor torque and hose pressure resistance), forcibly cut off values exceeding the boundary: ; In addition, to avoid vibration or melt fracture caused by sudden speed changes, a linear interpolation method is used for the transition between the old and new instructions, with a duration of [duration missing]. (e.g., 100ms): ; After amplitude limiting and gradual change processing Only then is the data truly sent to the motor driver to ensure smooth and reliable operation. The entire adjustment process is executed cyclically in the background, forming a closed feedback loop around the actual extrusion volume.
[0067] Step 7: Coordinate the motion control system to achieve dynamic matching between path speed and wire feed rate. In most 3D printers, the motion trajectory and filament feed rhythm are independently specified by G-code instructions, lacking real-time linkage between the two. When the curvature of the printing path changes drastically, the die head may be forced to slow down to ensure accuracy, but if the filament feed speed is not adjusted synchronously, it can cause localized material accumulation or thinning. Traditional methods rely on pre-programmed "speed remapping" tables, which are insufficient to handle temporary speed changes or obstacle avoidance maneuvers. To address this issue, this paper proposes a bidirectional coupling mechanism based on measured extrusion feedback, allowing dynamic adjustment of the filament feed rate according to the actual movement of the die head while maintaining overall volume conservation, thereby achieving spatiotemporal alignment between the spatial path and material supply.
[0068] Step 7.1: Real-time acquisition of the instantaneous displacement increment of the print head on each axis The actual position changes of the X, Y, and Z axes within each control cycle are read from the motion controller. Calculate the spatial distance traveled during this time period: ; This value reflects the actual distance the nose travels in three-dimensional space, and may deviate from the original command value due to acceleration / deceleration limitations, resonance suppression, or human intervention. It is based on actual measurements. Instead of theoretical path length, it ensures that subsequent matching is based on the actual process that occurs.
[0069] Step 7.2: Calculate the theoretically required volume increment based on the design flow rate of the path segment. Examine the currently executing G code segment and extract the line width corresponding to that path. Layer thickness And parameters such as filler density, to calculate the theoretically required cross-sectional area to be extruded. Combining The ideal volume increment is obtained as follows: ; This value represents the volume of molten material required to fully cover the current path cell and serves as the target reference for material supply. Although G-codes often contain separate E-axis commands, this recalculation ensures a strict correspondence with spatial geometry, eliminating the influence of command compression or rounding errors.
[0070] Step 7.3: Compare the theoretical demand with the measured supply and generate a correction signal. The above Compared with the actual extrusion volume increment measured by the vision system during the same period Compare and calculate the supply-demand deviation: ; like This indicates a shortage of materials, which needs to be compensated for by appropriately increasing the wire feeding speed in subsequent paths; if If the error value is within a certain range, it indicates that there is already a surplus, and the feeding pace can be appropriately slowed down to prevent accumulation. This error value is used as the cumulative amount across cycles to participate in the adjustment decision for the next stage.
[0071] Step 7.4: Distribute the compensation amount proportionally in subsequent path segments to achieve overall balance. To avoid a single drastic correction affecting quality, the current accumulated error is... Distribute the allocation to the next number of path units. Set the allocation window size. Multiply the wire feed speed of each subsequent segment by a correction factor: ; in For the first The expected volume consumption of each segment of the path. This process is repeated segment by segment until the total deviation approaches zero. This method maintains local smoothness while ensuring global material conservation, making it particularly suitable for incremental deviation correction in long-cycle printing jobs.
[0072] Step 8: Generate a summary and forecast report of consumable consumption for multi-machine clusters. In industrial applications, multiple 3D printing machines often operate in parallel. Therefore, accurately tracking the material usage of each machine is crucial for resource scheduling and supply chain management. Traditional methods rely on manual inspections or decentralized reporting, which are inefficient and prone to errors. This step, based on the material consumption data of each individual machine node, constructs a standardized data aggregation framework. It periodically summarizes historical consumption records for each machine and extrapolates future needs based on current task progress, generating comprehensive reports that can be used for inventory alerts and procurement planning. This process emphasizes data consistency, traceability, and timeliness, and supports flexible queries by project, batch, and material type.
[0073] Step 8.1: Standardize the time base and unit system of all devices to ensure data comparability. Before receiving data from different physical locations, the format is first normalized. All timestamps are converted to UTC standard time to avoid time zone confusion; length units are uniformly set to millimeters, mass units to grams, and volume units to cubic millimeters; material types are coded according to internationally accepted naming conventions (e.g., "PLA-CF" represents carbon fiber reinforced polylactic acid). Each record is appended with a unique device identifier, task number, and start / end time, forming a structured entry for easy indexing and auditing later.
[0074] Step 8.2: Summarize the daily net consumption of each device according to the calendar cycle and store it in the central database. Set a fixed statistical period (such as every 24 hours or every work shift) to collect the cumulative quality consumption reported by each device during that period. The data is written to the central data table. Records include fields such as equipment ID, date, material type, total usage, number of tasks, and longest continuous runtime. A summary hash value of the original time-series segment is also retained for integrity verification. Historical data is archived monthly, supporting rapid retrieval and trend analysis.
[0075] Step 8.3: Estimate the total material demand for the next 72 hours based on the current job queue. Read the task queue list of each device, extract the G-code files that have not yet been executed, parse the volume estimation comments (or perform slice estimation manually), and obtain the expected consumable usage for each task. Based on the current remaining stock Calculate the estimated availability time for each material: ; in This represents the total estimated time for the queue. If... (e.g., 12 hours) is marked as an "urgent material shortage" risk; if it is between If any of these conditions are met, they will be classified as "needs attention". This forecast is updated daily to reflect the latest scheduling changes.
[0076] Step 8.4: Generate a visual dashboard and tiered alert list for administrators to view. The above statistics and forecasts are integrated into a graphical interface: the main view displays a bar chart of the average daily consumption of each device over the past week, supplemented by a line trend; a map view marks the locations of high-risk units; and a table area lists the material inventory that is about to run out and the recommended replenishment quantity. Different priority items are distinguished by color coding (green for normal, yellow for warning, and red for emergency), and key notifications can be pushed via email or messaging platforms. Reports can be exported to a common document format and embedded into an enterprise resource planning system to achieve information flow from the production front end to the supply back end.
[0077] This invention not only solves the measurement inaccuracies caused by mechanical slippage and material differences in traditional methods, but also extends to multiple levels such as process monitoring, anomaly response, collaborative optimization and cluster scheduling, forming a complete closed-loop management system.
[0078] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection claimed by the appended claims and their equivalents is defined.
Claims
1. A machine vision-based consumable management method for 3D printing, characterized in that, include: Install a miniature camera with a constant focal length on the outside of the wire feeding guide tube, and perform periodic single-line sampling at a uniform frame rate; White balance and gain self-correction are performed on the acquired images to generate normalized images. The normalized single-row images are then organized into a spatiotemporal map matrix in chronological order. Apply direction-selective filtering to the spatiotemporal graph matrix to enhance the angular fringe response, detect edges, and extract a set of candidate line segments; Candidate line segments are clustered and merged based on directional consistency and spatiotemporal proximity. A global displacement-time function is generated by weighted fitting of the line segments in the maximum energy cluster. Static geometric calibration using standard parts of known dimensions is used to obtain the lateral scaling factor, and the edge positioning deviation is corrected by combining the inner diameter constraint of the conduit. Multiply the global displacement function by the corrected scaling factor to obtain the physical spatial position-time series. Perform central difference differentiation on the physical displacement series mapped to the nozzle exit plane to obtain the instantaneous velocity flow pattern at the nozzle exit. Calculate the cross-sectional area by measuring the nozzle bore diameter, and calculate the volumetric flow rate sequence based on the instantaneous velocity flow pattern at the nozzle outlet and the nozzle bore cross-sectional area; The cumulative extrusion volume is obtained by integrating the volumetric flow rate sequence over time, and then converted into mass consumption based on the material density.
2. The machine vision consumable management method for 3D printing according to claim 1, characterized in that, The installation of the miniature camera with a constant focal length includes: An unobstructed duct section was selected as the observation window; Adjust the camera so that its optical axis is perpendicular to the direction of the consumable's movement and points towards the central axis of the conduit; Configure a light-shielding structure to eliminate interference from stray external light sources, and verify that the outline of the consumables is centered and the two sides are symmetrical in the monitoring screen.
3. The machine vision consumable management method for 3D printing according to claim 1, characterized in that, The application of directional selective filtering to the spatiotemporal graph matrix includes: Perform a two-dimensional Fourier transform on the spatiotemporal graph matrix; Define a polar coordinate mask and set the orientation tolerance parameter to control the range of allowed frequency component angles; The filtered result is obtained by performing an inverse transform on the spectrum after masking, and the fringe response of the enhanced angle is based on the filtered result.
4. The machine vision consumable management method for 3D printing according to claim 1, characterized in that, The static geometric calibration using standard parts of known dimensions includes: A standard rod of known size is placed in the observation window to replace the actual consumables and form a calibration image; Multiple single-row images are acquired from the calibration image and averaged to reduce noise; The horizontal scaling factor is obtained by measuring the pixel width occupied by the standard bar in the average image and comparing the nominal diameter of the standard bar with the measured pixel width.
5. A machine vision-based consumable management method for 3D printing according to claim 1, characterized in that, The calculation of the cross-sectional area for the inner diameter of the measuring nozzle includes: Disassemble the extruder assembly to expose the nozzle outlet and directly measure the inner diameter of the nozzle outlet orifice; Substitute the measured inner diameter into the formula for the area of a circle to calculate the cross-sectional area; The average value of the cross-sectional area calculation results for multiple nozzle samples of the same model is taken.
6. The machine vision consumable management method for 3D printing according to claim 1, characterized in that, The volumetric flow rate sequence calculated based on the instantaneous velocity flow pattern at the nozzle outlet and the cross-sectional area of the nozzle orifice includes: Within a sliding window, the mean and standard deviation of recent volumetric flow rates are statistically analyzed to form a local benchmark; The normalized residual of the volumetric flow rate at the current moment is calculated using a local benchmark; Based on the normalized residuals, a dual-threshold hysteresis comparator is used to distinguish between transient fluctuations and persistent anomalies; The system classifies anomaly types based on the current motion command status flags and generates corresponding alarms.
7. A machine vision-based consumable management method for 3D printing according to claim 6, characterized in that, The configuration of the dual-threshold hysteresis comparator includes: Set warning upper and lower limits, as well as trigger upper and lower limits; When the normalized residual exceeds the warning limit, a high-level warning state is entered; When the normalized residual exceeds the trigger limit, it is determined to be a persistent anomaly; The warning state will exit when the normalized residual falls back to the preset range.
8. A machine vision-based consumable management method for 3D printing according to claim 6, characterized in that, The determination of the anomaly type includes: Query the current motion command status; When a pullback instruction exists and the normalized residual is below the trigger lower limit, it is classified as a normal pullback. When there is no pullback instruction and the normalized residual shows a negative peak, it is marked as an unexpected backflow. When the normalized residual is higher than the trigger limit and the current state is static, it is judged as hot end leakage.
9. A machine vision-based consumable management method for 3D printing according to claim 1, characterized in that, The step of integrating the volumetric flow rate sequence over time to obtain the cumulative extrusion volume includes: Obtain the instantaneous displacement increment of the print head on each axis; The required volume increment is calculated based on the instantaneous displacement increment and path design parameters. A correction signal is generated by comparing the theoretically required volume increment with the actual measured extrusion volume difference. The correction signal is applied to the wire feeding rate control of subsequent path segments to achieve overall balance.
10. A machine vision consumable management system for 3D printing to implement the method as described in any one of claims 1-9, characterized in that, include: A miniature camera, installed on the outside of the wire feeding guide, has a constant focal length and is used to set a uniform frame rate for periodic single-line sampling. The image processor, connected to a miniature camera, is used to perform white balance and gain self-correction to generate normalized images, organize the normalized single-row images into a spatiotemporal map matrix, apply direction-selective filtering to the spatiotemporal map matrix, detect edges and extract candidate line segment sets, cluster and merge the candidate line segments, and weight-fit the line segments in the largest energy cluster to generate a global displacement-time function. The calibration module, connected to the image processor, is used to perform static geometric calibration to obtain the lateral scaling factor, correct edge positioning deviations by combining the inner diameter constraint of the duct, convert the global displacement function into a physical space position-time series, perform central difference differentiation on the physical displacement series mapped to the nozzle exit plane, and obtain the instantaneous velocity flow pattern at the nozzle exit. The volume calculator, connected to the calibration module, is used to measure the nozzle inner diameter to calculate the cross-sectional area, calculate the volumetric flow rate based on the instantaneous velocity flow pattern and cross-sectional area, and obtain the cumulative extrusion volume by integrating the volumetric flow rate over time, which is then converted into mass consumption based on the material density.