A 3D printing consumable increment and decrement numerical control instruction verification method based on virtual-real mapping
By using a virtual-real mapping method, the retraction and re-extrusion transition section and the compensation completion position are generated, which solves the problem of inaccurate retraction and re-extrusion compensation position in 3D printing and realizes accurate verification of material offset and traceability of abnormal positions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- YANCHENG CHIANGMAI INFORMATION TECH CO LTD
- Filing Date
- 2026-07-04
- Publication Date
- 2026-08-04
AI Technical Summary
In existing technologies, the position recognition of the retraction and re-extrusion compensation completion in 3D printing is inaccurate, and the offset of virtual and real compensation consumables between the virtual and real sides is difficult to quantitatively verify.
By using a virtual-real mapping method, the 3D printing CNC instruction file and slicing parameter file are read line by line, the feeding mode is identified, the retraction and re-extrusion transition section is generated, the consumable conversion ratio and average deposition cross-sectional area are calculated, the retraction and re-extrusion actions are located, the compensation completion positions of the virtual side and the real side are generated, and the consumable increase/decrease CNC instruction verification information is output.
It achieves precise positioning and clear compensation boundaries for the re-extrusion process, accurately traces abnormal locations, effectively distinguishes the offset of virtual and real compensation consumables, and outputs the minimum modification object.
Smart Images

