Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Cancel individual part(s)

    Scheduled Pinned Locked Moved
    Firmware wishlist
    11
    23
    3.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • fmaundefined
      fma
      last edited by

      https://www.youtube.com/watch?v=ANfOr2F79LQ

      Octoprint has now a plugin to allow cancelling individual part when it fails, to avoid ruining an entire plate. It is based on some information only S3D writes for now in the G-Code.

      This is really a great feature!

      If firmwares implement this feature, slicers will also add it. Or maybe there is a way to retreive if there are several parts by pre-analysing the G-Code? Or maybe a Python script could do that, and mimic S3D G-Code?

      What do you think?

      Frédéric

      BPisLifeundefined 1 Reply Last reply Reply Quote 0
      • BPisLifeundefined
        BPisLife @fma
        last edited by

        @fma I agree I would love that feature!

        1 Reply Last reply Reply Quote 0
        • dc42undefined
          dc42 administrators
          last edited by

          Do you know what information it uses that is written by S3D?

          Duet WiFi hardware designer and firmware engineer
          Please do not ask me for Duet support via PM or email, use the forum
          http://www.escher3d.com, https://miscsolutions.wordpress.com

          fmaundefined 1 Reply Last reply Reply Quote 0
          • DocTruckerundefined
            DocTrucker
            last edited by

            Slic3r has an option to add comments when the data is moving onto different parts but I've not tested it yet. Might be something as limited as "; end part", ";start part". I did something similar for MCP/MTT/Renishaw's SLM machines in a different life! Speeds up experiments massively as you can chance things and cancel problem makers. Less risk.

            @dc42 Did you get much luck setting up a cross platform working group to investigate developing or replacing to gcode format?

            Identifing blocks of code as belonging to one part is a start, moving process parameter data to a header section allowing for local scope over rides is another potential big step.

            Running 3 P3Steel with Duet 2. Duet 3 on the shelf looking for a suitable machine. One first generation Duet in a Logo/Turtle style robot!

            fmaundefined 1 Reply Last reply Reply Quote 0
            • fmaundefined
              fma @dc42
              last edited by

              @dc42 see:

              https://www.youtube.com/watch?v=ANfOr2F79LQ&feature=youtu.be&t=162

              Frédéric

              1 Reply Last reply Reply Quote 0
              • fmaundefined
                fma @DocTrucker
                last edited by

                @doctrucker said in Cancel individual part(s):

                Slic3r has an option to add comments when the data is moving onto different parts but I've not tested it yet.

                It seems it only works when printing objects sequentially...

                Frédéric

                1 Reply Last reply Reply Quote 0
                • fmaundefined
                  fma
                  last edited by

                  I read the messages in the Slic3rPE bug-tracker, and it seems that this feature will not be integrated soon...

                  So, I think that post-processing the G-Code would be a more universal solution. This mainly requires to be able to distinguish different parts by analysing the tool trajectory.

                  Do you have any advice to do that? I would like to use Python, so if you know some interesting modules...

                  PS: Ian, which module are you using to parse G-Code?

                  Frédéric

                  deckingmanundefined 1 Reply Last reply Reply Quote 0
                  • deckingmanundefined
                    deckingman @fma
                    last edited by deckingman

                    @fma said in Cancel individual part(s):

                    PS: Ian, which module are you using to parse G-Code?

                    I write my own. TBH all I do is text editing and you can use any number of tools to do that. Mostly it's a case of search for a particular string of characters and replace it with something else, or insert something before of after that string. I started doing it with notepad++ but it became a bit tedious. I chose Python basically because there are many resources on the internet so I can just "Google" what I want to do and find an answer. I looked at Perl but every time I did a search for a particular topic, I ended up some forum or other where a bunch of purist code writers would be bickering and arguing about the most efficient way of doing something, rather than answering a simple question.

                    So when I say, I write my own modules, what I really mean is that I scrape chunks of code off the internet and cobble them together. The results aren't pretty and I'm sure that professional writers of code would either laugh or cry if they saw my efforts. But I get the job done and that's all I care about. ☺

                    Ian
                    https://somei3deas.wordpress.com/
                    https://www.youtube.com/@deckingman

                    fmaundefined 1 Reply Last reply Reply Quote 1
                    • fmaundefined
                      fma @deckingman
                      last edited by

                      @deckingman said in Cancel individual part(s):

                      I write my own. TBH all I do is text editing and you can use any number of tools to do that.

                      Ok. Yeah, this is easy to parse such text file in Python, but I don't like re-writing something which already exists ;o)

                      Thanks!

                      Frédéric

                      1 Reply Last reply Reply Quote 0
                      • DocTruckerundefined
                        DocTrucker
                        last edited by DocTrucker

                        Without tags in the slice file it is near impossible to do a resonable job of deleting a single part. If you were to use audio file terminology the gcode format is not loss-less. When you slice you loose information regardless of the file size increasing.

                        Trying to distiguish what data belongs to what part would be very difficult. For example are four circles of filled area four differwent parts or four legs of a tiny table? Closest you may be able to do is specify a box and ignore any gcode blocks that are included, intersected by, or encirculate said box. This is still not fool proof and could result in a number of layers of a part bein cancelled then build resuming in free space making a far worse mess.

                        Running 3 P3Steel with Duet 2. Duet 3 on the shelf looking for a suitable machine. One first generation Duet in a Logo/Turtle style robot!

                        JoergS5undefined deckingmanundefined 2 Replies Last reply Reply Quote 0
                        • JoergS5undefined
                          JoergS5 @DocTrucker
                          last edited by JoergS5

                          IMHO it's possible to distinguish objects in the gcode: analyze all movements where the extruder is active and find the non printing areas which are in all layers (except raft layer etc.) non printing.

                          A different approach: in the Gui who handles the deactivation of parts, the parts could be marked by different textures. After removing a part, the g-code is recalculated and print proceeded at the active layer, now without the deactivated part. You pause at the end of a layer print, so proceeding should be without problem.

                          1 Reply Last reply Reply Quote 0
                          • deckingmanundefined
                            deckingman @DocTrucker
                            last edited by

                            @doctrucker said in Cancel individual part(s):

                            Without tags in the slice file it is near impossible to do a resonable job of deleting a single part. If you were to use audio file terminology the gcode format is not loss-less. When you slice you loose information regardless of the file size increasing.

                            Trying to distiguish what data belongs to what part would be very difficult. For example are four circles of filled area four differwent parts or four legs of a tiny table? Closest you may be able to do is specify a box and ignore any gcode blocks that are included, intersected by, or encirculate said box. This is still not fool proof and could result in a number of layers of a part bein cancelled then build resuming in free space making a far worse mess.

                            Wes,

                            One of doing it in Slic3r (and other slicers too) would be to assign a different tool to each object or part. The gcode file would then contain Tn commands and anything that comes after would be related to one part until the next Tn command. I guess what I'm saying is that the Tn commands would act as flags (or tags). The "T" would denote the start of each part and the "n" would denote the number of that part. So to cancel part 2, the firmware would need to ignore any commands coming after a T2 "flag" but before the next Tn "flag".

                            There are of course practical implications, not least of which would be the need to define multiple tools identical in all respects apart from their numbers.

                            Just a kind of random thought.........

                            Ian
                            https://somei3deas.wordpress.com/
                            https://www.youtube.com/@deckingman

                            DocTruckerundefined 1 Reply Last reply Reply Quote 1
                            • Jbournsundefined
                              Jbourns
                              last edited by

                              would being able to print multiple gcode files work somehow ? then you could send a command to ignore that file.

                              1 Reply Last reply Reply Quote 0
                              • DocTruckerundefined
                                DocTrucker @deckingman
                                last edited by DocTrucker

                                The amount of work to distiguish parts without any for of flag is massive. It would be far easier to make contact with the people who write the slicers ang get them to agree on a universal tagging system. You can even have support structure from one part intersecting the next.

                                Merging different gcode files (one per part) with python would be easily possible, and then the gcode could be tagged in a way that would allow dc42 to create a simple feature demonstrator. Issues with this would be total slice time should be kept above the minimum to avoid auto cooling and slow down (good prstice anyway) and the skirt would not work easily without a little more bodgery! All easier than reverse engineering gcode and if you've got the skills to reverse engineer the gcode like that I'm sure there are some firmware projects that your efforts would be better spent on.

                                I guess the other simple option is Duet being configured to load multiple, rather than single gcode file. Have a master build file that specifies file name and positional offset. The duet then has no need to parse for tags.

                                @deckingman Yes, that would be a good way of flagging. I'm still learning with Slic3r but haven't seen how you assign different processing parameters to different parts.

                                Edit: Sorry @Jbourns, missed your comment. We're suggesting the same thing by printing multiple files.

                                Running 3 P3Steel with Duet 2. Duet 3 on the shelf looking for a suitable machine. One first generation Duet in a Logo/Turtle style robot!

                                1 Reply Last reply Reply Quote 1
                                • DocTruckerundefined
                                  DocTrucker
                                  last edited by DocTrucker

                                  Currently redundant at the moment and busying myself by completing outstanding jobs around the house. I'll look into a python script that merges multiple gcode files whose file names, offsets, and tool numbers are specified in a JSON formatted file.

                                  This shouldn't take long and is useful practice for me anyway.

                                  All going well the output would be a gcode file that can be run by a printer (or online simulator) without fault but also be able to be split back into individual files.

                                  Tags will be simply

                                  ;part_0="nameOfPart.g"|applied_offset=(12.0,12,0.0)

                                  These will be entered before the gcode for the part. The next part tag will indicate the end of the previous. This won't be fool proof and could easily result in multiple parts intersecting.

                                  Proof will be something along the lines of:

                                  • Simulate files in duet.
                                  • Split files into layers (not compatible with vase mode).
                                  • Format G1 commands to specific number of decimal places.
                                  • Add commented checksum for non commented out G1 commands.
                                  • Merge files applying offsets and tags.
                                  • Read into duet and simulate build.
                                  • Split file removing offsets.
                                  • Check layerwise checksums.
                                  • Rebuild files.
                                  • Simulate files in duet.

                                  Running 3 P3Steel with Duet 2. Duet 3 on the shelf looking for a suitable machine. One first generation Duet in a Logo/Turtle style robot!

                                  1 Reply Last reply Reply Quote 0
                                  • fmaundefined
                                    fma
                                    last edited by

                                    @DocTrucker, with a friend, at work, we made some tests using K-means algorithms. We get decent results, even with parts having several isolated perimeters. But it's under Matlab...

                                    @deckingman, your approach sounds great! The resulting G-Code could be post-processed as well, to remove dummy 'T' commands, and replace them by a more specific flag! I will try that...

                                    Frédéric

                                    1 Reply Last reply Reply Quote 0
                                    • fmaundefined
                                      fma
                                      last edited by

                                      Just started to write something: pretty easy!

                                      Ok, so, now, we need to define the tag the firmware will parse. Octoprint looks for 'process', but it is a workaround, based on S3D possibility, not really a dedicated tag.

                                      DocTrucker's one seems good:

                                      ; part_n

                                      @dc42, what do you think?

                                      PS: my script will also add S3D 'process' tag, for people using Octoprint.

                                      Frédéric

                                      1 Reply Last reply Reply Quote 0
                                      • dc42undefined
                                        dc42 administrators
                                        last edited by

                                        I suggest "; part n" to be similar to the "; layer n" comments that some slicers insert.

                                        Duet WiFi hardware designer and firmware engineer
                                        Please do not ask me for Duet support via PM or email, use the forum
                                        http://www.escher3d.com, https://miscsolutions.wordpress.com

                                        1 Reply Last reply Reply Quote 0
                                        • resamundefined
                                          resam
                                          last edited by

                                          Seems like there is some work also going on in Cura:
                                          https://github.com/Ultimaker/CuraEngine/issues/801
                                          https://github.com/Ultimaker/CuraEngine/compare/feature_comments_per_object

                                          paukstelis created this issue in Ultimaker/CuraEngine

                                          closed Feature Request: Add object/model/mesh name comments to gcode blocks #801

                                          1 Reply Last reply Reply Quote 0
                                          • fmaundefined
                                            fma
                                            last edited by

                                            Here is a very simple Python script to implement Ian's idea:

                                            #!/usr/bin/env python
                                            # -*- coding: utf-8 -*-
                                            
                                            import sys
                                            
                                            for line in sys.stdin:
                                            
                                                # Replace tool changing commands by part changing tags
                                                if line.startswith('T'):
                                                    num = int(line[1:])
                                                    print "; part %d\n; process %d" % (num, num)
                                            
                                                else:
                                                    args = line.split()
                                            
                                                    # Only keep tool 0 temperature commands
                                                    if line.startswith('M104') or line.startswith('M109'):
                                                        args = line.split()
                                                        num = int(args[2][1:])
                                                        if num == 0:
                                                            print line,
                                            
                                                    # Default commands
                                                    else:
                                                        print line,
                                            

                                            It replaces tool changing commands:

                                            Tn
                                            

                                            by:

                                            ; part n
                                            ; process n
                                            

                                            It also remove all temperature commands of tools >= 1.

                                            To use it:

                                            $ ./tool_parser.py <input.gcode >output.gcode
                                            

                                            PS: I only checked Slic3r output; Cura output may need additional stuff.

                                            Frédéric

                                            wilrikerundefined 1 Reply Last reply Reply Quote 2
                                            • First post
                                              Last post
                                            Unless otherwise noted, all forum content is licensed under CC-BY-SA