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

Read Gcode File backwards

Scheduled Pinned Locked Moved Unsolved
Firmware wishlist
4
9
364
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.
  • undefined
    amimafe
    last edited by 20 Sept 2024, 07:16

    Hi,

    I want to make a macro for Duet2 that allows me to read the lines of a gcode file in reverse.
    I have seen that with the M110 command you can know and establish the gcode line, but I don't know how I could implement it.
    Any idea how I could do it?

    Thank you!

    undefined 1 Reply Last reply 20 Sept 2024, 08:24 Reply Quote 0
    • undefined amimafe marked this topic as a question 20 Sept 2024, 07:30
    • undefined
      oliof @amimafe
      last edited by 20 Sept 2024, 08:24

      @amimafe probably easier to process Gcode files on a computer. Also its not clear what the goal if this 3xercise is since some actions are order dependent and just reversing the gcode file wont necessarily work (for example, if it were a 3d printer, the start and end gcodes, or retracts/unretracts).

      <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

      undefined 1 Reply Last reply 20 Sept 2024, 11:55 Reply Quote 0
      • undefined
        amimafe @oliof
        last edited by 20 Sept 2024, 11:55

        Hi @oliof ,

        What I want is that if at some point the 3D printer stops extruding I can pause, go back to the gcode position where the failure occurred and continue printing.
        The material I print with is not plastic and I need that the correction can be done quickly without the need to modify the gcode.
        With industrial PLC it can be implemented more easily, but I would like to know if it could be done with duet or object language.

        Thank you.

        undefined 1 Reply Last reply 21 Sept 2024, 00:56 Reply Quote 0
        • undefined Phaedrux moved this topic from Gcode meta commands 20 Sept 2024, 21:09
        • undefined
          OwenD @amimafe
          last edited by 21 Sept 2024, 00:56

          @amimafe
          The firmware essentially already does that.
          You just need to monitor your extruder and trigger a pause when it's not extruding.
          As you've given no details on what you're "extruding" or how you're doing it, it's impossible for anyone to offer any more than equally vague answers.

          There is no facility in RRF currently to reverse along previous moves to a point.
          That would be the domain of external software which streams gcode to the duet in individual strings.
          It is relatively common in plasma cnc cutting controllers for example, but there is no extrusion at play there.
          You can use the object model to get the current file position in bytes, but I don't see any way in a macro to extract lines from the job file and pass them as movement commands.
          You also have the issue of having to work out what to do with the extruder moves. Do you want the extruder reversing at each move?
          What about I/O's, fan or heater commands?
          Far better to identify a fault and pause immediately as is already implemented.

          undefined 1 Reply Last reply 21 Sept 2024, 08:56 Reply Quote 0
          • undefined
            marzubus
            last edited by marzubus 21 Sept 2024, 05:39

            It might help if you use Pause / G60 to save a position when you detect a failure using an appropriate sensor for your extruder, such as optical or AI camera or whatever.

            Then you can use G0 and a R parameter to restore the position when you resume print. Note if you pause, it will automatically save the last position of the extruder, and resume from there. So you might already have all you need for free.

            Then it all comes down to fast detection of the failure, and even adding extra purge at start to maybe fill in any gaps that can be cleaned up post production.

            undefined 1 Reply Last reply 21 Sept 2024, 08:58 Reply Quote 0
            • undefined
              amimafe @OwenD
              last edited by 21 Sept 2024, 08:56

              Sorry @OwenD ,

              Yes, I hadn't mentioned that. It is a clay printer. I'm going to check what you told me about the G60 and see if this could be solved, although I think it is not exactly the initial idea.

              Gracias.

              1 Reply Last reply Reply Quote 0
              • undefined
                amimafe @marzubus
                last edited by 21 Sept 2024, 08:58

                Hi @marzubus

                Thank you for your help.
                I'm going to look into the G60 instruction to see if it can be of any help to me.

                Thanks again

                undefined 1 Reply Last reply 21 Sept 2024, 12:17 Reply Quote 0
                • undefined
                  marzubus @amimafe
                  last edited by 21 Sept 2024, 12:17

                  @amimafe If you save a position, check G0/G1 for the R parameter to move back to that position, you can also use offsets to for example move to a Z pos above the previous pos, and then move down into that position.

                  undefined 1 Reply Last reply 31 Dec 2024, 09:47 Reply Quote 0
                  • undefined
                    amimafe @marzubus
                    last edited by 31 Dec 2024, 09:47

                    @marzubus

                    I have been testing with the G60 command and have obtained good results.
                    Now I have the following problem:
                    With G60 I go back to a saved position and manage to go back, but when I run resume.g the printer returns to the coordinates where it paused and not at the G60 position.
                    I have checked both in the Gcode commands and in the Object model to see if there is any option to update the coordinates before executing resume.g but I have not found anything.

                    Any ideas or suggestions on this?

                    Thanks

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