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

    Configuring Filament-error.g to play nice with Pause.g

    Scheduled Pinned Locked Moved
    Filament Monitor
    3
    10
    450
    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.
    • CCS86undefined
      CCS86
      last edited by

      Hey guys,

      I am trying to configure my filament runout macro (filament-error.g) to allow automatic unloading followed by a pause to allow manual loading. Since pause.g has redundant code (retraction, lift, repositioning), should I use M226 at the end of my macro like this?

      ;Filament runout macro
      
      M83            ; relative extruder moves
      G1 E-.5 F2000  ; retract 0.5mm of filament
      G91            ; relative positioning
      G1 Z10 F360     ; lift Z by 10mm
      G90            ; absolute positioning
      G1 X5 Y5 F6000 ; go to X5 Y5
      
      G0 E-5 F3600                ; Extract filament to cold end
      G4 S3                       ; Wait for 3 seconds
      G0 E5 F3600                 ; Push back the filament to reduce stringing
      G0 E-15 F3600               ; Extract fast in the cold zone
      G0 E-50 F300                ; Continue extraction slow allow filament to be cooled enough before reaches the gears
      M226                         ; Pause
      
      
      CCS86undefined 1 Reply Last reply Reply Quote 0
      • CCS86undefined
        CCS86 @CCS86
        last edited by

        Okay, M226 did not work. It threw an error.

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

          @CCS86
          Why not wrap the "redundant" code in pause.g in a conditional block?

          if sensors.filamentMonitors[0].status="ok"
             ;do stuff not required on filament change, but required on normal pause
          
          CCS86undefined 1 Reply Last reply Reply Quote 1
          • CCS86undefined
            CCS86 @OwenD
            last edited by CCS86

            @OwenD said in Configuring Filament-error.g to play nice with Pause.g:

            @CCS86
            Why not wrap the "redundant" code in pause.g in a conditional block?

            if sensors.filamentMonitors[0].status="ok"
               ;do stuff not required on filament change, but required on normal pause
            

            I like that approach, thank you.

            Is there a command line call to report the status of a sensor like that, to verify in the console? I searched the wiki and couldn't find anything.

            :edit: I'm testing by writing into a macro. What is the opposite of "ok" status? I have tried !ok, null, bad, off. I can't seem to find any of this stuff on the wiki.

            OwenDundefined achrnundefined 2 Replies Last reply Reply Quote 0
            • OwenDundefined
              OwenD @CCS86
              last edited by

              @CCS86
              To verify in the console just use echo

              echo sensors.filamentMonitors[0].status

              All possible values are here
              https://github.com/Duet3D/RepRapFirmware/wiki/Object-Model-Documentation#sensorsfilamentmonitorsstatus-filamentmonitor

              You could use if (sensors.filamentMonitors[0].status != "ok") however that would resolve to true if the sensor was in an error state for example.
              Probably better to be specific by using if (sensors.filamentMonitors[0].status = "noFilament")

              CCS86undefined 1 Reply Last reply Reply Quote 1
              • CCS86undefined
                CCS86 @OwenD
                last edited by

                @OwenD said in Configuring Filament-error.g to play nice with Pause.g:

                @CCS86
                To verify in the console just use echo

                echo sensors.filamentMonitors[0].status

                All possible values are here
                https://github.com/Duet3D/RepRapFirmware/wiki/Object-Model-Documentation#sensorsfilamentmonitorsstatus-filamentmonitor

                You could use if (sensors.filamentMonitors[0].status != "ok") however that would resolve to true if the sensor was in an error state for example.
                Probably better to be specific by using if (sensors.filamentMonitors[0].status = "noFilament")

                Excellent, thank you much!

                Bookmarked that page for future reference. It would definitely be helpful if the Duet team could add more of this to the wiki. I hate bugging other people for reference I could look up myself.

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

                  @CCS86
                  The object model is very fluid, with additions and changes happening all the time.
                  That particular documentation is auto generated so as to save the development team spending time doing documentation that could otherwise be spent... well developing.

                  It is referenced in the GCode meta data documentation.
                  Unfortunately with so many features, the documentation itself is daunting for new users especially.

                  Perhaps the very start of the documentation page(s) could include a drop down box of selections?

                  Example

                  I'm looking for help on

                  • Firmware installation
                  • Wiring
                  • G Code commands
                  • Conditional G Code & meta commands
                    Etc etc
                  CCS86undefined 1 Reply Last reply Reply Quote 1
                  • CCS86undefined
                    CCS86 @OwenD
                    last edited by

                    @OwenD

                    Good points.

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

                      @CCS86 said in Configuring Filament-error.g to play nice with Pause.g:

                      Is there a command line call to report the status of a sensor like that, to verify in the console? I searched the wiki and couldn't find anything.

                      :edit: I'm testing by writing into a macro. What is the opposite of "ok" status? I have tried !ok, null, bad, off. I can't seem to find any of this stuff on the wiki.

                      If you enable the Object Model Browser, you can browse and watch the values in real time, e.g. in this case feed a bit of filament in and out of your sensor by hand while you watch the values on screen (assuming the screen is within sight of the printer).

                      CCS86undefined 1 Reply Last reply Reply Quote 1
                      • CCS86undefined
                        CCS86 @achrn
                        last edited by

                        @achrn said in Configuring Filament-error.g to play nice with Pause.g:

                        If you enable the Object Model Browser, you can browse and watch the values in real time, e.g. in this case feed a bit of filament in and out of your sensor by hand while you watch the values on screen (assuming the screen is within sight of the printer).

                        Very cool! I hadn't tried that yet, thanks.

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