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

      like this?

      ;in Tpre of T0
      M559 P"Toolselected.g"
      T0
      M29 
      
      ;in Tfree of T0 (or alternative write "nothing into the file")
      M30 P"Toolselected.g"
      
      
      ;At end of config.g (maybe this will throw an error if there is no such file)
      M98 P"Toolselected.g"
      

      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

        so this method is not working. After M559 the M29 is not recognized

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

          Could s.o. please assist me?

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

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

            After M559 the M29 is not recognized

            Do you get any error messages or what specifically happens?

            what firmware version are you using?

            Z-Bot CoreXY Build | Thingiverse Profile

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

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

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

              After M559 the M29 is not recognized

              Do you get any error messages or what specifically happens?

              what firmware version are you using?

              @Phaedrux thank you for your reply

              when i put the commands into the console the file is created (with 0B) but nothing is written to it. Every command I put in the console is just ignored and not executed. I don't get any error messages:

              fe2ce4e0-e5fa-4817-af32-8aa7c25563ec-grafik.png

              136a975d-48ea-4ce8-ba7c-47a1e17ba73d-grafik.png

              When I try to delete the file it says that is still open (even after the M29) so i need to shut down the printer: 2aad23ef-d58d-4186-acf1-e07453489942-grafik.png

              If I run it in a macro nothing seems to happen. After multiple M29's i get this message:
              eec2ce92-d56c-451c-9cdf-efbe7319e059-grafik.png

              FW:
              Board: Duet 2 WiFi (2WiFi)
              Firmware: RepRapFirmware for Duet 2 WiFi/Ethernet 3.1.0 (2020-05-15b1)
              Duet WiFi Server Version: 1.23

              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
              • dc42undefined
                dc42 administrators
                last edited by dc42

                @taconite, are you running a Duet in standalone mode, or with attached SBC?

                PS - this works for me:

                if state.currentTool==0
                  M560 P"/sys/SetTool.g"
                  T0
                  <!-- **EoF** -->
                elif state.currentTool==1
                  M560 P"/sys/SetTool.g"
                  T1
                  <!-- **EoF** -->
                else
                  M560 P"/sys/SetTool.g"
                  T-1
                  <!-- **EoF** -->
                

                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
                • Phaedruxundefined
                  Phaedrux Moderator @taconite
                  last edited by

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

                  3.1.0

                  Upload this zip file to the system tab to update to 3.2

                  https://github.com/Duet3D/RepRapFirmware/releases/download/3.2/Duet2and3Firmware-3.2.zip

                  Z-Bot CoreXY Build | Thingiverse Profile

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

                    Sorry for the late reply. I updated to 3.2. and it seems I found an error - but need to investigate it further.

                    @dc42 You are correct. This is absolutly working - the file is created. The only thing that is not working - and I kind of feel stupid about it. When I try to run the Macro e.g. M98 - it just says "Changing tool" but nothing is happening. Normally when I just select the tool manually it is set 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

                    Phaedruxundefined 2 Replies Last reply Reply Quote 0
                    • taconiteundefined
                      taconite
                      last edited by

                      Any idea why this is happening?

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

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

                        and it seems I found an error - but need to investigate it further.

                        What did your investigation turn up?

                        Z-Bot CoreXY Build | Thingiverse Profile

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

                          @Phaedrux Oh sry totally forgot about that. I thought I found a bug in 3.2 and rolled back to 3.1.0 but it happens in both.

                          When the printer is doing a long travel move that is part of the purging it seems like (need to measure it to prove it) the voltage of the power supply is dropping and therefore one GPIO pin of the Duex5 I am using is toggeling from 1 --> 0 --> 1 in a very short period of time and therefore a relay is switched on which is driving the lock mechanism of the tool change.
                          I reduced the speed of the travel move and now it happens very rarely. That is the only reason I could come up with.

                          But has nothing to do with the original topic (but I thought it may have because I just recognized it when going to 3.2)

                          But the running of the macro is still not working. It just tells me in DWC "changing Tool" but nothing happens

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

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

                            When I try to run the Macro e.g. M98 - it just says "Changing tool" but nothing is happening. Normally when I just select the tool manually it is set active

                            Is the macro exactly like the one shown by dc42?

                            Z-Bot CoreXY Build | Thingiverse Profile

                            1 Reply Last reply Reply Quote 0
                            • Depundefined
                              Dep @dc42
                              last edited by

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

                              A variable would only solve that if it was persistent between power cycles.

                              On my tool changer I avoid the need for additional wires and inputs on the main board by using a tool board for each tool, and connecting the dock sense switches to those.

                              If you have a spare analog input, you could use that for the effector docking sensor, and use different value resistors on each tool.

                              This is a fun way! How can you read the value of a resistor?

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

                                @Phaedrux I made a little picture - hope this makes it a bit more clear

                                Tool_at_startup.png

                                @Dep You are not reading the value of a resistor but you are creating a voltage divider with the internal resistor which is scaling the resistor value to a voltage between 0 and 5 V.

                                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
                                  do you have an idea?
                                  btw. the macro "toolchange_set_tool" is called in tfree aswell

                                  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 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
                                            • First post
                                              Last post
                                            Unless otherwise noted, all forum content is licensed under CC-BY-SA