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

Tool Change Script, Conditional Tool Change

Scheduled Pinned Locked Moved Unsolved
Gcode meta commands
2
13
654
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.
  • undefined
    NeueKlasse
    last edited by 19 Mar 2021, 23:32

    Thank you, that should work,

    The Problem with tpre0/1 and tpost0/1
    is that everytime i change the tool it‘ll do
    The code. I want to switch that on or off...
    (Single nozzle don‘t need that, dual nozzle operation does.)

    I‘m sure the T0 in the config.g file executes
    It at the startup. I’ll test that tomorrow.

    In the start gcode i have t1,t0 a few times for
    The nozzles to heat up at the same time.
    Because:
    M104 P0 S230
    M104 P1 S230

    Does only start heating from tool0?!?!!?!

    I had to write:
    T0
    M104 P0 S230
    T1
    M104 P0 S230
    T0

    (And the same toolchange for the 2 introlines,
    To save time)

    Prusa Mini, Chiron @ BMG X2
    Metal SLS Printer Development

    undefined 1 Reply Last reply 19 Mar 2021, 23:37 Reply Quote 0
    • undefined
      OwenD @NeueKlasse
      last edited by 19 Mar 2021, 23:37

      @NeueKlasse
      T1 P0 would change tools without running any macros

      undefined 1 Reply Last reply 20 Mar 2021, 07:43 Reply Quote 0
      • undefined
        NeueKlasse @OwenD
        last edited by 20 Mar 2021, 07:43

        @OwenD
        Oh ok, that’s a nice information!

        Do you know, is it possible to calculate temperatures?

        For example if tool0 temp is > than 200 degree
        Set actual tool0 temperature -20 degree

        Prusa Mini, Chiron @ BMG X2
        Metal SLS Printer Development

        undefined 1 Reply Last reply 20 Mar 2021, 09:43 Reply Quote 0
        • undefined
          OwenD @NeueKlasse
          last edited by 20 Mar 2021, 09:43

          @NeueKlasse
          Yes, you can monitor most things.
          I'm not sure if you mean lower the temp by 20 degrees, or set it to minus 20 degrees.
          if you only have one tool heater for both tools (like on a chimera hot end) then just use something like this (note M104 is deprecated, so I used G10)

          if heat.heaters[1].current > 200
          G10 P1 R140 S180 ;set standby to 140 and active temperature to 180 for tool 1

          You mention start Gcode. I presume you mean in the slicer.
          Most slicers won't allow indenting, so to heat up both heaters you have to do something like you have done.

          G10 P0 R140 S205 ;set standby and active temp on tool 0
          G10 P1 R140 S205 ;set standby and active temp on tool 1
          T1 P0 ; select tool 1 to start it heating
          T0 P0 ; select tool 0 (will set tool 1 to standby and heat tool 0)
          M116 ; wait for heating to finish

          If you're working in a macro you can do something like this

          while iterations < #tools
          G10 P{iterations} R140 S205 ;set standby and active temp
          T{iterations} P0; set the tool to active to begin heating but don't run macro
          M116 ;wait for heating to finish
          ; this would leave tool 1 selected
          T-1 P0; set both tools to standby
          undefined 1 Reply Last reply 20 Mar 2021, 16:24 Reply Quote 0
          • undefined
            NeueKlasse
            last edited by 20 Mar 2021, 15:51

            Thank you very much for the Help,

            i mean Lower the Actual Temperature by 20 degrees (Regardless which Temperature is
            setted as long the Temperature is above 200 degrees)
            => i need that to simplify the Wipe Routine within the Toolchange Scripts (tpre tpost)

            so that the Slicer Toolchange Script has to go...

            Prusa Mini, Chiron @ BMG X2
            Metal SLS Printer Development

            1 Reply Last reply Reply Quote 0
            • undefined
              NeueKlasse @OwenD
              last edited by NeueKlasse 20 Mar 2021, 16:24

              @OwenD
              i tried following Gcode:

              ; tpost0.g
              ; called after tool 0 has been selected
              ;
              ; generated by RepRapFirmware Configuration Tool v3.1.4 on Sun Nov 15 2020 19:31:40 GMT+0100 (Mitteleuropäische Normalzeit)
              ; Wait for set temperatures to be reached
              if heat.heaters[0].current > 200
              if !move.axes[0].homed
              echo "X-Axis not homed, homing X first"
              G28 X0
              G1 X390 F10000
              G1 X380 F5000
              G1 X390 F5000
              G1 X380 F5000
              G1 X390 F5000
              G1 X380 F5000
              M116 P1
              G1 X380 F5000
              G1 X390 F5000
              G1 X380 F5000
              G1 X390 F5000
              G1 X380 F5000
              else
              M117 "wait for Temperatures"
              M116 P0

              the Console gets following warning:

              T0
              Warning: both space and tab characters used to indent blocks by line 8

              Why?, it seems formatting but each IF is one TAB inside..

              The Printer should only Wipe if the Temperature is above 200 degree
              and M116 P1 is to wait for Tool 1 to cool down before wipe the excess off
              and if needed (to prevent crashing) to home X

              => if T0 gets selected the Printer Moves X to the Maxima to wipe T1 Clean while
              cooling down.
              (and the Same mirrored if T1 gets selected)

              Prusa Mini, Chiron @ BMG X2
              Metal SLS Printer Development

              undefined 1 Reply Last reply 20 Mar 2021, 20:17 Reply Quote 0
              • undefined
                OwenD @NeueKlasse
                last edited by 20 Mar 2021, 20:17

                @NeueKlasse
                The warning is just what it says.
                If you go to the start of each indented line and hit delete you will find one with spaces instead of tabs.

                On another note, heat.heaters[0] usually refers to the bed heater.

                Also you should be careful jut putting a fixed value of 200 degrees and waiting till the temp > 200
                What if you need to print at 190?

                Simply using M116 P0 would achieve your goal in a tool change.

                undefined 1 Reply Last reply 20 Mar 2021, 20:26 Reply Quote 1
                • undefined
                  NeueKlasse @OwenD
                  last edited by NeueKlasse 20 Mar 2021, 20:26

                  @OwenD

                  I choose 100 degree (just to be sure the tool is warm) (otherwise the printer knows that it runs just with tool0 single nozzle)

                  Yes you’re right i need heater 1 and 2

                  I think i found the problem
                  RRF doesn’t like
                  A indented if statement in an if statement...
                  I turned that into one if statement and it works.

                  I don’t know if it is right here but another problem is the heatup after the standby temperature... when the tool is active again.
                  It overshoots about 10 degree.
                  I’ve done the autocal. But it’s still to “aggressive”
                  It needs to be more “defensive” with small heatups (with 20-30 degree delta)

                  Prusa Mini, Chiron @ BMG X2
                  Metal SLS Printer Development

                  undefined 1 Reply Last reply 20 Mar 2021, 20:36 Reply Quote 0
                  • undefined
                    OwenD @NeueKlasse
                    last edited by 20 Mar 2021, 20:36

                    @NeueKlasse
                    You can have as many nested IF statements as you want.
                    You just can't have both spaces and TABS in your indentation.
                    Some editors will convert the tab to spaces if you hit enter on an indented line.
                    That is to say, the new line will look correctly indented, but it has spaces instead of a tab.

                    undefined 1 Reply Last reply 21 Mar 2021, 10:28 Reply Quote 0
                    • undefined
                      NeueKlasse @OwenD
                      last edited by 21 Mar 2021, 10:28

                      @OwenD

                      I think it is not correctly formatted here in the post,

                      I set everything on the left and
                      Indented the second if with tab and the commands within one tab further....

                      But i still get this warning.

                      No space is in the indention.

                      Prusa Mini, Chiron @ BMG X2
                      Metal SLS Printer Development

                      1 Reply Last reply Reply Quote 0
                      • undefined
                        NeueKlasse
                        last edited by NeueKlasse 23 Mar 2021, 17:03

                        My Toolchange script now Cools down
                        the Old tool before Selecting the New One (tpre, tpost)

                        the tpost code:

                        if heat.heaters[1].current > 100 && move.axes[0].homed = true
                        G1 X-5 F15000
                        while heat.heaters[1].current <= heat.heaters[1].active
                        G1 X-13 F1000
                        G4 S2
                        G1 X-5
                        if heat.heaters[1].current >= heat.heaters[1].active
                        break
                        G1 X-13 F1000
                        G4 S2
                        G1 X-5
                        G1 X-13
                        G4 S2
                        G1 X-5
                        G1 X-13
                        G4 S2
                        G1 X-5
                        G1 X-13
                        G4 S2
                        G1 X-5
                        G1 X-13
                        G4 S2
                        G1 X-5
                        M116
                        G1 X-13
                        G4 S2
                        G1 X-5

                        is there a Variable that equals to M116 => i want to wipe till the new tool is ready,
                        but i found no boolean in the object browser for it.

                        on the Paneldue i sometimes get the Message
                        M4 command is not supported in machine mode FFF.

                        But i have no M4 Command in it?!

                        Prusa Mini, Chiron @ BMG X2
                        Metal SLS Printer Development

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