• Tags
  • Documentation
  • Order
  • Register
  • Login
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.
  • undefined
    CCS86
    last edited by 23 Feb 2023, 03:44

    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
    undefined 1 Reply Last reply 25 Feb 2023, 00:08 Reply Quote 0
    • undefined
      CCS86 @CCS86
      last edited by 25 Feb 2023, 00:08

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

      undefined 1 Reply Last reply 25 Feb 2023, 00:38 Reply Quote 0
      • undefined
        OwenD @CCS86
        last edited by 25 Feb 2023, 00:38

        @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
        undefined 1 Reply Last reply 25 Feb 2023, 02:29 Reply Quote 1
        • undefined
          CCS86 @OwenD
          last edited by CCS86 25 Feb 2023, 02:29

          @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.

          undefined undefined 2 Replies Last reply 25 Feb 2023, 03:23 Reply Quote 0
          • undefined
            OwenD @CCS86
            last edited by 25 Feb 2023, 03:23

            @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")

            undefined 1 Reply Last reply 25 Feb 2023, 15:36 Reply Quote 1
            • undefined
              CCS86 @OwenD
              last edited by 25 Feb 2023, 15:36

              @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.

              undefined 1 Reply Last reply 25 Feb 2023, 20:26 Reply Quote 0
              • undefined
                OwenD @CCS86
                last edited by 25 Feb 2023, 20:26

                @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
                undefined 1 Reply Last reply 26 Feb 2023, 02:45 Reply Quote 1
                • undefined
                  CCS86 @OwenD
                  last edited by 26 Feb 2023, 02:45

                  @OwenD

                  Good points.

                  1 Reply Last reply Reply Quote 0
                  • undefined
                    achrn @CCS86
                    last edited by 26 Feb 2023, 09:50

                    @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).

                    undefined 1 Reply Last reply 26 Feb 2023, 19:52 Reply Quote 1
                    • undefined
                      CCS86 @achrn
                      last edited by 26 Feb 2023, 19:52

                      @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
                      6 out of 10
                      • First post
                        6/10
                        Last post
                      Unless otherwise noted, all forum content is licensed under CC-BY-SA