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

    Return to position gcode

    Scheduled Pinned Locked Moved Solved
    Gcode meta commands
    2
    15
    578
    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.
    • Jeredundefined
      Jered
      last edited by

      Hey guys,
      this might sound like a dumb question, but I just can't seem to figure it out.

      I am trying to create a purge/dump position/ protocol for my machine using gcode, but I can't, for the life of me, figure out how to get my the machine to return to the last Z height position. Or last position before tool change.

      Is there a command/s that allow me to store and recall positions? After a tool change?

      Below is my config, just incase.

      config.g

      Jeredundefined 1 Reply Last reply Reply Quote 0
      • Jeredundefined
        Jered @Jered
        last edited by

        @Jered
        What about using:
        G1 60 XYZ S2
        G1 60 XYZ R2

        ?

        OwenDundefined 1 Reply Last reply Reply Quote 0
        • Jeredundefined
          Jered
          last edited by

          Doesn't seem to work 😞

          1 Reply Last reply Reply Quote 0
          • OwenDundefined
            OwenD @Jered
            last edited by

            @Jered
            When you start a tool change, the positions are stored in slot 2 automatically.
            See G60
            So to get back there use
            G1 R2 X0 Y0 Z0 You probably don't need the XYZ as there's no offset being used
            If you wanted to go to a point 2mm above the Z position use
            G1 R2 X0 Y0 Z2

            Jeredundefined 1 Reply Last reply Reply Quote 0
            • Jeredundefined
              Jered @OwenD
              last edited by

              @OwenD
              So I added that and it looks like it is moving xyz to the 0,0 position every tool change.

              Jeredundefined 1 Reply Last reply Reply Quote 0
              • Jeredundefined
                Jered @Jered
                last edited by

                @Jered
                Z is also going to zero.

                OwenDundefined 1 Reply Last reply Reply Quote 0
                • OwenDundefined
                  OwenD @Jered
                  last edited by

                  @Jered
                  Please post the firmware version you're using and the macro you are calling the tool changes from.
                  Also your tpre*.g tfree*.g tpost*.g files for the two tools

                  Jeredundefined 1 Reply Last reply Reply Quote 0
                  • Jeredundefined
                    Jered @OwenD
                    last edited by

                    @OwenD
                    firmware version 3.3
                    Original macro is:
                    G1 E-5 F5000
                    G91
                    G1 Z2 F1000
                    G90
                    G1 X328 Y306 F6000
                    G1 E10 F300
                    G1 E-30 F5000
                    G1 E-50 F500
                    G1 E-175 F5000
                    {IF NEWTOOL=0}T0
                    {IF NEWTOOL=1}T1
                    {IF NEWTOOL=2}T2
                    {IF NEWTOOL=3}T3
                    {IF NEWTOOL=4}T4
                    {IF NEWTOOL=5}T5
                    {IF NEWTOOL=6}T6
                    G1 E200 F5000
                    G1 E60 F1500
                    G91
                    G1 Y100 E50 F1000
                    G1 Y-100 F3000
                    G1 Z-2 F1000
                    G1 E3 F5000
                    G90

                    I am not using any of the Tool.g files currently. I am using simplify3d's tool change tab to add this to my gcode files. I added the command you sent me to the end of my tool change code to see what would happen.

                    To test the command G1 R command I added an extra 10 to the Z movement at the top of the macro to see if it would return back to the correct Z height. It does not. Just keeps adding.

                    Jeredundefined OwenDundefined 2 Replies Last reply Reply Quote 0
                    • Jeredundefined
                      Jered @Jered
                      last edited by

                      @Jered
                      Firmware now 3.4.5

                      Just upgraded.

                      1 Reply Last reply Reply Quote 0
                      • OwenDundefined
                        OwenD @Jered
                        last edited by

                        @Jered
                        I really don't know anything about S3D or what happens if you don't use the tool change files, but...
                        Try this
                        Note: I don't know if you're using a tool changer so I don't know what you have to do to safely move to and from the pickup point

                        G60 S3 ; save position to slot 3
                        G1 E-5 F5000
                        G91
                        G1 Z2 F1000
                        G90
                        G1 X328 Y306 F6000
                        G1 E10 F300
                        G1 E-30 F5000
                        G1 E-50 F500
                        G1 E-175 F5000
                        {IF NEWTOOL=0}T0
                        {IF NEWTOOL=1}T1
                        {IF NEWTOOL=2}T2
                        {IF NEWTOOL=3}T3
                        {IF NEWTOOL=4}T4
                        {IF NEWTOOL=5}T5
                        {IF NEWTOOL=6}T6
                        G1 E200 F5000
                        G1 E60 F1500
                        G91
                        G1 Y100 E50 F1000 
                        G1 Y-100 F3000
                        G1 Z-2 F1000
                        G1 E3 F5000
                        G90
                        G1 R3 X0 Y0 Z0 ; move back to slot 3 position
                        
                        1 Reply Last reply Reply Quote 0
                        • Jeredundefined
                          Jered
                          last edited by

                          Ok,
                          So when I use:
                          G1 R3 X0 Y0 Z0
                          I think it is causing it to go to 0,0,0 However, when I use:
                          G1 R3 X Y Z (I used your G60 S3 at the top) is seems to work!

                          That being said, the picture of the slicer generates is all kinds of F'd up. See pic bellow:
                          1.jpg

                          Should look like this:
                          2.jpg

                          I decided to run this anyway, with no filament and with a Z offset from the bed (don't want a crash) and it looks right. The slicer doesn't know how to handle the code apparently.

                          I also waited for the layer height to change before sending this.

                          I did have this tool change process in the tool.g files, and it works fine, however, if there is a problem, such as a filament jam, it makes it a pain to recover from. Everytime I click on a different tool, it runs the process. If there was a software switch to turn off the tool.g files for recovering a failed print or jam, then I would move this tool change process to the tool.g files.

                          Anyway, let me test this for a while and get back to you. Seems good though!

                          Ultimate goal is to add a purge/dump area to the printer.
                          I may make a video about this so that you can see more details if needed later.

                          OwenDundefined 1 Reply Last reply Reply Quote 0
                          • OwenDundefined
                            OwenD @Jered
                            last edited by

                            @Jered
                            You can avoid running the tool change macros by using the P0 parameter
                            e.g T1 P0
                            Refer to the docs here

                            Jeredundefined 1 Reply Last reply Reply Quote 0
                            • Jeredundefined
                              Jered @OwenD
                              last edited by

                              @OwenD
                              Thanks,

                              I guess I can write a macro for turning them on and off.

                              OwenDundefined 1 Reply Last reply Reply Quote 0
                              • OwenDundefined
                                OwenD @Jered
                                last edited by

                                @Jered
                                You don't "turn it off"
                                You need to use the P0 parameter on every tool change where you don't want to run the tool change macros.
                                If you did this ....
                                T1 P0 ; select tool 1 but don't run the tool change macros
                                T0 ; select tool zero and run tool change macros
                                T-1 ; deselect all tools and run tool change macros
                                T0 P0 ; select tool 0 but don't run tool change macros

                                1 Reply Last reply Reply Quote 1
                                • Jeredundefined
                                  Jered
                                  last edited by

                                  I understand. I think this can be closed. I get it now.

                                  I really appreciate your help!

                                  You guys are the best!

                                  1 Reply Last reply Reply Quote 1
                                  • Phaedruxundefined Phaedrux marked this topic as a question
                                  • Phaedruxundefined Phaedrux has marked this topic as solved
                                  • First post
                                    Last post
                                  Unless otherwise noted, all forum content is licensed under CC-BY-SA