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

    Which tool is enabled after startup?

    Scheduled Pinned Locked Moved Solved
    General Discussion
    7
    46
    2.2k
    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.
    • Phaedruxundefined
      Phaedrux Moderator @taconite
      last edited by

      @taconite Sorry, to be honest I'm not even sure what you're trying to do. 😓

      Z-Bot CoreXY Build | Thingiverse Profile

      1 Reply Last reply Reply Quote 0
      • taconiteundefined
        taconite
        last edited by

        @Phaedrux
        haha okay no problem 😉
        I will try to rephrase it.
        I have a Delta with automatic toolchanging so assuming Tool 1 is in the effector after a power cycle (e.g. after emergency stop or manual off/on) I need to know that Tool 1 is in the effector and not tool 0 or n to avoid collision. Therefore I would like to store this information in a macro that is executed after startup.
        The information (which tool is currently enabled) is written in a macro (tool_active) by a macro (toolchange_set_tool) which is called from the Tool macros (tfree and tpost) (tfree to tell the tool_active macro that no tool is enabled and tpostX to write into the macro that tool X is enabled).

        I have no change to use tool docking endstops because how the tools are parked. That's why I wanted to use a software solution.

        I hope this makes it a little clearer

        Custom ANET A8
        Custom Delta: D-PATCH (Delta Printer with Automatic Tool CHanging) https://forum.duet3d.com/topic/16082/d-patch?_=1596131234754

        All I do here is under this license: CC BY-NC-SA

        1 Reply Last reply Reply Quote 0
        • Phaedruxundefined
          Phaedrux Moderator
          last edited by

          Yes, that part I gather. I don't understand why the macro writing isn't working for you. Can you post the exact files you are using?

          Z-Bot CoreXY Build | Thingiverse Profile

          1 Reply Last reply Reply Quote 0
          • taconiteundefined
            taconite
            last edited by

            toolchange_set_tool

            if state.currentTool==0
            	M560 P"/sys/tool_active"
            	T0
            	<!-- **EoF** -->
            elif state.currentTool==1
            	M560 P"/sys/tool_active"
            	T1
            	<!-- **EoF** -->
            elif state.currentTool==2
            	M560 P"/sys/tool_active"
            	T2
            	<!-- **EoF** -->
            elif state.currentTool==2
            	M560 P"/sys/tool_active"
            	T3
            	<!-- **EoF** -->
            elif state.currentTool==4
            	M560 P"/sys/tool_active"
            	T4
            	<!-- **EoF** -->
            else
            	M560 P"/sys/tool_active"
            	<!-- **EoF** -->
            

            tfree0.g

            ...
            M98 P"toolchange_set_tool"
            

            tpost0.g

            ...
            M98 P"toolchange_set_tool"
            

            e.g. tool_active (The T1 is indent because of how the macro toolchange_set_tool is built)

            	T1
            

            in config.g last command

            M98 P"tool_active"
            

            Custom ANET A8
            Custom Delta: D-PATCH (Delta Printer with Automatic Tool CHanging) https://forum.duet3d.com/topic/16082/d-patch?_=1596131234754

            All I do here is under this license: CC BY-NC-SA

            1 Reply Last reply Reply Quote 0
            • taconiteundefined
              taconite
              last edited by

              @Phaedrux
              The core problem is, that when I run a macro that has e.g. only a "T0" command in there - the tool is not activate.
              So the base question is: What happens in the background if I click "Tool0" in DWC or on Panel due? Because then the Tool is set active and the tpre0.g macro runs

              Custom ANET A8
              Custom Delta: D-PATCH (Delta Printer with Automatic Tool CHanging) https://forum.duet3d.com/topic/16082/d-patch?_=1596131234754

              All I do here is under this license: CC BY-NC-SA

              Phaedruxundefined 1 Reply Last reply Reply Quote 0
              • Phaedruxundefined
                Phaedrux Moderator @taconite
                last edited by

                @taconite said in Which tool is enabled after startup?:

                So the base question is: What happens in the background if I click "Tool0" in DWC or on Panel due? Because then the Tool is set active and the tpre0.g macro runs

                When using the DWC or Panel to select a tool it would be the same as sending the tool command itself and would behave as described here: https://duet3d.dozuki.com/Wiki/Gcode#Section_T_Select_Tool

                Z-Bot CoreXY Build | Thingiverse Profile

                1 Reply Last reply Reply Quote 0
                • taconiteundefined
                  taconite
                  last edited by

                  @Phaedrux Makes total sense but why is there a different behavior?
                  see:
                  https://youtu.be/cAUnC5YKdW8

                  Custom ANET A8
                  Custom Delta: D-PATCH (Delta Printer with Automatic Tool CHanging) https://forum.duet3d.com/topic/16082/d-patch?_=1596131234754

                  All I do here is under this license: CC BY-NC-SA

                  1 Reply Last reply Reply Quote 0
                  • taconiteundefined
                    taconite
                    last edited by

                    @Phaedrux @dc42 can you explain the different behavior?

                    I am running FW 3.2

                    Custom ANET A8
                    Custom Delta: D-PATCH (Delta Printer with Automatic Tool CHanging) https://forum.duet3d.com/topic/16082/d-patch?_=1596131234754

                    All I do here is under this license: CC BY-NC-SA

                    1 Reply Last reply Reply Quote 0
                    • Phaedruxundefined
                      Phaedrux Moderator
                      last edited by

                      Thanks for the video, I'm not sure what is going on under the hood here. Hopefully DC42 can get a chance to look more closely soon.

                      Z-Bot CoreXY Build | Thingiverse Profile

                      1 Reply Last reply Reply Quote 0
                      • taconiteundefined
                        taconite
                        last edited by

                        @dc42 any idea of the behavior?

                        Custom ANET A8
                        Custom Delta: D-PATCH (Delta Printer with Automatic Tool CHanging) https://forum.duet3d.com/topic/16082/d-patch?_=1596131234754

                        All I do here is under this license: CC BY-NC-SA

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

                          A macro containing just a T0 or T1 command works for me. Tested on two machines.

                          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
                          • taconiteundefined
                            taconite
                            last edited by

                            @dc42 okay this is super strange
                            have you had a look at the video?
                            I will try it again but just have no idea why that is

                            Custom ANET A8
                            Custom Delta: D-PATCH (Delta Printer with Automatic Tool CHanging) https://forum.duet3d.com/topic/16082/d-patch?_=1596131234754

                            All I do here is under this license: CC BY-NC-SA

                            1 Reply Last reply Reply Quote 0
                            • taconiteundefined
                              taconite
                              last edited by

                              holy moly! I finally made it work. Thank you for all your support. In my tpreX.g macros I had an abort command which aborted the tool change when there was still a tool in the effector. I removed it and now it is working.

                              The strange thing is that it was working when manually selecting a tool on PanelDue or on the DWC and I have no idea what kept it from working when running a macro with Tn

                              Custom ANET A8
                              Custom Delta: D-PATCH (Delta Printer with Automatic Tool CHanging) https://forum.duet3d.com/topic/16082/d-patch?_=1596131234754

                              All I do here is under this license: CC BY-NC-SA

                              T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
                              • T3P3Tonyundefined
                                T3P3Tony administrators @taconite
                                last edited by

                                @taconite what was the abort command?

                                www.duet3d.com

                                1 Reply Last reply Reply Quote 0
                                • taconiteundefined
                                  taconite
                                  last edited by taconite

                                  I use the abort command (https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands) to abort things that should not occur (e.g. tool still there after parking) - maybe there is a better way to do that

                                  EDIT: @T3P3Tony

                                  Custom ANET A8
                                  Custom Delta: D-PATCH (Delta Printer with Automatic Tool CHanging) https://forum.duet3d.com/topic/16082/d-patch?_=1596131234754

                                  All I do here is under this license: CC BY-NC-SA

                                  1 Reply Last reply Reply Quote 0
                                  • T3P3Tonyundefined
                                    T3P3Tony administrators
                                    last edited by

                                    @taconite so you had some "if <expression> ... abort" logic to check for certain conditions and then abort if they were true or false? Maybe the issue was the expression was evaluating to true (or false) when it should not have been.

                                    www.duet3d.com

                                    1 Reply Last reply Reply Quote 0
                                    • taconiteundefined
                                      taconite
                                      last edited by

                                      I had it this way (tpre.g)

                                      if no tool in effector
                                            pick tool
                                      	
                                      else {}
                                      	display message "Sill tool in effector"
                                      	abort
                                      
                                      

                                      I removed the abort. Everything was correct but the execution of a macro with a Tpren.g just did not work with the abort

                                      Custom ANET A8
                                      Custom Delta: D-PATCH (Delta Printer with Automatic Tool CHanging) https://forum.duet3d.com/topic/16082/d-patch?_=1596131234754

                                      All I do here is under this license: CC BY-NC-SA

                                      1 Reply Last reply Reply Quote 0
                                      • jay_s_ukundefined
                                        jay_s_uk
                                        last edited by

                                        @taconite try it with break rather than abort

                                        Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                                        1 Reply Last reply Reply Quote 0
                                        • K01571N3Nundefined
                                          K01571N3N
                                          last edited by K01571N3N

                                          Hi, this is what i have been thinking and i need this for my toolchanger.
                                          Duet 3 6HC, 3HC and Raspberry pi.

                                          If i write to console

                                          M560 P"0:/sys/test"
                                          

                                          or run macro like that

                                          M560 P"/sys/test"
                                          <!-- **EoF** -->
                                          

                                          or whatever else, "Error: M560: Can't open file test for writing" appears...

                                          If i write

                                          M98 P"0:/sys/test
                                          

                                          it will run that macro.

                                          Is Raspberry pi somehow causing the trouble here or what?

                                          K01571N3Nundefined 1 Reply Last reply Reply Quote 0
                                          • K01571N3Nundefined
                                            K01571N3N @K01571N3N
                                            last edited by

                                            @dc42 @T3P3Tony Do you have any idea for my problem?

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