A Multicolor Material Algorithm Control Method and System Based on FDM 3D Printing
Patent Information
- Application Number
- CN202611158618.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-31
- Publication Date
- 2026-09-25
AI Technical Summary
[0012]针对上述问题,本发明旨在解决:如何在多进料单喷头FDM制造中,将固有的延迟出料与延迟收料现象由被动产生的制造副产品、或由补偿手段消除的制造误差,转化为空间位置与过渡长度可控的主动设计变量;并进一步解决通用切片软件及固件预设指令的色彩控制精度不足、无法与几何位置关联,以及参数化设计与制造执行之间存在断层的问题,从而扩展FDM 3D打印在色彩控制、材料复合及光学应用方面的技术边界
[0027](1)延迟混色由制造缺陷转化为可控设计变量。现有技术对多进料单喷头设备的延迟出料与延迟收料现象,均采取预测并补偿消除的技术路线,以追求边界清晰的颜色切换。本发明采取相反的技术构思:对熔融腔死体积所决定的延迟挤出特性进行量化建模(Ld=Vd/Q),将混色比例指令的切换点沿路径反向提前,并在不小于延迟挤出长度的预设过渡长度内将比例指令渐变设置,使延迟产生的自然渐变混色被限制在预设的空间位置与过渡长度之内。由此,现有技术竭力消除的过渡混色成为位置与长度均可设计的色彩过渡效果,实现了对固有物理工艺特性的主动利用。
Smart Images

