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

      Hey guys,

      because I have a Delta Printer (D-PATCH) with several tools I would like to determine on startup which tool is in the effector. In the "normal" programming world I would use a remanent integer variable and assign a number to it in all "pre"-Macros. On statup I would check for the number and run a pre-Macro according to that.

      Does anyone has a idea how I could achieve that?

      Best Regards
      Adrian

      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 dc42

        At startup, no tool is selected unless you include a T command near the end of config.g.

        In RepRapFirmware 3 you can access the current tool for the object model, it's in "state.currentTool". A negative value indicates that no tool is selected.

        Edit: on re-reading your post, I think you may be asking asking to determine in a tool changer whether a tool is loaded, and if so, which one. To determine that, you will need to have a docking switch on each tool, either to indicate that it is docked on the effector, or alternatively to indicate that it is parked (if it is not parked you may infer that it is docked to the effector). This is what I do on my E3D tool changer.

        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

          Thank you for your reply. I need to rephrase the question.
          Let's imagine 1 Tool (e.g. Tool 0) is selected and in the effector. When a emergency stop is triggered or a powerloss or the print is finished without parking the tool and the printer is power cycled, the printer doesn't know that Tool 0 is still in the effector and therefore thinks that it is empty. If now the user is selecting a tool a crash may occur.

          I have one sensor at the effector to check wether it is empty or not but I don't get any information about what tool is in the effector. I would like to avoid 1 sensor for each tool because I have no endstops or inputs to spare. An easy variable workaround would fix that.

          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

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

            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.

            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

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

              sure but remanent variables would fix that.
              Mh possible but to be honest I would like to avoid using tool boards (as I would like to stick to Duet2 + Duex 5). And a dock sense switch is in my setup just impossible to fit.

              BTW I thought the Duet does only have digital inputs (apart from the Z-probe)

              EDIT: with the analog in idea tools can't change "docking places"

              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

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

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

                BTW I thought the Duet does only have digital inputs (apart from the Z-probe)

                Have you used up all the thermistor inputs?

                EDIT: with the analog in idea tools can't change "docking places"

                Why not?

                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

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

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

                  Have you used up all the thermistor inputs?

                  oh nope I have some spare you are right

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

                  Why not?

                  Let's say Tool 0 (with resistor Value of 1kOhm) is in Docking Station 1 so when the sensor reads the analog value for 1kOhm Tool 0 is parked in Docking station 1. But what is if I interchange the tools and Tool 1 is no long in Docking Station 1 but 3 e.g. if i want to change the setup and interchange tools (just 5 docking station but 10 tools). With a fixed value this is not working.
                  With a fixed/non-volatile/remanent variable the printer doesn't care if it is Tool 0 or Tool 1 because it knows what the last tool was it picked up.

                  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 dc42

                    What I meant was to use an analog 'tool loaded' input on the effector using pogo pins, instead of just a switch. That would allow you to tell which tool is loaded.

                    PS - however, it's also possible to use a single analog input to connect several tool dock switches. Connect all the switches in series, and connect a different value resistor in parallel with each switch.

                    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

                      Yeah I understood what you wanted to say its just only working when Tool 1 will always be at docking station 1 because in the SW the resistor value will be assigned to 1 docking station but I would like to make it independent from that.

                      makes sense, however, I'm afraid I can't fit tool dock switches. That's why I wanted a software solution in the first place.

                      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

                        I guess you could use M559 and M29 in the tpost and tfree files to write a short macro file to SD card when a tool is loaded or unloaded. Then run that macro file at the end of config.g.

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