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

    Select a default tool in a toolchanger arrangement

    Scheduled Pinned Locked Moved
    Gcode meta commands
    5
    10
    363
    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.
    • Mike 1undefined
      Mike 1
      last edited by

      Hello
      I am using PrusaSlicer as my standard slicing tool for my toolchanger. If I do not select a specific tool the printer starts printing with the end stop swich for the z-axis and kills it.
      The firmware complains, that extuding is not possible, but continues the job.
      Right now I fix it with this start code which causes other issues in the startup process:

      if state.currentTool = -1                     ;check if a tool selected  code added because slicer does not select T0 at the very beginning
        T0
      

      Is there another way to stop the print or use T0 as the standard tool?

      Thanks!
      Mike

      fcwiltundefined dc42undefined 2 Replies Last reply Reply Quote 0
      • fcwiltundefined
        fcwilt @Mike 1
        last edited by

        @Mike-1

        Well one of the first things I did was add a micro-switch to the changer which would signal when a tool was actually mounted.

        This helped a lot as the state (mounted/not mounted) was known at all times, separate from the firmware keeping track of what tool commands were executed.

        I don't know that slicer well but I think it should be inserting a tool command.

        Frederick

        Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

        Mike 1undefined 1 Reply Last reply Reply Quote 0
        • Mike 1undefined
          Mike 1 @fcwilt
          last edited by

          @fcwilt
          I am using PrusaSlicer 2.9.1. and i regularly forget to select a tool.
          Unfortunately the custom gcode starts before a tool is selected in the gcode. So a tool is picked up every time for no reason. A switch would unfortunately not work for the same reason. Or do I miss something?
          Mike

          fcwiltundefined 2 Replies Last reply Reply Quote 0
          • fcwiltundefined
            fcwilt @Mike 1
            last edited by

            @Mike-1 said in Select a default tool in a toolchanger arrangement:

            @fcwilt
            I am using PrusaSlicer 2.9.1. and i regularly forget to select a tool.
            Unfortunately the custom gcode starts before a tool is selected in the gcode. So a tool is picked up every time for no reason. A switch would unfortunately not work for the same reason. Or do I miss something?
            Mike

            I will take a look at the startup code the slicer generates.

            In the past, for other slicers, I have had to pick certain options to get the code I need.

            Frederick

            Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

            1 Reply Last reply Reply Quote 0
            • fcwiltundefined
              fcwilt @Mike 1
              last edited by

              @Mike-1

              OK here is the startup code from 2.9.1. Notice the first thing it does is call print_begin.g which is my code to begin the print.

              What are you seeing from 2.9.1?

              ; generated by PrusaSlicer 2.9.1 on 2025-03-15 at 08:07:23 UTC
              
              ; 
              
              ; external perimeters extrusion width = 0.45mm
              ; perimeters extrusion width = 0.45mm
              ; infill extrusion width = 0.45mm
              ; solid infill extrusion width = 0.45mm
              ; top infill extrusion width = 0.40mm
              ; first layer extrusion width = 0.42mm
              
              ;TYPE:Custom
              M98 P"print_begin.g"
              G21 ; set units to millimeters
              G90 ; use absolute coordinates
              M82 ; use absolute distances for extrusion
              G92 E0
              M98 P"print_filament_change_begin.g"
              
              M107
              ;LAYER_CHANGE
              ;Z:0.35
              ;HEIGHT:0.35
              G1 E-2 F2400
              G92 E0
              G1 Z.35 F7800
              G1 X21.124 Y-.893
              G1 E2 F2400
              ;TYPE:Skirt/Brim
              ;WIDTH:0.42
              

              Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

              oliofundefined 1 Reply Last reply Reply Quote 0
              • oliofundefined
                oliof @fcwilt
                last edited by

                You could add T0 P0 at the end of config.g to have a default tool selected, or in start.g which is executed before the gcode file (P0 to avoid running the pre and post macros, so leave out if you want to but at the end of config.g without being homed it'll likely throw an error).

                <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

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

                  @Mike-1 I set up my toolchanger as multiple printers in PrusaSlicer. For example I have a printer called E3D Tool Changer using tool 2. Then in Custom GCode for that printer I have this in the Start GCode section:

                  M140 S[bed_temperature]
                  G10 P2 S[first_layer_temperature]
                  T2
                  M116
                  

                  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
                  • mikeabuilderundefined
                    mikeabuilder
                    last edited by

                    I recently went through this exact thing with my multi-tool printer. I discovered that with Prusa Slicer and multiple tools, if you use only tool 1 (tool number in slicer number = RRF tool0), Prusa slicer does not include a T0 in it's output. But if you use any other tool as the only tool, or if you use multiple tools, then T0 is included in the gcode. I added the following to my printer's custom gcode:

                    ; set the tool if only the first extruder is used
                    {if is_extruder_used[0] and not is_extruder_used[1] and not is_extruder_used[2]}T0{endif}
                    

                    And while I'm sharing, I also include the following to set tool active and standby temperatures only when the tools are used:

                    ;Set standby temperatures for extruders that are used in this print
                    {if is_extruder_used[0]} M568 A1 P0 R{temperature[0] -5}{endif}
                    {if is_extruder_used[1]} M568 A1 P1 R{temperature[1] -5}{endif}
                    {if is_extruder_used[2]} M568 A1 P2 R{temperature[2] -5}{endif}
                    

                    Note that in the user interface Prusa refers to extruders starting with #1, but in their gcode output, they start numbering at 0.

                    Mike 1undefined 1 Reply Last reply Reply Quote 1
                    • Mike 1undefined
                      Mike 1 @mikeabuilder
                      last edited by Mike 1

                      @mikeabuilder said in Select a default tool in a toolchanger arrangement:

                      ; set the tool if only the first extruder is used
                      {if is_extruder_used[0] and not is_extruder_used[1] and not is_extruder_used[2]}T0{endif}

                      Thanks! That's what I have been looking for!
                      Now it works, as if prusa would add T0 to their gcode.
                      The issue with T0 or T1 as a first tool is really annoying.

                      Thanks to the others for the great support:-)

                      Mike 1undefined 1 Reply Last reply Reply Quote 0
                      • Mike 1undefined
                        Mike 1 @Mike 1
                        last edited by

                        @Mike-1
                        Oh no, it crashed my z-offsets. But why? I implemented it it in the start gcode

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