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

    Code to cool the head when I stop?

    Scheduled Pinned Locked Moved
    Tuning and tweaking
    3
    5
    167
    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.
    • zBeebleundefined
      zBeeble
      last edited by

      There are multiple reasons I might find my printer paused. The new filament sensor is one. Regardless of the cause, is there a way I can code a head cooldown (and then heat back up) for suspend/resume?

      OwenDundefined 1 Reply Last reply Reply Quote 0
      • OwenDundefined
        OwenD @zBeeble
        last edited by

        @zBeeble

        You need to look at M568
        https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m568-set-tool-settings

        Before you print use it to set the active and standby temps.

        In pause.g use it to put the tool in standby mode

        In resume.g use it again to put the tool heater in active mode
        Make sure you use M116 after this last step so it waits for the tool to heat up before the print resumes.

        1 Reply Last reply Reply Quote 0
        • achrnundefined
          achrn
          last edited by

          @zBeeble an alternative approach is to have your pause code (probably pause.g) write the temperature of the nozzle heater into a global variable, then switch it off. Your resume code can then read the temperature from the variable and switch it on and wait.

          zBeebleundefined 1 Reply Last reply Reply Quote 0
          • zBeebleundefined
            zBeeble @achrn
            last edited by

            @achrn global variable? This is part of g-code I don't have in my repertoire ... can you paste up an example?

            achrnundefined 1 Reply Last reply Reply Quote 0
            • achrnundefined
              achrn @zBeeble
              last edited by

              @zBeeble If you're needing to figure something out either way, and just wanting to handle printer pausing during print, probably best to use the active and standby approach suggested using M568, but if you were already using variables or have another use case this is an alternative.

              See https://docs.duet3d.com/en/User_manual/Reference/Gcode_meta_commands#variables

              RRF has variables you can write to and then refer to in gcode by putting the name inside {these}. It also has local variables that stay inside one gcode file, useful for loops and things.

              You could have in config.g something to create an empty variable:

              if !exists(global.nozt)
                  global nozt = -1
              

              Which creates a global if it doesn't already exist.

              Then in your pause.g have something like

              set global.nozt = heat.heaters[1].active
              

              before you switch off the tool heater (or switch it to standby) (this assuming your nozzle in the tool is heater 1). Then any subsequent code can know what the temperature had been (by referring to global.nozt) e.g. with G10 P0 S{global.nozt} to switch back on with taht setpoint.

              The advantage this has is if you are doing other things with the temperature besides just standby and resume. I have some physical buttons on my printer which heat and feed filament (mainly when doing a manual colour change and flushing some through), so I want the printer to know the extrusion temperature of the filament currently loaded easily, so I write that into a global variable and use it both when resuming after pausing and when heating the tool (potentially from fully cold) to feed some filament.

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