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

    How can i store last tool , to be used after turn off the Duet?

    Scheduled Pinned Locked Moved
    CNC
    5
    11
    557
    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.
    • CvetanTokovundefined
      CvetanTokov
      last edited by

      Hello,
      i am trying to make my cnc to be able to store last used tool,i mean when i turn off the machine and turn it on , i send T1 comand , but T1 is already in collet, and it just open the collet and drops the tool.So is it possible to make a variable that can i store each time when i pick a tool , i have 5 changeble tools.
      I was trying with global variables , but i can store it in memory , so when i restart the duet ,doesnt remember it.

      cosmowaveundefined o_lampeundefined engikeneerundefined dc42undefined 4 Replies Last reply Reply Quote 0
      • cosmowaveundefined
        cosmowave @CvetanTokov
        last edited by

        @cvetantokov There was a thread about storing counters.
        It can help you to find a way to store your global on sd...
        https://forum.duet3d.com/topic/24880/does-rrf-have-maintenance-counters-timers/5?_=1633414661879

        Mankati FSXT+, DeltaTowerV2, E3D MS/TC

        CvetanTokovundefined 1 Reply Last reply Reply Quote 0
        • CvetanTokovundefined
          CvetanTokov @cosmowave
          last edited by

          @cosmowave it gives me that the page does not exist

          o_lampeundefined 1 Reply Last reply Reply Quote 0
          • o_lampeundefined
            o_lampe @CvetanTokov
            last edited by

            @cvetantokov You can also use the workplace coordinate arrays G54-G59.3 as a workaround.
            You choose one of the variables, overwrite it with the tool number with G10. Then send M500 to store the value in config-override.g
            At next startup you load config-override.g with M501 and the last-tool value is available.

            1 Reply Last reply Reply Quote 0
            • o_lampeundefined
              o_lampe @CvetanTokov
              last edited by

              @cvetantokov said in How can i store last tool , to be used after turn off the Duet?:

              @cosmowave it gives me that the page does not exist

              Here's the right link:

              1 Reply Last reply Reply Quote 0
              • engikeneerundefined
                engikeneer @CvetanTokov
                last edited by

                @cvetantokov the other option (if you have enough IO ports) is to have a switch on each tool dock to check which is missing/loaded. You could then use conditional gcode to run Tx P0 at the end of config.

                Tbh, you could do T0 P0 as an intermediate workaround so you dont drop you tool too 🙂

                E3D TC with D3Mini and Toolboards.
                Home-built CoreXY, Duet Wifi, Chimera direct drive, 2x BMG, 300x300x300 build volume
                i3 clone with a bunch of mods

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

                  @cvetantokov in 3.4beta firmware you can use a form of the echo command to write a command to file that restores the value of a global variable. So this (untested!) scheme or something like it should work:

                  Near the start of each tpost#.g file (or whenever it is that you want to save the current tool number):

                  echo >"restoreToolNumber.g" "set global.currentToolNumber="^state.currentTool
                  

                  Near the end of each tfree#.g file:

                  echo >"restoreToolNumber.g" "set global.currentToolNumber=-1"
                  

                  In config.g:

                  if not exists(global.currentToolNumber)
                    global currentToolNumber=-1
                  M98 P"restoreToolNumber.g"
                  if global.currentToolNumber != -1
                    T{global.currentToolNumber} P0
                  

                  Note, this will write to the SD card every time a tool is loaded or freed. If you do a lot of tool changes, then this will increase wear on the SD card, bringing forward the time when it needs to be replaced.

                  On my tool changer I have docking switches so that the firmware can tell whether a tool is already loaded at power up.

                  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

                  CvetanTokovundefined 1 Reply Last reply Reply Quote 0
                  • CvetanTokovundefined
                    CvetanTokov
                    last edited by CvetanTokov

                    Well it is cnc dental milling machine so it will change up to 5 tools at milling. I hope that will last long with tool storing .The product is for industrial use and it will be in serial production with Duet controller.At this case the tools for each milling are different , and the problem it is when the tool is left in spindle.
                    undefinedIMG_1245.jpeg

                    Yo can see in the right part of image is where the tools are stored , and the ATC Spindle pick's them from the slots.
                    I will try this code and see how it is working.
                    Thank you all for response.

                    1 Reply Last reply Reply Quote 0
                    • CvetanTokovundefined
                      CvetanTokov @dc42
                      last edited by

                      @dc42 i tryed the code, but it gives me erorr that it says : unknown value "not", then i tryed it with deleting "not" after "if"-statement , and put it in "else" statement , it says "unknown value "exists"",because i am in CNC mode i tried with different brackets "(" and "{" but no success.

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

                        @cvetantokov I did say it wasn't tested! Try replacing not by ! in that line. Like this:

                        if {!exists(global.currentToolNumber)}

                        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

                        CvetanTokovundefined 1 Reply Last reply Reply Quote 0
                        • CvetanTokovundefined
                          CvetanTokov @dc42
                          last edited by

                          @dc42 Thank you ,i tryed everithing arangment of brackets excep that you wrote, i manage to make it work without "exists" ,now i will change it , thank you very much.

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