Figure CN122808204A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of additive manufacturing technology, specifically to a multi-color material algorithm control method and system based on fused deposition modeling (FDM) 3D printing technology, and its application in digital process manufacturing, especially suitable for multi-color mixing manufacturing of translucent components. Background Technology
[0002] FDM 3D printing technology uses heated and molten thermoplastic filaments, which are then extruded through a nozzle and deposited layer by layer to form a three-dimensional solid. It is one of the most widely used additive manufacturing technologies. Currently, multi-color FDM manufacturing mainly relies on the following methods:
[0003] The first category consists of preset color schemes. This includes rainbow filament and post-processing coloring (spraying / dyeing). Rainbow filament exhibits a natural color gradient along its length, but the color distribution is determined by the filament production process and cannot be interfered with by the designer. Furthermore, the gradient direction is fixed to the extrusion direction, making it impossible to achieve complex color distributions such as radial or periodic patterns. Post-processing coloring requires completion after printing, adding an extra step, and the color only adheres to the surface, failing to achieve the body-mixing effect of translucent materials.
[0004] The second type is the multi-head switching and automatic feed changing system (AMS). This solution uses multiple printheads or automatic feed changing devices to load different colors of material, switching between printheads or filaments during printing to achieve color changes. This type of solution has become the mainstream in the current market, but it is limited by the number of printheads or tray capacity, resulting in a limited number of colors. Furthermore, printhead / filament switching is prone to seams, positioning errors, and material waste, and the equipment structure is complex and the cost is high.
[0005] The third category is single-nozzle multi-feed color mixing technology. This solution connects multiple feed channels to a single nozzle, mixing different colored materials within the nozzle cavity. While open-source hardware solutions and some commercial products exist for this technology, it remains a niche application in both the consumer and professional FDM markets, limited by two main constraints: First, at the software level, color control relies primarily on the automatic processing mechanisms of general slicing software or preset color mixing logic in firmware. Designers can only set macroscopic parameters (such as full-layer color change or simple gradients), unable to precisely control the local material mixing ratio at every point along the manufacturing path. Second, at the hardware level, multi-colored materials are difficult to achieve complete uniform fusion within the nozzle cavity, resulting in a multi-colored striped structure after extrusion—a phenomenon considered a color mixing defect in existing technologies. Furthermore, although some solutions employ alternating layer sequences to achieve visual color mixing, their color distribution is determined by the preset layer sequence, unable to be correlated with geometric positions, and cannot achieve dynamic ratio calculations based on mathematical functions.
[0006] At the firmware level, some firmware (such as Marlin) supports setting the color mixing ratio using commands such as M163 / M164 / M165, but this ratio needs to be set manually by the operator or preset through a simple script. It cannot be associated with geometric position, let alone achieve dynamic ratio calculation based on mathematical functions.
[0007] In recent years, academic research has focused on slicing and path planning for Functionally Graded Materials (FGMs). This research allows for the modification of multi-material mixing ratios at the path level according to user-specified functions and models the material transition delay caused by the dead volume of the mixing chamber in a multi-feed single-nozzle system. However, such research, and the aforementioned firmware mixing functions, share a consistent approach to handling transition delays: treating delayed output and delayed receipt as manufacturing errors, and predicting and compensating for them through methods such as early extrusion and flushing replacement to minimize over-mixing and achieve clear color transitions. Under this technical approach, over-mixing remains an object to be suppressed and eliminated; its value as a color representation element has not been recognized, much less incorporated into design calculations.
[0008] While parametric design platforms (such as Grasshopper) are widely used for shape generation in 3D printing, and open-source plugins exist that can directly convert parametric geometry into G-code to bypass general-purpose slicing software, these tools are geared towards single-material extrusion processes. They do not offer the ability to define multi-feed color mixing ratios point-by-point along the path, nor do they address the modeling and utilization of the physical characteristics of delayed discharge and delayed collection in color mixing equipment. Designers cannot directly define the discharge ratio of multi-color materials in a parametric environment, nor can they incorporate the dynamic color changes during the material extrusion process into design variables.
[0009] In addition, another type of color representation approach has emerged in existing technologies: utilizing the two sides of the printed surface's wrinkled structure to carry different colors, or using FDM layer textures as lenticular grating structures to make the same position on the component appear different colors as the viewing angle changes; and a scheme that mixes multiple semi-transparent materials in the printhead before printing, and then uses backlighting to present color changes. The color presentation of this type of scheme depends on the surface geometry or viewing angle. Its material mixing only pursues uniform color mixing within the printhead or overall switching by layer, without involving point-by-point control of the material mixing ratio along the manufacturing path, and even less involving modeling and utilizing the physical characteristics of delayed material output and delayed material receipt. Therefore, it is impossible to achieve a color transition effect that extends along the manufacturing path and whose spatial position and transition length can be preset.
[0010] Therefore, existing FDM multicolor printing technology has the following technical problems: the preset color scheme lacks controllability; the multi-head switching and automatic material changing system is complex, wasteful, and costly; the application of single-head multi-feed color mixing technology is limited due to insufficient software control precision and difficulty in ensuring color mixing uniformity; there is a disconnect between parametric design and manufacturing execution; in particular, the transition color mixing caused by the inherent delayed material output and delayed material collection in multi-feed single-head equipment is only passively generated as a manufacturing byproduct or eliminated as an error compensation, and its spatial position and transition length cannot be actively designed, and cannot be used to create specific color transition aesthetics and optical effects. Summary of the Invention
[0011] 1. Technical problems to be solved
[0012] To address the aforementioned issues, this invention aims to solve the following: how to transform the inherent delayed material output and delayed material receipt phenomena in multi-feed single-nozzle FDM manufacturing from passively generated manufacturing byproducts or manufacturing errors eliminated by compensation methods into active design variables with controllable spatial position and transition length; and further solve the problems of insufficient color control accuracy and inability to correlate with geometric position in general slicing software and firmware preset instructions, as well as the disconnect between parametric design and manufacturing execution, thereby expanding the technological boundaries of FDM 3D printing in color control, material composites, and optical applications.
[0013] 2. Technical Solution
[0014] A multi-color material algorithm control method based on FDM 3D printing includes the following steps:
[0015] S1: Construct a mathematical model of a three-dimensional spatial manufacturing path in a parametric design platform, and generate path data with location information and local geometric attributes, wherein the local geometric attributes include at least the layer number and the three-dimensional spatial coordinates of the path points;
[0016] S2: Based on the local geometric properties, the mixing ratio of multi-color materials corresponding to each path point is calculated through a preset mathematical mapping function to form a position-color mapping relationship;
[0017] S3: The path data and the position-color mapping relationship are directly converted into G-code manufacturing instructions. The conversion is performed by the parametric design platform without going through the automatic processing of general slicing software. The G-code manufacturing instructions include color mixing ratio control instructions. The color mixing ratio control instructions control the feeding of each feeding motor so that the proportion of each material in the melting chamber corresponds to the mixing ratio of the multi-color materials, thereby realizing the real-time mixing of multi-color materials in a single nozzle.
[0018] S4: Manufacturing is performed by executing the G-code manufacturing instructions through a multi-feed single-nozzle FDM device; wherein, for the target position where the color changes in the design, the delayed extrusion length Ld is determined according to the dead volume of the melt chamber of the multi-feed single-nozzle FDM device, Ld = Vd / Q, where Vd is the melt volume from each feed inlet point to the nozzle outlet, and Q is the extrusion volume per unit path length; the switching point of the color mixing ratio instruction is preset offset in the reverse direction along the manufacturing path from the target position, the preset offset is determined according to Ld, so that the starting point of the natural gradient color mixing transition zone generated by delayed discharge and delayed collection is located at the target position, the transition zone is retained as a design element of color transition, forming a color transition effect with controllable spatial position.
[0019] Furthermore, the dead volume Vd of the melt cavity is determined through calibration printing: 100% step-mixing ratio switching printing is performed using two materials with significantly different colors. The lag distance in the path direction of the transition zone start point relative to the command switching point on the printed part is recorded as Ld0, and Vd is calculated according to Vd = Ld0 × Q. Additionally, calibration printing is performed according to multiple target mixing ratios r, and the lag distance ΔL(r) of the transition zone start point relative to the command switching point and the transition zone length W(r) are measured at each target mixing ratio r to obtain the effective delayed extrusion length Ld. eff (r)≈ΔL(r) and the proportionality constant k(r)=W(r) / Ld eff (r); the preset offset is Ld corresponding to the target mixing ratio r. eff (r) Determined.
[0020] Furthermore, the color mixing ratio control command can be implemented using a simultaneous feeding method (the speed ratio of each feeding motor is equal to the ratio of the mixing ratio weights) or an alternating feeding method (alternating full-speed feeding at a preset segment length not greater than Ld, with the segment length ratio equal to the weight ratio) to control the proportion of each material in the melting chamber.
[0021] Furthermore, the mixing ratio instruction is set gradually according to a preset distribution within a preset transition length Lt, where Lt≥Ld, so that the mixing ratio of the actual extruded material changes according to a preset distribution within the transition zone. The spatial position, length, and shape of the transition zone are all preset.
[0022] Where Lt is not less than k(r)·Ld eff When (r), (k(r) is the transition zone length coefficient, k(r) = W(r) / Ld) eff (r), with a proportional change of 5%-95% as the threshold, k0≈3 at a 100% step change, the actual length of the transition band is approximately equal to Lt, and the actual proportional distribution is basically consistent with the preset distribution; the actual length of the transition band is approximately taken as k(r)·Ld eff The larger of (r) and Lt.
[0023] This invention also proposes a multi-color material algorithm control system based on FDM 3D printing, including a parameterized path generation module, a color ratio calculation module, a G-code compilation module, a multi-feed single-nozzle FDM printing device, and a transition zone preset module. The functions of each module correspond to the steps of the above method.
[0024] It should be noted that the color distribution formed by this invention is uniquely determined by the geometric position on the manufacturing path: at any fixed viewing angle, the component exhibits the same color distribution preset by a mathematical mapping function, and the color transition extends along the manufacturing path direction, with its spatial position and transition length preset by an algorithm. This is fundamentally different from the technical approach that relies on surface wrinkle structures or lenticular lens structures to make the same position of the component present different colors with different viewing angles; it is also different from the method of uniformly mixing multi-color materials in the printhead and then printing them in conjunction with backlighting to produce color—in this invention, the incomplete mixing state of multi-color materials in the printhead and the characteristics of delayed output and delayed collection are not eliminated, but are modeled and actively utilized design variables.
[0025] 3. Beneficial effects
[0026] Compared with the prior art, the present invention has the following beneficial effects:
[0027] (1) Delayed color mixing is transformed from a manufacturing defect into a controllable design variable. Existing technologies for delayed discharge and delayed collection in multi-feed single-nozzle equipment adopt a predictive and compensatory approach to eliminate these phenomena, aiming for clear color transitions. This invention adopts the opposite technical concept: it quantitatively models the delayed extrusion characteristics determined by the dead volume of the melt chamber (Ld = Vd / Q), advances the switching point of the color mixing ratio command in the reverse direction along the path, and gradually sets the ratio command within a preset transition length not less than the delayed extrusion length, thus restricting the natural gradual color mixing caused by delay to a preset spatial position and transition length. As a result, the transitional color mixing that existing technologies strive to eliminate becomes a color transition effect where both position and length can be designed, realizing the active utilization of inherent physical process characteristics.
[0028] (2) Improved color control precision. Existing technologies rely on the automatic processing mechanism of general slicing software or the color mixing logic preset in firmware, and designers can only set macroscopic parameters. This invention directly calculates the material mixing ratio at each point on the manufacturing path through a parametric algorithm and associates it with the geometric position to achieve point-by-point dynamic control of the mixing ratio of multi-color materials.
[0029] (3) Design-manufacturing gap elimination. This invention directly converts parametric paths and position-color mapping relationships into G-code manufacturing instructions, skipping the automatic processing stage of general slicing software, enabling the fine color control of multi-feed single nozzles to be directly supported in the parametric design environment, and achieving seamless connection from parametric design to manufacturing execution.
[0030] (4) Formation of digital process effects. Through the combined effect of the above-mentioned technical effects, the present invention can achieve special digital process effects that cannot be presented by traditional injection molding, spraying or single-material 3D printing, which have both micro-geometric textures and macro-color gradations, thus expanding the technical boundaries of FDM 3D printing in color control, material composites and optical applications. Attached Figure Description
[0031] Figure 1 This is a flowchart of the overall algorithm of the technical solution of the present invention, showing the steps from parametric design to manufacturing execution.
[0032] Figure 2 This is a schematic diagram illustrating the principle of parametric path node and local geometric attribute calculation in this invention. Taking concentric circle paths and free curve paths as examples, it shows the definition of local geometric attributes such as path point discreteness, layer number, and radial distance.
[0033] Figure 3 This is a mathematical curve of the radial gradient and periodic stripe color mapping function of the present invention, showing the mathematical relationship between the mixing ratio and the geometric position.
[0034] Figure 4 This is a schematic diagram of the G-code instruction structure that integrates position and color data according to the present invention, showing the integration logic of the color mixing ratio instruction and the extrusion movement instruction at the path point.
[0035] Figure 5 This is a schematic diagram of the delayed utilization and transition zone positioning model of the present invention, showing the positional relationship between the command switching point T′, the target position T, the end point of the transition zone T+W and the reverse advance ΔL(r), as well as the correspondence between the command ratio curve and the actual extrusion ratio curve.
[0036] Figure 6 This is a calibrated printing diagram illustrating the effective delay and transition band length of the present invention, showing the measurement method of the effective delay distance ΔL(r) in the low-cut high direction and the transition band length W(r) in the high-cut low direction, as well as the 100% step rough estimate Ld0 and Ld under various target mixing ratios. eff The calibration relationship between (r) and k(r).
[0037] Figure 7 This is a front view of a printed sample showing the radial gradient effect according to Embodiment 1 of the present invention, demonstrating the multicolor mixing effect based on the radial gradient function.
[0038] Figure 8 This is a frontal photograph of the internal light transmission effect of a printed sample according to Embodiment 1 of the present invention, showing the light transmission effect of the layer texture as an optical interface.
[0039] Figure 9 This is a front view of the periodic color texture of the printed sample according to Embodiment 2 of the present invention, demonstrating the multicolor mixing effect based on the periodic stripe function.
[0040] Figure 10 The images show calibrated printed samples of different target mixing ratios of the present invention, illustrating the phenomenon that the lag distance ΔL(r) of the transition zone starting point relative to the command switching point shifts backward as the target mixing ratio r decreases. Detailed Implementation
[0041] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0042] For ease of understanding, the symbols used in this specification are explained as follows: Vd is the dead volume of the melt cavity (mm). 3 Q is the melt volume from each feed inlet to the nozzle outlet; Q is the extrusion volume per unit path length (mm). 3 / mm), Q=w×h, w is the line width, h is the layer height; Ld is the delayed extrusion length, Ld=Vd / Q, and its 100% step calibration rough estimate is denoted as Ld0; Ld eff (r) represents the effective delayed extrusion length under the target mixing ratio r, Ld eff (r)≈ΔL(r); T is the starting point of the transition zone. During compensation design, the command switching point is advanced to coincide with the design target position; T′ is the switching point of the color mixing ratio command; T+W is the ending point of the transition zone; ΔL(r) is the lag distance of the starting point of the transition zone relative to the command switching point, ΔL(r)=T-T′, which varies with the target mixing ratio r. The preset offset (reverse advance) of the command switching point is determined according to ΔL(r); W(r) is the length of the transition zone under the target mixing ratio r, which is read with the ratio change of 5% and 95% as thresholds (5%→95% for low-to-high direction, 95%→5% for high-to-low direction); Lt is the preset transition length; Lt0 is the actual length of the transition zone measured by the 100% step calibration printout; k is the transition zone length coefficient. At a 100% step, k0=Lt0 / Ld0, and under the target mixing ratio r, k(r)=W(r) / Ld eff (r); Ve is the cumulative extrusion volume since the proportional switching; W a W b These are the blending ratio vectors before and after the switch; P i Let i be the i-th path point; l i For layer number; Wi Let P be the path point. i The mixing ratio vector; e i v0 is the extrusion rate of the path segment; v0 is the total ex j Let be the extrusion speed of the j-th feed motor.
[0043] I. Specific Implementation of G-code Generation and Color Mixing Control
[0044] The G-code manufacturing instructions of this invention are directly generated by the parametric design platform, and their data organization method is as follows: the manufacturing path is discretized into a sequence of path points {P1, P2, ..., P...}. n}, for each path point P i It must contain at least three-dimensional coordinates (x) i y i , z i ), the corresponding layer number l i And the multicolor material mixing ratio vector W calculated by the mapping function. i = (w 1i w 2i , ..., w mi ), where m is the number of feed channels, and the sum of the weights is 1. The spatial shape of the manufacturing path is determined by the design requirements, including but not limited to concentric circle paths, spiral paths, reciprocating straight line paths, grid-filled paths, and free curve paths; local geometric attributes may also include the curvature of path points, tangential angle, distance to preset reference points or reference lines, etc., to adapt to different mapping function designs.
[0045] Generation of mixing ratio instructions. For multi-feed single-nozzle devices running Marlin firmware and with the mixing extruder (MIXING_EXTRUDER) function enabled, the parametric design platform generates the mixing ratio instruction at path point P. i The following instruction sequence is generated at this location:
[0046] M163 S0 Pw1i; Set the mixing weight of feed channel 1
[0047] M163 S1 Pw2i; Set the mixing weight of feed channel 2
[0048] M163 S2 Pw3i; Set the mixing weight of feed channel 3
[0049] M164 S0; Submit the above weights to the virtual extruder T0
[0050] G1 Xxi Yyi Zzi Eei Ffi ; Perform extrusion movement according to the current mixing ratio
[0051] Among them, extrusion amount e iCalculated based on the length, width, and height of the path segment; the firmware is based on the weight vector W. i Drive each feed stepper motor to ensure that the extrusion speed of each feed motor meets v. j =v0·w ji (v0 is the total extrusion speed), meaning the speed ratio of each feed motor is equal to the ratio of the corresponding weights in the mixing ratio vector, thus achieving real-time mixing of multi-color materials within a single nozzle melting chamber. When the mixing ratio between adjacent path points changes continuously, the M163 / M164 command is inserted point by point along the path, or when the weight change exceeds a preset threshold (e.g., 2%), to achieve dynamic control of the color mixing ratio at each point along the manufacturing path.
[0052] For devices running Klipper firmware, the equivalent implementation is as follows: dynamically modify the rotation distance parameters of each feed motor through macro instructions (such as SET_EXTRUDER_ROTATION_DISTANCE) so that the ratio of the feeding length of each feed motor under a unit extrusion movement command is equal to the weight ratio, thus achieving the speed ratio control equivalent to the above M163 / M164 method.
[0053] In addition to the simultaneous feeding method mentioned above, the color mixing ratio can also be controlled by alternating feeding: at path point P i Instead of directly setting the speed ratio of each feeding motor, the feeding motors are driven alternately at full speed within the path segment corresponding to the path point, according to a preset segment length. For example, first, a length l1 is fed in through the full-speed feeding channel 1, and then a length l2 is fed in through the full-speed feeding channel 2. The ratio of segment lengths l1:l2 is equal to the ratio of the mixing proportion weights. When the preset segment length is not greater than the delayed extrusion length Ld, multiple alternating segments of the two materials exist simultaneously in the melt chamber. The material extruded at the nozzle is a mixture of each material averaged according to the segment length proportion, and its apparent mixing effect is equivalent to the simultaneous feeding method. When the segment length is greater than Ld, a color block effect of alternating pure color segments and transition zones is formed, which is the step switching mode. Therefore, regardless of whether the equipment uses simultaneous feeding or alternating feeding, the proportion of each material in the melt chamber can be controlled by the segment length or speed to achieve the color mixing ratio control of this invention.
[0054] Modeling and presetting of delayed discharge and delayed collection zones. The melt chamber of a multi-feed single-nozzle device has a dead volume Vd, which is the melt volume from each feed inlet point to the nozzle outlet, typically ranging from 50-300 mm². 3 When the mixing ratio is determined by W a Switch to W b At this time, the actual mixing ratio of the extruded material at the nozzle does not follow the command instantaneously, but gradually transitions according to the melt displacement law with the cumulative extrusion volume. The transition process is characterized by the delayed extrusion length Ld = Vd / Q, where Q is the extrusion volume per unit path length (mm). 3 / mm), determined by line width and layer height. This invention models the above physical characteristics as follows: In a parametric design platform, for the target position where the design color changes, the switching point of the color mixing ratio instruction is preset by an offset along the path backward from the target switching position. This preset offset is determined based on Ld (for example, taking Ld, preferably taking the effective delayed extrusion length Ld according to the target mixing ratio r). eff (r) Since the melt in the molten chamber needs to be extruded by approximately Vd before the new proportion of material reaches the nozzle, the starting point of the actual transition zone is located precisely at the target position. The transition zone is naturally formed by the delayed discharge and delayed collection characteristics and is retained as a design element for color transition. In a simplified embodiment, the color mixing ratio command adopts a step-like switching, and the starting point of the transition zone is located only by the preset offset. In a preferred embodiment, the switching method of the ratio command is replaced by a step-like switching method, which is linear along the path length Lt or distributed according to a preset curve, where the transition length Lt≥Ld. Since the rate of change of the command is slower than the physical response capability of melt displacement, the actual extrusion ratio follows the distribution of the command, and the spatial position, length, and shape of the transition zone are all preset. Thus, the natural gradient color mixing produced by delayed discharge and delayed collection becomes a color transition effect with controllable position and controllable length and shape.
[0055] Specifically, the melt replacement process within the molten cavity can be approximated as a continuous replacement model: from the start of the proportion switching, the proportion of the old proportion component in the actual extruded material at the nozzle decreases exponentially with the cumulative extrusion volume Ve, i.e., the actual mixing proportion W(Ve) = W b -(W b -W a )·exp(-Ve / Vd). Based on this model, the actual color mixing ratio at any path position within the transition zone can be calculated, thereby allowing the shape of the color transition zone to be pre-simulated in the parametric design platform. Based on this, the values of the transition start offset and the transition length Lt can be adjusted to ensure that the actual position and length of the transition zone match the design target.
[0056] It should be noted that the length of the transition zone is not equal to Ld: the actual melting cavity has pure transport lag and dispersion effect, and the starting point of the transition zone lags by about Ld relative to the command switching point. After the step switch, the actual ratio asymptotically approaches the target value according to an exponential law. The length of the transition zone depends on the selection of the ratio threshold. Taking the ratio change of 5%-95% as the threshold, the length of the transition zone under a 100% step is about 3Ld. The ratio coefficient k0 = Lt0 / Ld0 is determined by calibration printing. Furthermore, the visible length of the transition zone is also related to the variation range ΔW of the mixing ratio: when the absolute ratio change θ is used as the perception threshold (e.g., θ = 5%), the visible transition zone length is approximately Ld·ln(ΔW / θ). The smaller the variation range of the mixing ratio, the shorter the visible transition zone (e.g., approximately 3Ld when ΔW = 1, approximately 2.3Ld when ΔW = 0.5, and approximately 1.4Ld when ΔW = 0.2). Under the ideal displacement model, the delayed extrusion length Ld is related to the total extrusion flow rate but not to the mixing ratio range. It should be noted that this model is an idealized approximation. In actual measurements, the hysteresis distance ΔL(r) at the starting point of the transition zone and the transition zone length W(r) both vary with the target mixing ratio r. Therefore, the effective delayed extrusion length Ld should be calibrated according to the target mixing ratio r. eff (r)≈ΔL(r) and the proportionality constant k(r)=W(r) / Ld eff (r), preset offset according to Ld eff The value of (r) is determined by k(r)·Ld. eff (r) Prediction. Thus, by setting the range of change in the blending ratio of steps or gradients, the visible length of the color transition band can also be adjusted.
[0057] The dead volume of the melt cavity, Vd, was determined through calibration printing: A 100% step-mixing ratio switching printing was performed using two materials with significantly different colors. The hysteresis distance Ld0 of the transition zone start point relative to the command switching position on the printed part was measured along the path direction and calculated as Vd = Ld0 × Q. The method for reading the start and end points of the transition zone was as follows: The calibration printed sample was placed under a uniform diffused light source and photographed vertically. The grayscale distribution curve along the printing direction was extracted and normalized based on the grayscale values of the stable ratio segments on both sides of the transition zone. The start and end points of the transition zone were read at 5% and 95% thresholds, respectively. Furthermore, calibration printing was performed at multiple target mixing ratios r (e.g., r = 100%, 80%, 60%, 40%, 20%), and the hysteresis distance ΔL(r) = T - T′ of the transition zone start point and the transition zone length W(r) were measured in both low-cut-high and high-cut-low directions to obtain the effective delayed extrusion length Ld. eff (r)≈ΔL(r) and the proportionality constant k(r)=W(r) / Ld eff (r). For example, Figure 10As shown, the transition zone starting point T lags behind the command switching point T′, and the lag distance ΔL(r) shifts backward as the target mixing ratio r decreases. Calibration can be performed separately according to material type and nozzle temperature, and a reference table of material-temperature-target mixing ratio can be established for use when presetting the transition zone.
[0058] Structural parameters of the layered optical interface. In G-code manufacturing instructions, the layered structure is controlled by the layer height h and the path spacing (linewidth) w: the layer height h is, for example, 0.1-0.5 mm, and the path spacing of each layer varies radially or according to a mapping function, so that a layered structure with controllable spacing, thickness, and overlap is formed between adjacent deposited lines; this structure constitutes an interface with periodically changing optical properties in the light-transmitting material, producing superimposed effects of refraction, scattering, and light mixing when light passes through it. The layer spacing and color mixing ratio vector Wi are generated by the same mapping function or interrelated mapping functions, so that the color distribution and the layered optical interface are spatially coordinated.
[0059] II. Example 1: Radial Gradient Printed Sample
[0060] The printed sample is a flat, disc-shaped light-transmitting component, with a diameter of, for example, 200-300 mm, composed of concentric circular layers. The spacing between the layers increases from the inside out, with a spacing of, for example, 0.15-0.25 mm in the central area and a spacing of, for example, 0.3-0.5 mm in the edge area.
[0061] In the Grasshopper parametric platform, a polar coordinate system is established with the component center as the origin, and a radial gradient function is defined. For example:
[0062] R(r) = R0 + (R max -R0)×(r / r max ) n
[0063] Where R(r) is the material proportion at radius r, R0 is the center proportion, and R max denoted as edge ratio, and n as gradient exponent.
[0064] The colors follow this function from the center to the edge. For example, the central area is a warm yellow (material A accounts for 70-90%, material B accounts for 5-15%, and material C accounts for 5-15%), and the edge area is a cyan-green (material A accounts for 5-15%, material B accounts for 50-70%, and material C accounts for 20-40%). The above proportions can be adjusted according to design requirements.
[0065] The light source is placed below the center of the component. When light passes through the layers, the spacing between the layers and the color distribution together determine the shape of the halo. During the deposition and fusion process, the multicolor material forms a micro-striped structure, which works in conjunction with the macro-structure of the layers to produce optical effects of refraction, scattering, and light mixing.
[0066] III. Example 2: Periodic Color Texture Printed Sample
[0067] The printed sample is a cylindrical (cup-shaped) printed sample. In the parametric design platform, a periodic fringe function is defined with the circumferential unfolding distance *u* of the path points and the layer number as independent variables, for example:
[0068] S(u)=A×sin(2π×u / λ+φ)
[0069] Where S(u) is the function value at the circumferential unfolding distance u, A is the amplitude, λ is the period, and φ is the phase. The mixing ratio is determined by binarizing S(u) according to a preset threshold: when the function value is not less than the threshold, the proportion of dark non-transparent material is 100%, and when it is less than the threshold, the proportion of colorless transparent material is 100%. The phase is staggered by half a period every preset number of layers according to the layer number, so that the dark area and the transparent area are alternately distributed along the circumferential and axial directions.
[0070] This creates a checkerboard-like periodic color texture, with a circumferential width of the texture grid of, for example, 4-6 mm and an axial height of, for example, 8-12 mm; the material used is, for example, a combination of dark opaque material, light transparent material and colorless transparent material.
[0071] The preset transition length of the color switching point (determined based on parameters such as the dead volume of the melt cavity, the target mixing ratio, the material viscosity, the nozzle temperature, and the extrusion speed) creates a gradual transition zone at the grid edge, forming a soft boundary; the periodic color texture is superimposed on the FDM layer texture to produce a visual effect of texture within texture.
[0072] IV. Example 3: Custom Mapping Printing Sample
[0073] Building upon Example 1, a custom mapping function is used to define the color distribution. For instance, based on an image or data field specified by the designer, a sampling and interpolation algorithm is used to generate the material mixing ratio at each point, forming an irregular color pattern. The specific form of this function is determined by the design requirements and is not limited to radial gradients or periodic stripes.
[0074] While the colors and patterns are printed, the physical process characteristics of delayed output and delayed retraction are used to create natural gradient color mixing, which is combined with the design pattern to form a controllable color transition effect.
[0075] V. Example 4: Preset Calculation of Color Transition Zone
[0076] This embodiment takes the radially gradient light-transmitting component of Embodiment 1 as an example to illustrate the complete calculation process of the preset transition zone. The following values are all examples, and the actual values are based on the calibration results.
[0077] The first step is dead volume calibration. This is done using two materials with significantly different colors (such as...). Figure 10The calibration samples shown use both dark-colored non-transparent and colorless transparent materials. With a line width of 0.42 mm and a layer height of 0.2 mm, the extrusion volume per unit path length is Q = 0.42 × 0.2 = 0.084 mm². 3 / mm. The color mixing ratio is switched from 100:0 to 0:100 in a step-change manner for calibration printing. The lag distance of the color transition band starting point relative to the step-change position (i.e., the rough estimate Ld0 for a 100% step change) is measured. For example, if it is 240mm, then the dead volume of the melt cavity Vd=Ld0×Q≈20mm. 3 Simultaneously, the actual length Lt0 of the color transition band was measured, for example, to be 710 mm, yielding the proportionality coefficient k0 = Lt0 / Ld0 ≈ 3. Further, using the same method, calibration printing was performed with target mixing ratios r = 80%, 60%, 40%, and 20%, respectively. ΔL(r) and W(r) were measured at each target mixing ratio. It was found that ΔL(r) shifts backward as r decreases (e.g., ...). Figure 10 As shown), during the actual printing, Ld is retrieved according to the target mixing ratio. eff (r)≈ΔL(r) is used as the preset offset, and k(r)=W(r) / Ld is used as the preset offset. eff (r) Estimate the length of the transition zone.
[0078] The second step is to determine the transition zone parameters. When printing the final components using the same process parameters, the lag length at the start of the transition zone is set to Ld based on the target mixing ratio. eff (r) (approximately Ld0 = 240 mm at a 100% step), transition zone length ≈ k(r)·Ld eff (r) (100% step ≈ 710mm). For a disc component with a diameter of 250mm, the maximum circumference of a single concentric circle path is approximately 785mm, meaning that a complete color transition spans approximately one circle of the path, which is comparable to the radial gradient scale required in the design. Therefore, the entire radial gradient area can be designed as a continuous transition area.
[0079] The third step is to set up transition commands. The switching point of the color mixing ratio command is moved back along the path from the target switching position by a preset offset Ld. eff (r) (In this example, Ld0 is taken as 100% step, i.e., 240mm), so that the starting point of the actual transition band is located at the target switching position. When using step switching, the shape of the transition band is naturally formed by the delay characteristics; when it is necessary to preset the transition band shape at the same time, set the transition length Lt = 720mm (satisfying Lt ≥ k(r)·Ld). eff (r), the actual transition zone length is approximately equal to Lt), within the Lt range, the weights of material A and material B are gradually changed from 90:10 to 10:90 in a linear distribution, and the M163 / M164 instructions insert a group for every 2% change in weight.
[0080] The fourth step is rehearsing and refining. Based on the continuous permutation model W(Ve) = W b -(W b -W a The actual color mixing ratio of each path position in the transition zone is calculated by exp(-Ve / Vd) to obtain the spatial distribution of the actual transition zone. If the deviation between the midpoint of the actual transition zone and the design target position exceeds the allowable range (e.g., 10%), the G-code is regenerated after correcting the offset of the transition starting point.
[0081] The position and length of the color transition zone of the components printed through the above steps are preset by the algorithm, rather than passively generated; the consistent position of the transition zone of the same type of component printed multiple times indicates that delayed output and delayed receipt have been incorporated into controllable design variables.
[0082] This invention achieves a unique digital process effect that combines microscopic geometric textures with macroscopic color gradations, which cannot be presented by traditional injection molding, spraying, or single-material 3D printing.
[0083] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A multi-color material algorithm control method based on FDM 3D printing, characterized in that, Includes the following steps: S1: Construct a mathematical model of a three-dimensional spatial manufacturing path in a parametric design platform, and generate path data with location information and local geometric attributes, wherein the local geometric attributes include at least the layer number and the three-dimensional spatial coordinates of the path points; S2: Based on the local geometric properties, the mixing ratio of multi-color materials corresponding to each path point is calculated through a preset mathematical mapping function to form a position-color mapping relationship; S3: The path data and the position-color mapping relationship are directly converted into G-code manufacturing instructions. The conversion is performed by the parametric design platform without going through the automatic processing of general slicing software. The G-code manufacturing instructions include color mixing ratio control instructions. The color mixing ratio control instructions control the feeding of each feeding motor so that the proportion of each material in the melting chamber corresponds to the mixing ratio of the multi-color materials, thereby realizing the real-time mixing of multi-color materials in a single nozzle. S4: Manufacturing is performed by executing the G-code manufacturing instructions through a multi-feed single-nozzle FDM device; wherein, for the target position where the color changes in the design, the delayed extrusion length Ld is determined according to the dead volume of the melt chamber of the multi-feed single-nozzle FDM device, Ld = Vd / Q, where Vd is the melt volume from each feed inlet point to the nozzle outlet, and Q is the extrusion volume per unit path length; the switching point of the color mixing ratio instruction is preset offset in the reverse direction along the manufacturing path from the target position, the preset offset is determined according to Ld, so that the starting point of the natural gradient color mixing transition zone generated by delayed discharge and delayed collection is located at the target position, the transition zone is retained as a design element of color transition, forming a color transition effect with controllable spatial position.
2. The method according to claim 1, characterized in that, The preset mathematical mapping function mentioned in step S2 includes a radial gradient function, a periodic stripe function, a custom mapping function, or a combination thereof.
3. The method according to claim 1, characterized in that, The dead volume Vd of the melt cavity is determined through calibration printing: A 100% step-mixing ratio switching printing is performed using two materials with significantly different colors. The lag distance in the path direction of the transition zone start point relative to the command switching point on the printed part is recorded as Ld0. The dead volume Vd of the melt cavity is calculated as Vd = Ld0 × Q. Furthermore, calibration printing is performed according to multiple target mixing ratios r, and the lag distance ΔL(r) of the transition zone start point relative to the command switching point and the transition zone length W(r) are measured at each target mixing ratio r. The lag distance ΔL(r) is taken as the effective delayed extrusion length Ld. eff (r), and calculate the proportionality coefficient k(r)=W(r) / Ld eff (r); the preset offset is Ld corresponding to the target mixing ratio r. eff (r) Determined.
4. The method according to claim 1, characterized in that, The color mixing ratio control command controls the feeding of each feeding motor in any of the following ways: simultaneous feeding mode, in which each feeding motor is driven simultaneously according to the multi-color material mixing ratio, and the speed ratio of each feeding motor is equal to the ratio of the corresponding weights in the mixing ratio; or alternating feeding mode, in which each feeding motor is driven alternately at full speed according to a preset segment length, and the ratio of the feeding segment lengths of each material is equal to the ratio of the corresponding weights in the mixing ratio, and the preset segment length is not greater than the delayed extrusion length Ld, so that each material is mixed in the melt chamber according to the specified proportion.
5. The method according to claim 1, characterized in that, The mixing ratio instruction is set gradually according to a preset distribution within a preset transition length Lt, where Lt≥3Ld, so that the mixing ratio of the actual extruded material changes according to a preset distribution within the transition zone. The spatial position, length, and shape of the transition zone are all preset.
6. The method according to any one of claims 1 to 5, characterized in that, The method is used for the manufacture of light-transmitting components.
7. A multi-color material algorithm control system based on FDM 3D printing, characterized in that, include: The parametric path generation module is used to construct a mathematical model of a 3D spatial manufacturing path and generate path data in the parametric design platform. The color ratio calculation module is used to calculate the mixing ratio of multi-color materials based on local geometric properties and form a position-color mapping relationship; The G-code compilation module is used to directly generate G-code manufacturing instructions from the path data and position-color mapping relationship, without going through the automatic processing step of general slicing software; A multi-feed single-nozzle FDM printing device is used to receive and execute the G-code manufacturing instructions; The transition zone preset module is used to determine the delayed extrusion length Ld = Vd / Q based on the dead volume of the melt chamber of the equipment for the target position where the color changes in the design. The switching point of the color mixing ratio instruction is preset by an offset in the reverse direction along the manufacturing path. The preset offset is determined based on Ld, so that the starting point of the transition zone for the natural gradient color mixing generated by delayed discharge and delayed collection is located at the target position. The transition zone is retained as a design element for color transition, forming a color transition effect with controllable spatial position.