Figure CN122500951A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of 3D printing verification technology, and in particular to a method for verifying 3D printing consumable addition and subtraction CNC commands based on virtual-real mapping. Background Technology
[0002] Fused deposition modeling (FDM) 3D printing typically involves slicing software generating numerical control (NC) instructions based on the model outline, layer height, line width, and filament parameters. The printing control process coordinates the nozzle movement and filament feeding according to the nozzle coordinates, feed axis values, and motion type specified in the instructions. Routine verification usually revolves around instruction text parsing, path preview, in-layer deposition amount verification, and motion continuity checks. By identifying the solid deposition path, empty movement path, retraction action, and re-extrusion action, it is determined whether the printing path and filament supply relationship conform to the slicing settings.
[0003] In refined verification scenarios, conventional methods still have room for improvement in two aspects. On the one hand, the re-extrusion compensation after retraction is usually judged based on the preset command range or the feeding increment. It is difficult to accurately locate whether the compensation completion position extends to the first physical deposition path after the empty movement. On the other hand, there is no correspondence between the feeding compensation state calculated on the virtual side and the cumulative displacement of feeding and the actual position of the nozzle on the real side. It is difficult to quantitatively distinguish whether the actual feeding is ahead or behind the command compensation process. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides a method for verifying the numerical control instructions for adding or removing 3D printing consumables based on virtual-real mapping, which solves the problems of inaccurate identification of the completed position of retraction and extrusion compensation in the prior art and the difficulty in quantitatively verifying the offset of virtual-real compensation consumables between the virtual and real sides.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0007] This invention provides a method for verifying 3D printing consumable addition / reduction CNC instructions based on virtual-real mapping, comprising: reading the 3D printing CNC instruction file and slicing parameter file line by line, identifying the feeding mode, determining the change in the feeding axis, establishing a virtual path segment based on the nozzle coordinate change, locating the retraction action, tracking the empty movement path, the re-extrusion action, and the first solid deposition path after the empty movement, merging the closing path before the empty movement, and generating a retraction-re-extrusion transition segment; establishing a printing layer path list based on the virtual path segment and the retraction-re-extrusion transition segment, marking the transition coverage path, screening ordinary deposition paths, calculating the consumable conversion ratio, generating a consumable conversion benchmark, calculating the average deposition cross-sectional area based on the ordinary deposition path, generating the ordinary deposition cross-sectional area, and obtaining the resolvable consumable amount; extracting the retraction action based on the retraction-re-extrusion transition segment, calculating the retraction amount, and determining the re-extrusion. The system compensates for the search range and accumulates the forward feed amount. It then matches the accumulated forward feed amount with the retraction amount to the initial reach relationship, generating a compensation completion instruction number. Based on the accumulated forward feed amount before the compensation completion instruction number, it generates the position ratio of the virtual side retraction compensation completion position in the path corresponding to the compensation completion instruction, calculates the cumulative path coordinates of the virtual side retraction compensation completion position, and generates the virtual side compensation completion status. It collects the actual cumulative displacement of the feed, the current position of the nozzle, and the current execution instruction line number to establish an actual sampling sequence. Based on the actual sampling sequence and the retraction amount, it determines the actual side retraction compensation completion time, generates the actual side retraction compensation completion position, calculates the virtual and actual compensation consumable offset, and combines the distinguishable consumable amount and the virtual side compensation completion status to obtain the verification classification. It then outputs the consumable increase / decrease CNC instruction verification information and the minimum modification object.
[0008] As a preferred embodiment of the 3D printing consumable addition / reduction CNC instruction verification method based on virtual-real mapping described in this invention, the generation of the retraction and re-extrusion transition section includes: reading the 3D printing CNC instruction file and slicing parameter file line by line, extracting the nozzle target coordinates, feeding axis values, feeding mode, feeding axis zeroing mark, layer number, layer height, line width, consumable diameter, and motion type to form an instruction record sequence arranged in execution order; performing feeding mode recognition, feeding axis zeroing disconnection, and feeding axis change calculation on the instruction record sequence; marking the forward feeding action, retraction action, and empty movement path according to the feeding axis change; generating virtual path segments and path cumulative coordinates according to the nozzle coordinate change; locating the retraction action according to the virtual path segments and path cumulative coordinates; tracing the empty movement path, re-extrusion action, and the first solid deposition path after empty movement backward; merging the closing path before empty movement forward; and generating the retraction and re-extrusion transition section.
[0009] As a preferred embodiment of the 3D printing consumable addition / reduction CNC instruction verification method based on virtual-real mapping described in this invention, the screening of ordinary deposition paths includes: arranging virtual path segments within the same printing layer according to the instruction execution order, establishing a printing layer path list, reading the retraction and re-extrusion transition segment, marking the transition coverage path corresponding to the pre-emptive movement finishing path, retraction action, empty movement path, re-extrusion action, and the first solid deposition path after empty movement in the printing layer path list, excluding transition coverage paths, and screening ordinary deposition paths.
[0010] As a preferred embodiment of the 3D printing consumable addition / reduction CNC instruction verification method based on virtual-real mapping described in this invention, the generation of consumable conversion benchmark includes: calculating the consumable conversion ratio based on the positive change of the feed axis of the ordinary deposition path, the cumulative coordinates of the starting path, the cumulative coordinates of the ending path, the line width, and the layer height; arranging all consumable conversion ratios within the same printing layer in ascending order of value; extracting the representative feed conversion relationship of the current printing layer based on the median position of the consumable conversion ratio; and generating the consumable conversion benchmark.
[0011] As a preferred embodiment of the 3D printing consumable addition / reduction CNC instruction verification method based on virtual-real mapping described in this invention, the step of obtaining the resolvable consumable quantity includes: calculating the average deposition cross-sectional area based on the cumulative coordinates of the starting path, the cumulative coordinates of the ending path, the line width, and the layer height of the ordinary deposition path; arranging all the average deposition cross-sectional areas within the same printing layer in ascending order of value; generating the ordinary deposition cross-sectional area based on the median position of the average deposition cross-sectional area; reading the decimal places of the feed axis value and the nozzle coordinates in the 3D printing CNC instruction; and combining the consumable conversion reference and the ordinary deposition cross-sectional area to generate the resolvable consumable quantity.
[0012] As a preferred embodiment of the 3D printing consumable addition / reduction CNC instruction verification method based on virtual-real mapping described in this invention, the calculation of the retraction amount includes: reading the retraction action, the empty movement path, the re-extrusion action, the first solid deposition path after the empty movement, and the corresponding instruction line number according to the retraction and re-extrusion transition section number, and performing the inverse accumulation of the feed axis change amount for the retraction action to generate the retraction amount.
[0013] As a preferred embodiment of the 3D printing consumable addition / reduction CNC instruction verification method based on virtual-real mapping described in this invention, the generation of compensation completion instruction number includes: reading the forward feeding instruction from the start of the re-extrusion action to the end of the first solid deposition path after the empty movement, generating the re-extrusion compensation search range, accumulating the feed axis change amount of the forward feeding instructions within the re-extrusion compensation search range according to the execution order, generating the cumulative forward feeding amount, matching the cumulative forward feeding amount with the first-reach relationship with the retraction amount, and generating the compensation completion instruction number.
[0014] As a preferred embodiment of the 3D printing consumable addition / reduction CNC instruction verification method based on virtual-real mapping described in this invention, the generation of virtual side compensation completion status includes: reading the cumulative forward feed amount before the compensation completion instruction number, combining the retraction amount and the feed axis change amount of the compensation completion instruction, and generating the position ratio of the virtual side retraction compensation completion position in the path corresponding to the compensation completion instruction; reading the cumulative coordinates of the starting path and the cumulative coordinates of the ending path of the virtual path segment corresponding to the compensation completion instruction, combining the position ratio of the virtual side retraction compensation completion position in the path corresponding to the compensation completion instruction, and generating the path cumulative coordinates of the virtual side retraction compensation completion position; and generating the virtual side compensation completion status according to the path attribute to which the compensation completion instruction belongs. The virtual side compensation completion status includes compensation completed within re-extrusion, compensation completed within printing start, and compensation not completed.
[0015] As a preferred embodiment of the 3D printing consumable addition / reduction CNC instruction verification method based on virtual-real mapping described in this invention, the generation of the real-side retraction compensation completion position includes: collecting the real cumulative displacement of the material feed, the current position of the nozzle, and the current execution instruction line number; filtering real sampling records according to the instruction line number range of the retraction and re-extrusion transition section; sorting them by sampling time to generate a real sampling sequence; based on the real sampling sequence and the retraction amount, calculating the real forward material feed amount of each sampling record relative to the starting point of the re-extrusion action; comparing the real forward material feed amount and the retraction amount in ascending order of sampling time; finding the adjacent sampling record that first reaches the retraction amount; generating the real-side retraction compensation completion time; synchronously interpolating the current position of the nozzle using the sampling records before and after the real-side retraction compensation completion time to generate the real-side retraction compensation completion position; matching the virtual path segment according to the current execution instruction line number; and projecting the real-side retraction compensation completion position as the path cumulative coordinates.
[0016] As a preferred embodiment of the 3D printing consumable addition / reduction CNC instruction verification method based on virtual-real mapping described in this invention, the output of consumable addition / reduction CNC instruction verification information and minimum modification object includes: reading the virtual side retraction compensation completion position, the real side retraction compensation completion position, consumable conversion reference, line width, and layer height; calculating the virtual-real compensation consumable offset; obtaining the verification classification based on the virtual-real compensation consumable offset, the distinguishable consumable quantity, and the virtual side compensation completion status; and outputting consumable addition / reduction CNC instruction verification information and minimum modification object.
[0017] The beneficial effects of this invention are as follows: By generating a pullback and re-extrusion transition section, the pre-emptive migration path, pullback action, empty migration path, re-extrusion action, and the first solid deposition path after empty migration are organized into continuous verification objects, realizing the positioning of the cross-command consumable compensation chain and clarifying the compensation boundary of the pullback and re-extrusion process; by generating a virtual side compensation completion status and generating a real side pullback compensation completion position, the virtual side compensation position and the real side feeding position are mapped to a unified path scale, combined with the distinguishable consumable quantity, outputting consumable increase / decrease CNC command verification information and minimum modification object, realizing effective identification of virtual and real compensation consumable offset, accurate tracing of abnormal positions, and more concentrated minimum modification objects. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart of a method for verifying CNC commands for adding or removing 3D printing consumables based on virtual-real mapping.
[0020] Figure 2 A flowchart for generating the retraction and re-extrusion transition section.
[0021] Figure 3 A flowchart for obtaining a distinguishable amount of consumables.
[0022] Figure 4 This is a flowchart for verifying the virtual-to-real mapping. Detailed Implementation
[0023] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0024] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0025] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0026] Reference Figures 1-4 This is one embodiment of the present invention, which provides a method for verifying NC commands for adding or removing 3D printing consumables based on virtual-real mapping, including the following steps:
[0027] S1. Read the 3D printing CNC instruction file and slicing parameter file line by line, identify the feeding mode, determine the amount of change of the feeding axis, establish a virtual path segment according to the change of the nozzle coordinate, locate the retraction action, track the empty movement path, the re-extrusion action and the first solid deposition path after the empty movement, merge it forward into the closing path before the empty movement, and generate the retraction and re-extrusion transition section.
[0028] The system reads the 3D printing CNC instruction file and slicing parameter file line by line, extracting the nozzle target coordinates, feed axis values, feed mode, feed axis zeroing mark, layer number, layer height, line width, consumable diameter, and motion type to form an instruction record sequence arranged in execution order. It then performs feed mode recognition, feed axis zeroing disconnection, and feed axis change calculation on the instruction record sequence. Based on the feed axis change, it marks the forward feed action, retraction action, and idle movement path. Finally, based on the nozzle coordinate changes, it generates virtual path segments and cumulative path coordinates.
[0029] Furthermore, obtain the 3D printing CNC instruction file to be verified and the slicing parameter file corresponding to the CNC instruction. The slicing parameters include layer height, line width, and filament diameter.
[0030] Read the instruction content line by line according to the original line order of the CNC instruction file, and create an instruction record for each line of instruction. Each instruction record stores the instruction line number, nozzle target coordinates, feed axis value, feed mode, feed axis zeroing mark, layer number, layer height, line width, and motion type.
[0031] It should be noted that during the line-by-line reading process, if the current line contains the nozzle target coordinates, the nozzle target coordinates are written into the current instruction record; if the current line does not contain the nozzle target coordinates, the nozzle coordinates of the previous valid motion instruction are used; if the current line contains the feed axis value, the feed axis value is written into the current instruction record; if the current line does not contain the feed axis value, the current line is recorded as not generating a new feeding action, and the previous feed axis value is not repeatedly recognized as the current feeding action; thus forming an instruction record sequence arranged in the execution order.
[0032] Furthermore, the feeding mode is identified; specifically, the absolute feeding mode and relative feeding mode in the CNC instructions are saved as two states.
[0033] Specifically, when a feeding mode switching instruction is read, the current feeding mode is updated to the mode specified by the switching instruction. The mode specified by the switching instruction remains in effect, and subsequent instructions directly use it until the feeding mode switching instruction is read again. When a feeding axis zeroing instruction is read, the last valid feeding axis value before zeroing is disconnected from the first valid feeding axis value after zeroing. The zeroing instruction is only used to update the starting point of the feeding axis count and is not used as a retraction action or a re-extrusion action.
[0034] Furthermore, after forming a continuous feeding interval, the change in the feeding axis for each valid feeding instruction is determined.
[0035] Specifically, for absolute feeding mode, the change in the current feeding axis is obtained by subtracting the value of the previous valid feeding axis within the same continuous feeding interval from the current valid feeding axis value; for relative feeding mode, the current valid feeding axis value is directly used as the change in the current feeding axis.
[0036] It should be noted that when the change in the feed axis is positive, the instruction is recorded as a positive feed action; when the change in the feed axis is negative, the instruction is recorded as a retraction action; when the change in the feed axis is zero and the nozzle coordinate changes, the instruction is recorded as an idle movement path; when the change in the feed axis is zero and the nozzle coordinate does not change, the instruction line number in the instruction recording sequence is retained as the basis for the original line sequence continuity and the basis for instruction line number tracing; instructions with zero change in the feed axis and no change in the nozzle coordinate do not generate virtual path segments, are not marked as path attributes, and are not included in path cumulative coordinate calculation, retraction and re-extrusion transition section construction, printing layer path list establishment, ordinary deposition path screening, consumable conversion benchmark calculation, and ordinary deposition cross-sectional area calculation.
[0037] Furthermore, virtual path segments are established based on the changes in nozzle coordinates.
[0038] Specifically, a virtual path segment is formed by taking the nozzle coordinates of adjacent valid motion commands as the start and end points. Each virtual path segment stores the corresponding command line number, start coordinates, end coordinates, layer number, layer height, line width, consumable diameter, feed axis change amount, and path attributes.
[0039] It should be noted that if the nozzle coordinates change and the change in the feed axis is positive, the virtual path segment will be marked as a solid deposition path; if the nozzle coordinates change and the change in the feed axis is zero, the virtual path segment will be marked as an idle movement path; if the change in the feed axis is negative, the corresponding instruction will be marked as a retraction action.
[0040] After completing the retraction action and the identification of the empty movement path, starting from the first forward feeding instruction after the end of the empty movement path, the forward feeding amount is accumulated according to the order of instruction execution, and the forward feeding instructions participating in the accumulation are included in the re-extrusion action; when the accumulated forward feeding amount first reaches the retraction amount formed by the retraction action, the forward feeding instruction that first reaches the retraction amount is taken as the end instruction of the re-extrusion action.
[0041] It should be noted that if the cumulative positive feed amount has not reached the retraction amount before the end of the first solid deposition path after the empty movement, all positive feed instructions from the first positive feed instruction after the end of the empty movement path to the end of the first solid deposition path after the empty movement will be included in the re-extrusion action, and the retraction and re-extrusion transition section will be marked as incomplete compensation; after the re-extrusion action is completed and included, the remaining solid deposition path after the re-extrusion action will be used as the subsequent effective deposition path for verification.
[0042] Furthermore, while establishing virtual path segments, cumulative path coordinates are generated according to the execution order.
[0043] Specifically, the starting position of the printout is used as the starting point of the path cumulative coordinates. For each new virtual path segment, the ending path cumulative coordinates of the previous virtual path segment are used as the starting path cumulative coordinates of the current virtual path segment. Based on the spatial distance between the starting and ending coordinates of the current virtual path segment, the ending path cumulative coordinates of the current virtual path segment are generated.
[0044] Based on the virtual path segment and the cumulative coordinates of the path, the pullback action is located, the evacuation path, the re-squeezing action and the first solid deposition path after the evacuation are traced backward, and the end path before the evacuation is merged forward to generate the pullback and re-squeezing transition section.
[0045] Furthermore, after completing the construction of the virtual path segment, the pullback action is located.
[0046] Specifically, the instruction recording sequence is scanned from front to back, and the instruction where the change in the feed shaft is negative for the first time is determined as the starting point of the retraction action in the retraction and re-extrusion transition section.
[0047] It should be noted that if multiple commands with negative changes in the feed shaft occur consecutively, the multiple consecutive retraction actions will be merged into the same retraction and re-extrusion transition section.
[0048] Furthermore, by tracing the vacancy path backward, specifically, after the pullback action, the virtual path segment is read, and the vacancy path before the first physical deposition path appears after the vacancy is sequentially incorporated into the pullback and re-squeezing transition section.
[0049] It should be noted that if no empty movement path appears after the pullback action, but a forward feeding action occurs, the pullback and re-extrusion transition section will still be retained, and the empty movement path will be recorded as empty so as to identify subsequent abnormal command connection.
[0050] Furthermore, the re-extrusion action is traced back. Specifically, the instruction record is read again after the empty-shift path, and the forward feeding action that occurs before the first solid deposition path after the empty-shift is classified as a re-extrusion action. If the forward feeding action extends to the beginning of the first solid deposition path after the empty-shift, the beginning part is still classified as the same re-extrusion action, because the forward feeding in the beginning part may still be used to offset the previous pullback. If the re-extrusion action consists of multiple consecutive forward feeding instructions, they are all classified as the same re-extrusion action according to the execution order.
[0051] Furthermore, the first solid deposition path after the empty movement is determined. Specifically, the solid deposition path where the first nozzle coordinate changes and the feed axis change is positive after the empty movement path is determined as the first solid deposition path after the empty movement.
[0052] It should be noted that the first solid depositional path is not directly equivalent to the effective depositional starting point, because the initial part of the first solid depositional path may still be occupied by re-squeezing action to compensate for the preceding pullback.
[0053] Furthermore, the virtual path segments are merged forward into the pre-emptive migration path. Specifically, the adjacent virtual path segments are checked forward from the starting point of the retraction action. If the adjacent virtual path segments are solid deposition paths and the retraction action or empty migration path is directly entered after the solid deposition path, the adjacent virtual path segments are marked as pre-emptive migration paths and included in the same retraction and re-extrusion transition section.
[0054] It should be noted that the starting coordinates of the pre-shift closing path are the starting coordinates of the adjacent virtual path segment, the ending coordinates of the pre-shift closing path are the ending coordinates of the adjacent virtual path segment, the cumulative coordinates of the starting path of the pre-shift closing path are the cumulative coordinates of the starting path of the adjacent virtual path segment, the cumulative coordinates of the ending path of the pre-shift closing path are the cumulative coordinates of the ending path of the adjacent virtual path segment, and the instruction line number of the pre-shift closing path is the instruction line number corresponding to the adjacent virtual path segment.
[0055] It should be noted that if there is no solid deposition path before the pullback action, or if there are other unrelated paths between the previous solid deposition path and the current pullback action, then it will not be included in the pre-emptive migration closing path.
[0056] After tracking is completed, a pullback and re-extrusion transition section is generated. Each pullback and re-extrusion transition section record includes the transition section number, printing layer, end path before empty migration, pullback action, empty migration path, re-extrusion action, first solid deposition path after empty migration, the instruction line number contained therein, the change in the feed axis corresponding to each instruction, the cumulative coordinates of the starting path of each path segment, and the cumulative coordinates of the ending path.
[0057] It should be noted that if a certain pullback and re-squeezing transition section lacks a re-squeezing action, a pullback and re-squeezing transition section will still be generated, and the re-squeezing action will be marked as missing; if the first solid deposition path after the empty shift is missing, the first solid deposition path after the empty shift will be marked as missing; the missing record is used for subsequent output of corresponding verification information, and the abnormal chain will not be discarded.
[0058] Instead of judging pullback or re-squeezing based on a single instruction, the process organizes the pre-drift closing path, pullback action, drift path, re-squeezing action, and the first solid deposition path after drift into a single pullback-re-squeezing transition section. By constructing continuous objects, it becomes possible to determine whether the re-squeezing action truly compensates for the preceding pullback action, and further determine whether the compensation completion location intrudes into the first solid deposition path after drift.
[0059] S2. Based on the virtual path segment and the retraction and re-extrusion transition segment, establish a list of printing layer paths, mark the transition coverage path, filter the ordinary deposition path, calculate the consumable conversion ratio, generate the consumable conversion benchmark, calculate the average deposition cross-sectional area based on the ordinary deposition path, generate the ordinary deposition cross-sectional area, and obtain the resolvable consumable amount.
[0060] The virtual path segments within the same printing layer are arranged according to the order of instruction execution to create a printing layer path list. The retraction and re-extrusion transition segment is read, and the transition coverage path corresponding to the pre-emptive movement finishing path, retraction action, empty movement path, re-extrusion action, and the first solid deposition path after empty movement is marked in the printing layer path list. The transition coverage path is excluded, and the ordinary deposition path is selected. Based on the positive change of the feed axis, the cumulative coordinates of the starting path, the cumulative coordinates of the ending path, the line width, and the layer height of the ordinary deposition path, the consumable conversion ratio is calculated. All consumable conversion ratios within the same printing layer are arranged in ascending order of value. The representative feed conversion relationship of the current printing layer is extracted based on the median position of the consumable conversion ratio to generate the consumable conversion benchmark.
[0061] Furthermore, all virtual path segments are categorized according to the printing layer, so that virtual path segments within the same printing layer are arranged according to the order of instruction execution.
[0062] Furthermore, for each print layer, a print layer path list is created.
[0063] Specifically, each item in the print layer path list includes the instruction line number, path attributes, cumulative coordinates of the starting path, cumulative coordinates of the ending path, feed axis change, line width, and layer height.
[0064] Furthermore, in each printed layer path list, the pullback and re-extrusion transition section is read; the instruction line number corresponding to the pre-drift finishing path, pullback action, drift path, re-extrusion action, and the first solid deposition path after drift in the pullback and re-extrusion transition section is marked as the transition coverage path.
[0065] Furthermore, exclude all transitional overlay paths from the print layer path list.
[0066] Furthermore, from the list of printed layer paths after excluding transitional coverage paths, each virtual path segment is examined, and virtual path segments that simultaneously meet the following conditions A1-A4 are identified as ordinary deposition paths:
[0067] A1. The nozzle coordinates have shifted.
[0068] A2, the path attribute is entity deposition path.
[0069] A3. The change in the feed shaft is positive.
[0070] A4. The virtual path segment was not marked as a transitional overlay path.
[0071] For multiple consecutive ordinary deposition paths, each virtual path segment is retained separately and not merged into a longer path.
[0072] Furthermore, for a typical deposition path, the positive change in the feed axis, the cumulative coordinates of the starting path, the cumulative coordinates of the ending path, the line width, and the consumable conversion ratio are read, and the consumable conversion ratio is calculated.
[0073] Specifically, the consumable conversion ratio is expressed as:
[0074] ;
[0075] in, Indicates the first The first printed layer The consumable conversion ratio for a typical deposition path, in units of length / volume. Indicates the print layer number. Indicates the ordinary sedimentary path number, Indicates the first The first printed layer The positive change in the feed axis of a typical deposition path, with the dimension of length. This represents the cumulative coordinates of the path, measured in units of length. Indicates the first The first printed layer The cumulative coordinates of the starting path of a typical sedimentary path, in units of length. Indicates the first The first printed layer The cumulative coordinates of the ending path of a typical sedimentation path, in units of length. Represents the cumulative coordinates of the path The line width at that point is measured in units of length. Represents the cumulative coordinates of the path The floor height at that location is measured in units of length and is indicated by a superscript. Indicates the start, superscript This indicates the end.
[0076] It should be noted that the denominator in the consumable conversion ratio formula is the virtual deposition volume corresponding to the ordinary deposition path, and the numerator is the positive change of the feed axis in the CNC instruction for the same ordinary deposition path; the consumable conversion ratio is used to characterize the feed axis length corresponding to a unit virtual deposition volume in the current printing layer, and is a consumable conversion relationship derived from the internal data of the CNC instruction.
[0077] The virtual deposition volume is calculated by using path cumulative coordinate integration, which can accommodate changes in line width, layer height, and local compensation of the slicer within the same printing layer. The consumable conversion ratio is in the dimension of length / volume, and can be converted into the feed shaft length when combined with the virtual deposition volume. It can be used for consumable compensation verification in the re-extrusion transition section.
[0078] Furthermore, all consumable conversion ratios within the printing layer are arranged in ascending order of value, and the median method is used to determine the consumable conversion benchmark, so as to avoid the dominance of a single short path or local compensation path on the printing layer benchmark.
[0079] Specifically, the consumable conversion benchmark is expressed as follows:
[0080] ;
[0081] in, Indicates the first The consumable conversion standard for each printing layer is measured in units of length / volume. Indicates the first The consumable conversion ratio within each printing layer, arranged in ascending order of value, is the [number]th [number]. Consumable conversion ratio, Indicates the first The consumable conversion ratio within each printing layer, arranged in ascending order of value, is the [number]th [number]. Consumable conversion ratio, Indicates the first Number of common deposition paths within each printed layer Indicates the median position number. Indicates the first Consumable conversion benchmark for each printing layer Indicates the diameter of the consumable, with the dimension of length, and the subscript. This refers to consumables.
[0082] It should be noted that when a normal deposition path exists within the printed layer, the consumable conversion benchmark is derived from the normal deposition path within the current printed layer; when no normal deposition path exists within the current printed layer and the current printed layer is not the first printed layer, the consumable conversion benchmark is adopted from the previous printed layer that has been calculated; when no normal deposition path exists in the first printed layer, the consumable conversion benchmark is determined by the reciprocal of the cross-sectional area corresponding to the consumable diameter.
[0083] The median method is used to determine the consumable conversion baseline because ordinary deposition paths may contain short paths, thin-wall compensation paths, or local linewidth correction paths. The median method can extract representative feed conversion relationships from the set of ordinary deposition paths in the same layer, avoiding the use of the averaging method where a single abnormal path changes the baseline of the entire layer. In the third scenario, the current printed layer has no ordinary deposition path and is not the first printed layer. The previous printed layer, which has already completed calculations, has formed the consumable conversion baseline through ordinary deposition paths. Using the previous printed layer, which has already completed calculations, ensures the continuity of data sources. In the fourth scenario... When the first printed layer does not have a normal deposition path, the inverse of the consumable cross-sectional area corresponding to the consumable diameter is used to form the initial consumable conversion benchmark. Specifically, the feed axis value represents the length of the consumable entering the nozzle, and the consumable diameter determines the consumable volume corresponding to a unit feed axis length. When there is no normal deposition path available for back-calculation in the first printed layer, the feed axis length corresponding to a unit virtual deposition volume can only be determined by the relationship between the length and volume of the consumable itself. The inverse of the consumable cross-sectional area is used as the initial consumable conversion benchmark. When subsequent printed layers form normal deposition paths, the consumable conversion benchmark is re-calculated using the normal deposition paths of subsequent printed layers.
[0084] Based on the cumulative coordinates of the starting path, the cumulative coordinates of the ending path, the line width, and the layer height of the ordinary deposition path, the average deposition cross-sectional area is calculated. All average deposition cross-sectional areas within the same printing layer are arranged in ascending order of value. The ordinary deposition cross-sectional area is generated based on the median position of the average deposition cross-sectional area. The decimal places of the feed axis value and the nozzle coordinates in the 3D printing CNC command are read, and the recognizable consumable quantity is generated by combining the consumable conversion benchmark and the ordinary deposition cross-sectional area.
[0085] Furthermore, after obtaining the consumable conversion benchmark, a common deposition cross-sectional area is generated based on the common deposition path.
[0086] Specifically, first for the first The first printed layer The average sedimentary cross-sectional area is calculated from the average sedimentary path, and the average sedimentary cross-sectional area is expressed as:
[0087] ;
[0088] in, Indicates the first The first printed layer The average sedimentary cross-sectional area of a typical sedimentary path, with the dimension of area.
[0089] It should be noted that the numerator in the formula for average sediment cross-sectional area is the first... The first printed layer The virtual sedimentary volume corresponding to each ordinary sedimentary path, with the denominator being the first... The first printed layer The path length corresponding to each ordinary deposition path is such that the dimension of the average deposition cross-sectional area is area; the average deposition cross-sectional area is used to describe the cross-sectional size of the ordinary deposition path within the current printing layer, and is used to convert the decimal precision of the nozzle coordinates into the equivalent consumable length.
[0090] Then the first The average deposition cross-sectional area within each printed layer is arranged in ascending order of value to determine the ordinary deposition cross-sectional area.
[0091] Specifically, the cross-sectional area of ordinary sediments is expressed as:
[0092] ;
[0093] in, Indicates the first The typical deposition cross-sectional area of a printed layer, in units of area. Indicates the first The first layer is arranged in ascending order of average deposition cross-sectional area within each printed layer. A number, Indicates the first The first layer is arranged in ascending order of average deposition cross-sectional area within each printed layer. A number, Indicates the first The typical deposition cross-sectional area of each printed layer Indicates the first Cumulative coordinates of the starting path of the first solid deposition path within each printed layer. Represents the cumulative coordinates of the path Line width at the location, Represents the cumulative coordinates of the path The floor height at that location, superscript Indicates the reference starting point.
[0094] It should be noted that the ordinary deposition cross-sectional area does not change the consumable conversion benchmark, but is used to convert the path cumulative coordinate resolution into consumable quantity resolution.
[0095] The median method is used to determine the cross-sectional area of ordinary sedimentation because line width, layer height, and local compensation paths can cause differences in the cross-sectional area of different ordinary sedimentation paths. The median method can form a representative cross-sectional area within the same layer. When the current printing layer has no ordinary sedimentation path and is not the first printing layer, the ordinary sedimentation cross-sectional area of the previous printing layer is used to ensure the continuity of the calculation of resolvable consumables. When the first printing layer has no ordinary sedimentation path, the line width and layer height at the cumulative coordinates of the starting path of the first solid sedimentation path in the printing layer are used to form the ordinary sedimentation cross-sectional area.
[0096] Furthermore, read all the feed axis values in the 3D printing CNC instruction to be verified, and count the maximum number of significant decimal places in the feed axis values, which is recorded as the number of decimal places of the feed axis value.
[0097] For example, if the feed axis value has both three and five decimal places, then the feed axis value has five decimal places. The number of decimal places in the feed axis value is used to represent the smallest distinguishable numerical unit that the feed axis length can be expressed in the CNC instruction. The more decimal places in the feed axis value, the higher the accuracy of the feed axis length expression.
[0098] Furthermore, read all nozzle horizontal coordinates, nozzle vertical coordinates, and nozzle height coordinates from the 3D printing CNC instruction to be verified, and count the maximum number of significant decimal places in each of the three coordinate directions, which are recorded as the number of decimal places for the horizontal coordinate, the vertical coordinate, and the height coordinate, respectively.
[0099] It should be noted that the number of decimal places in the nozzle coordinates is used to represent the smallest discernible positional unit that the endpoint coordinates of the virtual path segment can express; by counting the number of decimal places in the three coordinate directions respectively, the differences in the expression precision of the horizontal, vertical and height coordinates in the CNC instructions can be preserved.
[0100] Furthermore, based on the decimal places of the feed axis value, the decimal places of the nozzle coordinates, the consumable conversion base, and the normal deposition cross-sectional area, the resolvable consumable amount of the printed layer is calculated:
[0101] ;
[0102] in, Indicates the first The resolvable amount of filament per printed layer, measured in length. This indicates the maximum number of significant decimal places for the feed axis value in the 3D printing CNC instruction to be verified. Indicates the first The consumable conversion standard for each printing layer is measured in units of length / volume. This indicates the maximum number of significant decimal places for the nozzle's lateral coordinate in the 3D printing CNC command to be verified. This indicates the maximum number of significant decimal places in the nozzle longitudinal coordinate of the 3D printing CNC instruction to be verified. This indicates the maximum number of significant decimal places for the nozzle height coordinate in the 3D printing CNC instruction to be verified.
[0103] It should be noted that the resolvable consumable quantity is determined by the greater of two types of collectable precision. Specifically, one type is the decimal precision of the feed axis value itself, and the other type is the consumable length calculated by converting the nozzle coordinates decimal precision into the ordinary deposition cross-sectional area and the consumable conversion benchmark. The first term in the resolvable consumable quantity formula... The first item represents the minimum feed axis length that can be expressed by the numerical text of the feed axis; the square root part in the second item represents the minimum spatial displacement that can be expressed by the nozzle coordinate text. The ordinary deposition cross-sectional area converts the minimum spatial displacement into the minimum virtual deposition volume, and the consumable conversion benchmark converts the minimum virtual deposition volume into the feed axis length. The larger of the two items is taken because when the offset of the virtual and real compensation consumable is less than the consumable quantity corresponding to any data expression precision, it is impossible to stably distinguish it in CNC instructions and path cumulative coordinates.
[0104] S3. Based on the retraction and re-extrusion transition section, extract the retraction action, calculate the retraction amount, determine the re-extrusion compensation search range and accumulate the forward feed amount, match the accumulated forward feed amount with the retraction amount for the first time, generate a compensation completion instruction number, generate the position ratio of the virtual side retraction compensation completion position in the path corresponding to the compensation completion instruction based on the accumulated forward feed amount before the compensation completion instruction number, calculate the cumulative path coordinates of the virtual side retraction compensation completion position, and generate the virtual side compensation completion status.
[0105] According to the number of the pullback and re-extrusion transition section, read the pullback action, the empty-movement path, the re-extrusion action, the first solid deposition path after the empty-movement, and the corresponding instruction line number. Accumulate the feed axis change for the pullback action by taking the opposite value, and generate the pullback amount. Read the forward feed instruction from the start of the re-extrusion action to the end of the first solid deposition path after the empty-movement, and generate the re-extrusion compensation search range. Accumulate the feed axis change for the forward feed instructions within the re-extrusion compensation search range according to the execution order, and generate the cumulative forward feed amount. Match the cumulative forward feed amount with the pullback amount to the first reach relationship, and generate the compensation completion instruction number.
[0106] Furthermore, the system receives the changes in the feed shaft, the virtual path segment, the cumulative coordinates of the path, and the retraction and re-extrusion transition segment. The retraction and re-extrusion transition segment is read one by one according to its number. Each retraction and re-extrusion transition segment includes the retraction action, the empty movement path, the re-extrusion action, the first solid deposition path after the empty movement, and the corresponding instruction line number.
[0107] Furthermore, the pullback action in the current pullback-re-squeeze transition section is read; if there is no pullback action in the current pullback-re-squeeze transition section, the current pullback-re-squeeze transition section will not enter the virtual side pullback compensation completion position positioning; if there is a pullback action but no re-squeeze action in the current pullback-re-squeeze transition section, the virtual side compensation completion status is marked as incomplete compensation, and the instruction line number corresponding to the pullback action is retained for subsequent verification information output.
[0108] Furthermore, the change in the feed shaft corresponding to all pullback actions within the current pullback and re-extrusion transition section is read. Since the change in the feed shaft corresponding to the pullback action is negative, the change in the feed shaft of all pullback actions is inverted and accumulated to obtain the pullback amount. The pullback amount represents the negative change in the feed shaft that the re-extrusion action needs to offset.
[0109] Furthermore, starting from the re-extrusion action in the current re-extrusion transition section, the forward feeding instructions are read backward according to the instruction execution order until the first solid deposition path after the empty shift ends; all forward feeding instructions from the start of the re-extrusion action to the end of the first solid deposition path after the empty shift are determined as the re-extrusion compensation search range.
[0110] It should be noted that limiting the search range for re-squeezing compensation to before the end of the first solid deposition path after the vacancy is to prevent the forward feed in subsequent ordinary deposition paths from being incorrectly included in the re-pull compensation.
[0111] If the pullback amount is not offset before the end of the first solid deposition path after the evacuation, it means that the first solid deposition path after the evacuation has been occupied or insufficiently compensated by the pullback, and subsequent ordinary deposition paths will no longer be used to locate the compensation completion position of the current pullback and re-squeezing transition section.
[0112] Furthermore, after determining the search range for re-extrusion compensation, the forward feeding amount is accumulated.
[0113] Specifically, within the re-extrusion compensation search range, forward feeding instructions are read one by one according to the order of instruction execution. For each forward feeding instruction read, the change in the feeding axis of the current forward feeding instruction is added to the sum of the changes in the feeding axis of the previously executed forward feeding instructions to obtain the cumulative forward feeding amount when the current forward feeding instruction is executed. This process is continued until the first solid deposition path after the empty migration ends, forming the cumulative forward feeding amount corresponding to each forward feeding instruction within the re-extrusion compensation search range.
[0114] It should be noted that the cumulative positive feed amount is used to represent the gradual offsetting process of the positive feed amount to the re-extrusion amount in the first solid deposition path after the re-extrusion action and the empty displacement; after the cumulative positive feed amount is generated, the compensation completion command positioning is entered.
[0115] Specifically, the cumulative forward feed amount is compared with the retraction amount, and the instruction number that first caused the cumulative forward feed amount to reach the retraction amount is found according to the instruction execution order. The instruction number that first caused the cumulative forward feed amount to reach the retraction amount is determined as the compensation completion instruction number.
[0116] Specifically, the compensation completion instruction number is represented as:
[0117] ;
[0118] in, Indicates the first The compensation completion instruction number for each pullback and re-extrusion transition section. Indicates the number of the retraction and re-extrusion transition section. This indicates the instruction number within the search range for re-extrusion compensation. Indicates the first The set of positive feed command numbers in each pullback and re-extrusion transition section, from the start of the re-extrusion action to the end of the first solid deposition path after vacancy. Indicates the first The first retraction and re-squeezing transition phase is executed until the [number]th phase. The cumulative positive feed amount during repeated extrusion related instructions, with the dimension being length. Indicates the first The amount of retraction in the retraction and re-extrusion transition section is measured in units of length.
[0119] It should be noted that the compensation completion instruction number is the instruction number for the first time the cumulative forward feed amount reaches the retraction amount. By using the first-reach relationship, the starting completion position of the re-extrusion to offset the retraction can be located, avoiding the subsequent forward feed that has already entered the solid deposition stage being mistakenly identified as retraction compensation.
[0120] It should be noted that if there is no compensation completion instruction number, the virtual side compensation completion status will be marked as incomplete compensation, and the pullback amount, re-squeeze compensation search range, and corresponding instruction line number will be passed to the subsequent verification information output; if there is a compensation completion instruction number, the calculation of the compensation completion position ratio will proceed.
[0121] Read the cumulative forward feed amount before the compensation completion instruction number, and combine it with the retraction amount and the feed axis change amount of the compensation completion instruction to generate the position ratio of the virtual side retraction compensation completion position in the path corresponding to the compensation completion instruction; read the cumulative coordinates of the start path and the cumulative coordinates of the end path of the virtual path segment corresponding to the compensation completion instruction, and combine it with the position ratio of the virtual side retraction compensation completion position in the path corresponding to the compensation completion instruction to generate the cumulative coordinates of the path of the virtual side retraction compensation completion position; generate the virtual side compensation completion status according to the path attribute to which the compensation completion instruction belongs; the virtual side compensation completion status includes compensation completed within re-extrusion, compensation completed within printing start, and compensation not completed.
[0122] Specifically, when a compensation completion instruction number exists, all forward feeding instructions from the start of the re-extrusion action to the compensation completion instruction are read according to the instruction execution order within the re-extrusion compensation search range. The changes in the feeding shaft corresponding to all forward feeding instructions are accumulated sequentially to obtain the cumulative forward feeding amount before the compensation completion instruction. The cumulative forward feeding amount before the compensation completion instruction is used to represent the total amount of forward feeding that has been generated within the re-extrusion compensation search range before the first instruction that causes the cumulative forward feeding to reach the retraction amount.
[0123] It should be noted that only a portion of the forward feed within the compensation completion instruction is used to offset the remaining retraction amount. Therefore, it is necessary to first calculate the cumulative forward feed amount that has been formed before the compensation completion instruction, and then determine the retraction compensation amount that still needs to be undertaken within the compensation completion instruction.
[0124] Furthermore, based on the retraction amount, the cumulative forward feed amount before the compensation completion command, and the feed axis change amount of the compensation completion command, the position ratio of the virtual side retraction compensation completion position in the path corresponding to the compensation completion command is calculated.
[0125] Specifically, the ratio of the virtual side pullback compensation completion position to the position in the path corresponding to the compensation completion command is expressed as follows:
[0126] ;
[0127] in, Indicates the first The proportion of the virtual side pullback compensation completion position in each pullback and re-extrusion transition section within the path corresponding to the compensation completion command, with a value range of (0, 1]. Indicates the first The cumulative forward feed amount, in units of length, is generated before the compensation completion command is issued during the retraction and re-extrusion transition section. This indicates the change in the feed shaft after the compensation completion command is issued, with the dimension being length.
[0128] In the position ratio formula, the numerator represents the length of the feed shaft that still needs to be compensated within the compensation completion instruction, and the denominator represents the length of the forward feed shaft provided by the compensation completion instruction itself. Since the compensation completion instruction number is the instruction number that first makes the cumulative forward feed amount reach the retraction amount, the cumulative forward feed amount before the compensation completion instruction is less than the retraction amount, and the cumulative forward feed amount after the compensation completion instruction is executed is not less than the retraction amount, the position ratio is located within the path corresponding to the compensation completion instruction.
[0129] During the execution of 3D printing linear motion commands, the change in the feed axis and the advance of the nozzle path are recorded synchronously in the same command. The proportion of the feed axis length that still needs to be compensated within the compensation completion command to the change in the feed axis of the compensation completion command can be mapped to the path ratio of the virtual side pullback compensation completion position in the corresponding path of the compensation completion command.
[0130] It should be noted that since the compensation completion instruction number is the instruction number that first makes the cumulative forward feed amount reach the retraction amount, the position ratio falls within the path corresponding to the compensation completion instruction; after the position ratio calculation is completed, the cumulative coordinate conversion of the path is entered.
[0131] Specifically, the cumulative coordinates of the starting and ending paths of the virtual path segment corresponding to the compensation completion instruction are read, and the cumulative coordinates of the path at the virtual side pullback compensation completion position are calculated according to the position ratio.
[0132] Specifically, the cumulative path coordinates of the virtual side pullback compensation completion location are represented as follows:
[0133] ;
[0134] in, Indicates the first The cumulative path coordinates of the virtual side pullback compensation completion position of each pullback and re-extrusion transition section, in units of length. This represents the cumulative coordinates of the starting path of the virtual path segment corresponding to the compensation completion command, expressed in units of length. This represents the cumulative coordinates of the end path of the virtual path segment corresponding to the compensation completion command, with the dimension being length and the superscript indicating the coordinates. Indicates the virtual side.
[0135] It should be noted that the virtual path segments have been converted into cumulative path coordinates, and the virtual path segment corresponding to the compensation completion command has starting and ending cumulative path coordinates. The position ratio within the compensation completion command has been obtained, so mapping the position ratio to the virtual path segment corresponding to the compensation completion command can yield the cumulative path coordinates of the virtual side pullback compensation completion position. The cumulative path coordinates of the virtual side pullback compensation completion position serve as the reference position for subsequent mapping of the real side pullback compensation completion position.
[0136] It should be noted that if the compensation completion instruction is an in-situ re-squeezing instruction, the cumulative coordinates of the starting path of the virtual path segment corresponding to the compensation completion instruction are equal to the cumulative coordinates of the ending path, and the cumulative coordinates of the path at the virtual side pullback compensation completion position remain unchanged; it can cover both in-situ re-squeezing and moving-while-re-squeezing instruction forms.
[0137] Furthermore, the path attribute of the compensation completion instruction is read, and the status is marked by combining the cumulative coordinates of the path at the virtual side pullback compensation completion location.
[0138] Specifically, when there is no compensation completion instruction number, the virtual side compensation completion status is marked as incomplete compensation.
[0139] When the compensation completion instruction number falls within the range of instruction line numbers corresponding to the re-extrusion action, the virtual side compensation completion status is marked as compensation completed within the re-extrusion.
[0140] When the compensation completion instruction number falls within the range of instruction line numbers corresponding to the first physical deposition path after the empty migration, the virtual side compensation completion status is marked as compensation completed within the printing start period.
[0141] It should be noted that "compensation completed within re-squeezing" means that the re-squeezing action has already offset the amount of repulsion before entering the first solid deposition path after the vacancy; "compensation completed within imprinting" means that part of the first solid deposition path after the vacancy was used to offset the amount of repulsion; and "compensation not completed" means that the amount of repulsion was not offset before the end of the first solid deposition path after the vacancy.
[0142] S4. Collect the actual cumulative displacement of the feed, the current position of the nozzle, and the current execution command line number. Establish an actual sampling sequence. Determine the actual side return compensation completion time based on the actual sampling sequence and the return amount. Generate the actual side return compensation completion position. Calculate the virtual and real compensation consumable offset. Combine the distinguishable consumable quantity and the virtual side compensation completion status to obtain the verification classification. Output the consumable increase / decrease CNC command verification information and the minimum modification object.
[0143] Collect the actual cumulative displacement of the feed, the current position of the nozzle, and the current execution command line number. Filter the actual sampling records according to the command line number range of the retraction and re-extrusion transition section, sort them by sampling time, and generate an actual sampling sequence. Based on the actual sampling sequence and the retraction amount, calculate the actual forward feed amount of each sampling record relative to the starting point of the re-extrusion action. Compare the actual forward feed amount and the retraction amount in ascending order of sampling time, find the adjacent sampling records that first reach the retraction amount, and generate the actual side retraction compensation completion time.
[0144] Furthermore, during the printing process, the actual cumulative displacement of the material feed, the current position of the printhead, and the current line number of the executing instruction are collected simultaneously.
[0145] Specifically, the actual cumulative displacement of the feed is obtained through the feed wheel encoder, the pulse conversion value of the feed motor, or the displacement acquisition value of the consumable inlet; the current position of the printhead is determined through position feedback during the printing control process; and the current execution instruction line number is obtained through the CNC instruction execution record.
[0146] Each sampling record includes the sampling time, the actual cumulative displacement of the feed, the current position of the nozzle, and the line number of the currently executed instruction.
[0147] Process each pullback and re-extrusion transition section one by one according to its number. Specifically, read the starting command line number of the re-extrusion action, the ending command line number of the first solid deposition path after the empty shift, and the corresponding command line number range contained in the current pullback and re-extrusion transition section.
[0148] In the actual sampling records, sampling records that are currently executed instruction line numbers fall within the range of instruction line numbers in the current pullback and re-extrusion transition segment are retained.
[0149] The retained sampling records are arranged from morning to night according to the sampling time to form the real sampling sequence of the current pullback and re-squeeze transition section.
[0150] It should be noted that the starting point of the actual sampling sequence is the first sampling record corresponding to the starting command line number of the re-extrusion action, and the ending point of the actual sampling sequence is the last sampling record corresponding to the ending command line number of the first entity deposition path after the empty movement.
[0151] If the actual sampling sequence is empty, the actual sampling missing information is output, and the minimum modification object is limited to the actual feeding sampling link and the instruction execution record link. No abnormal attribution is made to the CNC instruction itself. If the actual sampling sequence is not empty, the actual side pullback compensation completion time is determined.
[0152] Furthermore, the actual sampling sequence of the current retraction and re-extrusion transition section is read, and the actual cumulative displacement of the material feeding in the sampling record at the beginning of the re-extrusion action is taken as the actual feeding start point. According to the sampling time sequence, the actual forward feeding amount of each sampling record relative to the actual feeding start point is calculated.
[0153] Furthermore, the actual forward feed amount is compared with the retraction amount to find the first pair of adjacent sampling records, such that the actual forward feed amount of the previous sampling record is less than the retraction amount, and the actual forward feed amount of the subsequent sampling record is greater than or equal to the retraction amount.
[0154] Furthermore, after finding the first pair of adjacent sampling records, the actual side pullback compensation completion time is determined by the actual cumulative displacement change between adjacent sampling records.
[0155] Specifically, the actual side pullback compensation interpolation ratio is expressed as:
[0156] ;
[0157] in, Indicates the first The actual side pullback compensation interpolation ratio for each pullback and re-extrusion transition section ranges from (0, 1]. This indicates the sampling record number in the actual sampling sequence where the actual forward feed amount has not yet reached the retraction amount. This indicates the sampling record number in the actual sampling sequence that first reaches or exceeds the retraction amount. Indicates the first Each sampling record corresponds to the actual cumulative displacement of the material feed at the sampling time, with the dimension being length. This represents the actual cumulative displacement of the feed material at the initial sampling time of the re-extrusion action, with the dimension of length. Indicates the first Each sampling record corresponds to the actual cumulative displacement of the material feed at the sampling time, with the dimension being length. Indicates the first In the first retraction and extrusion transition section Each sampling record corresponds to a sampling time. Indicates the first The sampling time of the initial sampling of the re-squeezing action in the re-squeezing transition section. Indicates the first In the first retraction and extrusion transition section Each sampling record corresponds to a sampling time.
[0158] It should be noted that the true-side pullback compensation interpolation ratio is used to represent the relative position of the time when the true-side pullback compensation is completed between the previous sampling time and the next sampling time. The numerator represents the actual feed displacement that still needs to be increased from the previous sampling time, and the denominator represents the actual increase in the actual feed displacement between the previous sampling time and the next sampling time. Since the actual forward feed amount recorded in the previous sampling is less than the pullback amount, and the actual forward feed amount recorded in the next sampling is greater than or equal to the pullback amount, the true-side pullback compensation interpolation ratio is greater than zero and not greater than one.
[0159] Specifically, the time when the actual side pullback compensation is completed is expressed as:
[0160] ;
[0161] in, Indicates the first The actual moment when the side pullback compensation is completed in the pullback and re-extrusion transition section.
[0162] It should be noted that the completion time of the actual side pullback compensation is determined by the previous sampling time, the next sampling time, and the actual side pullback compensation interpolation ratio. The previous sampling time represents the last sampling time when the actual forward feed amount has not yet reached the pullback amount, and the next sampling time represents the sampling time when the actual forward feed amount first reaches or exceeds the pullback amount. Therefore, determining the completion time of the actual side pullback compensation according to the actual side pullback compensation interpolation ratio between the two sampling times can ensure that the actual cumulative displacement of the feed and the pullback amount correspond at the same point in time.
[0163] It should be noted that if there are no adjacent sampling records that meet the conditions in the actual sampling sequence, it is determined that the actual side has not formed a time when the pullback compensation is completed, and the information of insufficient pullback compensation on the actual side is output; if the time when the pullback compensation is completed on the actual side has been determined, the process of determining the position when the pullback compensation is completed on the actual side is entered.
[0164] By sampling records before and after the completion of the actual side-retraction compensation, the current position of the nozzle is synchronously interpolated to generate the actual side-retraction compensation completion position. The virtual path segment is matched according to the current execution command line number, and the actual side-retraction compensation completion position is projected as the path cumulative coordinates. The virtual side-retraction compensation completion position, the actual side-retraction compensation completion position, the consumable conversion benchmark, the line width, and the layer height are read to calculate the virtual and real compensation consumable offset. Based on the virtual and real compensation consumable offset, the distinguishable consumable quantity, and the virtual side compensation completion status, the verification classification is obtained, and the consumable increase / decrease CNC command verification information and the minimum modification object are output.
[0165] Furthermore, two sampling records before and after the actual side back-pull compensation completion time are read, and synchronous interpolation is performed on the current position of the nozzle to obtain the actual side back-pull compensation completion position.
[0166] Specifically, the location where the actual side pullback compensation is completed is indicated as follows:
[0167] ;
[0168] in, Indicates the first The actual lateral back-pull compensation completion position of each back-pull and re-extrusion transition section is composed of the nozzle's lateral coordinates, nozzle's longitudinal coordinates, and nozzle's height coordinates, with the dimension being length. Indicates the first Each sampling record corresponds to the current position of the nozzle at the sampling time. Indicates the first Each sampling record corresponds to the current position of the nozzle at the sampling time, indicated by the superscript. Indicates the true side.
[0169] It should be noted that the actual side pullback compensation completion position is determined using the same interpolation ratio as the actual side pullback compensation completion time, so that the current position of the nozzle is synchronized with the actual cumulative displacement of the feed. The current position of the nozzle corresponding to the previous sampling time and the current position of the nozzle corresponding to the next sampling time are both from the actual sampling records during the printing execution. The actual side pullback compensation completion position is determined by the path progression relationship between the two sampling positions.
[0170] Furthermore, based on the current execution instruction line number corresponding to the time when the actual side pullback compensation is completed, the virtual path segment corresponding to the same instruction line number is searched in the virtual path segment.
[0171] If the corresponding virtual path segment is a non-zero length path, project the actual side pullback compensation completion position onto the direction of the corresponding virtual path segment, and convert it into the cumulative path coordinates of the actual side pullback compensation completion position:
[0172] Specifically, the cumulative path coordinates of the actual side pullback compensation completion location are represented as follows:
[0173] ;
[0174] in, Indicates the first The cumulative path coordinates of the actual side pullback compensation completion position of each pullback and re-extrusion transition section, in units of length. This indicates the virtual path segment number matched by the execution instruction line number at the time when the actual side pullback compensation is completed. Indicates the first The cumulative coordinates of the starting paths of each virtual path segment, measured in units of length. Indicates the first The cumulative coordinates of the ending paths of each virtual path segment, measured in units of length. Indicates the first The starting coordinates of each virtual path segment. Indicates the first The endpoint coordinates of each virtual path segment, symbol Represents the vector dot product, with the sign... Indicates the length of the vector.
[0175] It should be noted that the actual side pullback compensation completion position is first obtained by recording the spatial coordinates of the actual sampling, and then matched to the same virtual path segment according to the current execution instruction line number; the vector inner product in the formula is used to calculate the projection ratio of the actual side pullback compensation completion position in the direction of the corresponding virtual path segment, and the projection ratio is then combined with the path cumulative coordinate length of the corresponding virtual path segment to convert the actual spatial position into path cumulative coordinates; the actual side pullback compensation completion position and the virtual side pullback compensation completion position can be compared in the same path cumulative coordinates, avoiding mismatch of adjacent paths caused by comparing only spatial distance.
[0176] If the projection scale is less than zero, the actual side pullback compensation completion position is located before the start of the corresponding virtual path segment, and the cumulative path coordinates of the actual side pullback compensation completion position are taken as the cumulative path coordinates of the start of the corresponding virtual path segment; if the projection scale is greater than one, the actual side pullback compensation completion position is located after the end of the corresponding virtual path segment, and the cumulative path coordinates of the actual side pullback compensation completion position are taken as the cumulative path coordinates of the end of the corresponding virtual path segment.
[0177] It should be noted that if the corresponding virtual path segment is a zero-length path, then the first... The cumulative coordinates of the starting path of each virtual path segment are used as the cumulative coordinates of the path at the actual side pullback compensation completion position; covering two types of instruction forms: in-situ re-squeezing action and moving-while-re-squeezing action.
[0178] Furthermore, the cumulative path coordinates of the virtual side pullback compensation completion position and the real side pullback compensation completion position are read; the consumable conversion benchmark, line width, and floor height are read; and the virtual and real compensation consumable offset is calculated according to the cumulative path coordinate interval between the virtual side and the real side.
[0179] Specifically, the offset of virtual and real compensation consumables is expressed as:
[0180] ;
[0181] in, Indicates the first The offset of the virtual and real compensation consumables in the retraction and extrusion transition section is measured in units of length.
[0182] Specifically, when the offset of the virtual and real compensation consumables is positive, it indicates that the actual side pullback compensation completion position lags behind the virtual side pullback compensation completion position; when the offset of the virtual and real compensation consumables is negative, it indicates that the actual side pullback compensation completion position is earlier than the virtual side pullback compensation completion position; when the offset of the virtual and real compensation consumables is zero, it indicates that the actual side pullback compensation completion position and the virtual side pullback compensation completion position are located at the same path cumulative coordinates.
[0183] It should be noted that the virtual-to-real compensation consumable offset is used to convert the path offset between the virtual-side retraction compensation completion position and the real-side retraction compensation completion position into an equivalent feed shaft length; the integral term represents the virtual deposition volume of the corresponding path interval between the two retraction compensation completion positions, and the consumable conversion reference represents the feed shaft length corresponding to a unit virtual deposition volume. Therefore, the combination of the two yields an offset in the dimension of feed shaft length; when the virtual-to-real compensation consumable offset is positive, it indicates that the path length required for the real side to complete retraction compensation exceeds the path length required for the virtual side to complete retraction compensation; when the virtual-to-real compensation consumable offset is negative, it indicates that the real side completes retraction compensation earlier than the virtual side.
[0184] Furthermore, the distinguishable consumable quantity is read, and the offset of virtual and real compensated consumables is compared with the distinguishable consumable quantity. A verification classification is generated according to the following B1-B6 order:
[0185] B1. When no compensation completion instruction number is generated, a virtual side pullback compensation insufficiency classification is generated, and the pullback instruction, re-squeeze instruction, and the first physical deposition path after vacancy are marked.
[0186] B2. When the actual side pullback compensation completion time has not been formed, generate an actual side pullback compensation insufficiency classification, and mark the re-squeezing action and the actual sampling sequence.
[0187] B3. When the absolute value of the offset of virtual and real compensation consumables is not greater than the recognizable consumable quantity, and the virtual side compensation completion status is "compensation completed within the re-extrusion", the verification classification is determined as passing the verification.
[0188] B4. When the absolute value of the offset of virtual and real compensation consumables is not greater than the recognizable consumable quantity, and the virtual side compensation completion status is compensation completed within the printing start, generate a classification of unreasonable re-extrusion arrangement, and mark the re-extrusion instruction and the starting interval of the first physical deposition path after empty displacement.
[0189] B5. When the offset of virtual and real compensation consumables is greater than the recognizable consumables amount, generate a real feeding lag classification, and mark the real side pullback compensation completion position, re-extrusion command and lag path interval.
[0190] B6. When the offset of virtual and real compensation consumables is less than the opposite of the recognizable consumables quantity, generate real feeding advance classification, mark the real side pullback compensation completion position, re-extrusion instruction and advance path interval.
[0191] It should be noted that the resolvable consumable quantity comes from the decimal precision of the feed axis value, the decimal precision of the nozzle coordinates, the consumable conversion benchmark, and the ordinary deposition cross-sectional area; the resolvable consumable quantity is not a manually set threshold, but a recognizable boundary formed by the combined precision of the CNC instruction text expression and the path conversion precision; when the absolute value of the virtual-to-real compensation consumable offset is not greater than the resolvable consumable quantity, the difference between the virtual side retraction compensation completion position and the real side retraction compensation completion position is within the resolvable range that can be expressed by the CNC instruction and the path cumulative coordinates; when the absolute value of the virtual-to-real compensation consumable offset is greater than the resolvable consumable quantity, the difference can be jointly identified by the CNC instruction data and the real sampling data.
[0192] It should be noted that the verification classification is performed in a progressive manner. First, it checks whether the compensation completion instruction number exists, which is used to distinguish whether the virtual side has formed a pullback compensation closure; then it checks whether the real side pullback compensation completion time exists, which is used to distinguish whether the real material feeding has completed the corresponding compensation; then it compares the virtual and real compensation consumable offset with the distinguishable consumable quantity, which is used to distinguish whether the virtual and real compensation positions are consistent, the real material feeding is delayed, and the real material feeding is advanced; the progressive judgment can avoid the same pullback re-extrusion transition section falling into multiple verification classifications at the same time.
[0193] Furthermore, based on the verification classification, verification information for CNC instructions for increasing or decreasing consumables is generated.
[0194] Specifically, the verification information includes the printed layer, the number of the pullback and re-extrusion transition section, the pullback command line number, the re-extrusion command line number, the empty migration path, the first solid deposition path after the empty migration, the virtual side pullback compensation completion position, the real side pullback compensation completion position, the virtual and real compensation consumable offset, the verification category, and the minimum modification object.
[0195] When the verification classification indicates insufficient virtual side pullback compensation, the minimum modification object is limited to the re-extrusion command and the corresponding pullback command; when the verification classification indicates unreasonable re-extrusion arrangement, the minimum modification object is limited to the re-extrusion command and the starting interval of the first entity deposition path after empty shift; when the verification classification indicates delayed or advanced actual feeding, the minimum modification object is limited to the feeding execution process corresponding to the actual sampling sequence; when the verification classification indicates passing the verification, no minimum modification object is generated.
[0196] It should be noted that the minimum modification target is determined based on the verification classification; insufficient virtual side pullback compensation corresponds to re-extrusion and pullback commands because the virtual side forward feeding does not offset the pullback amount; unreasonable re-extrusion arrangement corresponds to the re-extrusion command and the starting interval of the first solid deposition path after empty shift, because the virtual side pullback compensation completion position enters the first solid deposition path after empty shift; delayed or advanced actual feeding corresponds to the feeding execution process in the actual sampling sequence, because the virtual side compensation position and the actual side compensation position have deviated, but the virtual side compensation relationship itself can be formed; this can avoid modifying the entire CNC command.
[0197] In summary, this invention generates a retraction and re-extrusion transition section, organizing the pre-emptive migration path, retraction action, empty migration path, re-extrusion action, and the first solid deposition path after empty migration into continuous verification objects. This enables cross-command consumable compensation chain positioning and clarifies the compensation boundary of the retraction and re-extrusion process. By generating a virtual side compensation completion status and a real side retraction compensation completion position, the virtual side compensation position and the real side feeding position are mapped to a unified path scale. Combined with the distinguishable consumable quantity, the invention outputs consumable increase / decrease CNC command verification information and the minimum modification object, effectively distinguishing the virtual and real compensation consumable offset, accurately tracing abnormal positions, and making the minimum modification object more concentrated.
[0198] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for verifying NC commands for adding or removing 3D printing consumables based on virtual-real mapping, characterized in that, include: Read the 3D printing CNC instruction file and slicing parameter file line by line, identify the feeding mode, determine the amount of change of the feeding axis, establish a virtual path segment based on the change of nozzle coordinates, locate the pullback action, track the empty movement path, the re-extrusion action and the first solid deposition path after the empty movement, merge forward into the closing path before the empty movement, and generate the pullback and re-extrusion transition segment. Based on the virtual path segment and the retraction and re-extrusion transition segment, a list of printing layer paths is established, transition coverage paths are marked, ordinary deposition paths are screened, consumable conversion ratio is calculated, consumable conversion benchmark is generated, and the average deposition cross-sectional area is calculated based on the ordinary deposition path to generate the ordinary deposition cross-sectional area and obtain the resolvable consumable amount. Based on the retraction and re-extrusion transition section, extract the retraction action, calculate the retraction amount, determine the re-extrusion compensation search range and accumulate the forward feed amount, match the cumulative forward feed amount with the retraction amount for the first time, generate a compensation completion instruction number, generate the position ratio of the virtual side retraction compensation completion position in the path corresponding to the compensation completion instruction based on the cumulative forward feed amount before the compensation completion instruction number, convert the cumulative path coordinates of the virtual side retraction compensation completion position, and generate the virtual side compensation completion status; Collect the actual cumulative displacement of material feeding, the current position of the nozzle, and the current execution command line number to establish an actual sampling sequence. Based on the actual sampling sequence and the amount of retraction, determine the actual side retraction compensation completion time, generate the actual side retraction compensation completion position, calculate the virtual and real compensation consumable offset, combine the distinguishable consumable quantity and the virtual side compensation completion status, obtain the verification classification, and output the consumable increase / decrease CNC command verification information and the minimum modification object.
2. The method for verifying NC commands for adding or removing 3D printing consumables based on virtual-real mapping as described in claim 1, characterized in that, The generated pullback and re-extrusion transition section includes: Read the 3D printing CNC instruction file and slicing parameter file line by line, extract the nozzle target coordinates, feed axis values, feed mode, feed axis zeroing mark, layer number, layer height, line width, consumable diameter and motion type, and form an instruction record sequence arranged in the execution order; The instruction record sequence is processed to identify the feeding mode, disconnect the feeding shaft from zero, and calculate the change in the feeding shaft. Based on the change in the feeding shaft, the forward feeding action, the retraction action, and the empty movement path are marked. Based on the change in the nozzle coordinates, virtual path segments and cumulative path coordinates are generated. Based on the virtual path segment and the cumulative coordinates of the path, the pullback action is located, the evacuation path, the re-squeezing action and the first solid deposition path after the evacuation are traced backward, and the end path before the evacuation is merged forward to generate the pullback and re-squeezing transition section.
3. The method for verifying NC commands for adding or removing 3D printing consumables based on virtual-real mapping as described in claim 2, characterized in that, The screening of common depositional pathways includes: The virtual path segments within the same printing layer are arranged according to the order of instruction execution to create a printing layer path list. The retraction and re-extrusion transition segment is read. The transition coverage path corresponding to the pre-emptive migration path, retraction action, empty migration path, re-extrusion action, and the first solid deposition path after empty migration is marked in the printing layer path list. The transition coverage path is excluded, and the ordinary deposition path is selected.
4. The method for verifying NC commands for adding or removing 3D printing consumables based on virtual-real mapping as described in claim 1 or 3, characterized in that, The conversion criteria for generating consumables include: Based on the positive change of the feed axis in the ordinary deposition path, the cumulative coordinates of the starting path, the cumulative coordinates of the ending path, the line width, and the layer height, the consumable conversion ratio is calculated. All consumable conversion ratios within the same printing layer are arranged in ascending order of value. The representative feed conversion relationship of the current printing layer is extracted based on the median position of the consumable conversion ratio to generate the consumable conversion benchmark.
5. The method for verifying NC commands for adding or removing 3D printing consumables based on virtual-real mapping as described in claim 1, characterized in that, The acquisition of the recognizable consumable quantity includes: The average sedimentation cross-sectional area is calculated based on the cumulative coordinates of the starting and ending paths, the line width, and the layer height of the ordinary sedimentation path. All average sedimentation cross-sectional areas within the same printing layer are arranged in ascending order of value. The ordinary sedimentation cross-sectional area is generated based on the median position of the average sedimentation cross-sectional area. The decimal places of the feed axis value and the nozzle coordinate in the 3D printing CNC instruction are read, and combined with the consumable conversion benchmark and the ordinary deposition cross-sectional area, a recognizable consumable quantity is generated.
6. The method for verifying NC commands for adding or removing 3D printing consumables based on virtual-real mapping as described in claim 5, characterized in that, The calculation of the pullback amount includes: According to the number of the pullback and re-extrusion transition section, read the pullback action, the empty movement path, the re-extrusion action, the first solid deposition path after the empty movement, and the corresponding instruction line number, and perform the inverse accumulation of the feed shaft change for the pullback action to generate the pullback amount.
7. The method for verifying NC commands for adding or removing 3D printing consumables based on virtual-real mapping as described in claim 6, characterized in that, The generation compensation completion instruction number includes: From the start of the re-extrusion action to the end of the first solid deposition path after the empty migration, the forward feed command is read, the re-extrusion compensation search range is generated, the forward feed command within the re-extrusion compensation search range is accumulated according to the execution order to generate the cumulative forward feed amount, and the cumulative forward feed amount is matched with the first reach relationship with the retraction amount to generate the compensation completion command number.
8. The method for verifying NC commands for adding or removing 3D printing consumables based on virtual-real mapping as described in claim 7, characterized in that, The virtual side compensation completion status includes: Read the cumulative forward feed amount before the compensation completion instruction number, and combine it with the pullback amount and the feed axis change amount of the compensation completion instruction to generate the position ratio of the virtual side pullback compensation completion position in the path corresponding to the compensation completion instruction; Read the cumulative coordinates of the start path and the cumulative coordinates of the end path of the virtual path segment corresponding to the compensation completion instruction. Combine the position ratio of the virtual side pullback compensation completion position in the path corresponding to the compensation completion instruction to generate the cumulative coordinates of the virtual side pullback compensation completion position. Generate the virtual side compensation completion status according to the path attribute to which the compensation completion instruction belongs. The virtual side compensation completion status includes compensation completed within the re-extrusion period, compensation completed within the printing start period, and compensation not completed.
9. The method for verifying NC commands for adding or removing 3D printing consumables based on virtual-real mapping as described in claim 8, characterized in that, The location where the real-side pullback compensation is completed includes: Collect the actual cumulative displacement of material feeding, the current position of the nozzle, and the current command line number. Filter the actual sampling records according to the range of command line numbers for the pullback and re-extrusion transition section, sort them by sampling time, and generate an actual sampling sequence. Based on the actual sampling sequence and the amount of retraction, the actual forward feed amount of each sampling record relative to the starting point of the re-extrusion action is calculated. The actual forward feed amount and the amount of retraction are compared in ascending order according to the sampling time. The adjacent sampling records that first reach the amount of retraction are found to generate the actual side retraction compensation completion time. By sampling records before and after the actual side-retraction compensation completion time, the current position of the nozzle is synchronously interpolated to generate the actual side-retraction compensation completion position. The virtual path segment is matched according to the current execution command line number, and the actual side-retraction compensation completion position is projected as the path cumulative coordinates.
10. The method for verifying NC commands for adding or removing 3D printing consumables based on virtual-real mapping as described in claim 9, characterized in that, The output consumables increase / decrease CNC instruction verification information and minimum modification object include: Read the virtual side pullback compensation completion position, the real side pullback compensation completion position, consumable conversion benchmark, line width and layer height, calculate the virtual and real compensation consumable offset, and based on the virtual and real compensation consumable offset, the distinguishable consumable quantity and the virtual side compensation completion status, obtain the verification classification, and output the consumable increase / decrease CNC instruction verification information and the minimum modification object.