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

    How to cancel loading/unloading of filament?

    Scheduled Pinned Locked Moved Solved
    General Discussion
    3
    4
    336
    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.
    • skezoundefined
      skezo
      last edited by skezo

      tl;dr; The move.extruders[].filament value updates even if the macro fails to complete.

      Issue #437 on Github discusses this and it seems the recommended approach is to add a T-1 before any abort command. However, if the user selects "Cancel" after running M291 P"<message>" S3 there does not seem to be away to set the tool to T-1

      Would you have to do something like this?

      T-1 ; disable tool
      M291 P"Feed filament?" S3
      T0  ; reset tool
      

      Is setting T-1 still the recommended approach?

      Any help on this would be greatly appreciated.

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

        @skezo
        It would be helpful to know the conditions that cause the macro to fail or require cancellation.
        However if T-1 stops the filament change in the object model (haven't tested), then you could try something like this (assuming you are running RRF 3.5b)

        EDIT
        I did some testing.
        This should cover most scenarios.

        ;load.g example
        ; requires RRF 3.5b2 or later
        ; if no tool is selected, ask the user to select one
        ; note if filament is loaded from DWC it will default to T0 if no tool is selected, so this won't get run
        
        if state.currentTool = -1
           var toolnumbers = vector(#tools,0)
           while iterations < #tools
              set var.toolnumbers[iterations] = "Tool " ^ iterations
           M291 R"Select Tool" P"A tool must be selected" S4 K{var.toolnumbers} F0
           T{input} ;  use P0 if you want to select tool without running tool change macros
        
        ; ask for confirmation before feeding filament
        M291 R"Confirm" P"Feed filament?" S4 K{"Yes","Abort change",} F0
        if input = 1
           T-1 ;  use P0 if you want to de-select tool without running tool change macros
           M99 ; cancel macro
        
        ; do moves to load filament
        echo "doing moves for loading filament"
        
        skezoundefined 1 Reply Last reply Reply Quote 1
        • skezoundefined
          skezo @OwenD
          last edited by skezo

          @OwenD

          Thanks! I updated to release 3.5 and this approach seems to work well.
          Is there a reason you used M99 over abort?

          Edit:
          If I understand correctly M99 works better here as it does not cancel the current print file. Whereas abort would.

          T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
          • skezoundefined skezo has marked this topic as solved
          • T3P3Tonyundefined
            T3P3Tony administrators @skezo
            last edited by

            @skezo tracking this github issue here:
            https://github.com/Duet3D/RepRapFirmware/issues/437

            can you confirm its fixed in 3.5.0beta3?

            michele-bertoni created this issue in Duet3D/RepRapFirmware

            closed Abort command in load.g or unload.g filament macros changes filament, as it was correctly loaded/unloaded #437

            www.duet3d.com

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