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

    Filament Sensor

    Scheduled Pinned Locked Moved
    Filament Monitor
    5
    15
    808
    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.
    • davidewenundefined
      davidewen
      last edited by

      Help needed coding a filament run-out sensor.

      The documentation I've been able to find is not very user friendly.
      https://duet3d.dozuki.com/Wiki/Connecting_and_configuring_filament-out_sensors

      My sensor is a 3-wire V G S switch.
      I have it wired to io_0, but I can not figure out how to program it so it works.
      I discovered there is also a "trigger" that needs to happen to pause the print and allow changing of the filament.

      Any help is much appreciated.

      1 Reply Last reply Reply Quote 0
      • Phaedruxundefined
        Phaedrux Moderator
        last edited by

        When kind if sensor is it exactly?
        What Duet board are you using?
        What firmware version?
        How exactly have you wired it up so far?

        Z-Bot CoreXY Build | Thingiverse Profile

        davidewenundefined 2 Replies Last reply Reply Quote 0
        • davidewenundefined
          davidewen @Phaedrux
          last edited by

          @phaedrux

          Sensor: 3-wire mechanical switch. Like an end stop switch.
          Board: Duet 3 Mini 5+ (Mini5plus)
          Firmware: RepRapFirmware for Duet 3 Mini 5+ 3.3 (2021-06-15)
          Wired: io_0 (5v to V), (Gnd to Gnd) (S to io0.in)

          1 Reply Last reply Reply Quote 0
          • davidewenundefined
            davidewen @Phaedrux
            last edited by

            @phaedrux

            Sensor is the stock Ender 6 filament sensor

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

              See https://duet3d.dozuki.com/Wiki/Gcode#Section_M591_RepRapFirmware_Num_3

              I don't know anything about the Ender 6 filament sensor, but if it behaves like a real switch (i.e., return either low when filament present and high when absent, or vice versa) then you want something like this in config.g:

              M591 D0 P2 C"io0.in" S1
              

              That says extruder zero (D0), a sensor that is low when filament present (P2) on pin io0 (C"io0.in") and enabled (S1).

              You don't need to also declare a trigger.

              davidewenundefined 1 Reply Last reply Reply Quote 0
              • davidewenundefined
                davidewen @achrn
                last edited by

                @achrn
                Thanks for the response.

                Yes, this is a switch that pressed = filament, unpressed = no filament.

                When I physically press and release the lever, the LED light shows up on the switch, but in Duet Web using M591 D0, I get the same status when the switch is in either state.
                Here's my gcode: M591 D0 P1 C"io0.in" S1
                I've also tried M591 D0 P2 C"io0.in" S1

                So P1 or P2 gives me a response in console, but the state doesn't change when the switch does.

                Here's a video showing the switch in both states and the LED on the switch lighting.
                IMG_0107 (trimmed)-1.mp4

                Here's the console response with the switch in both states.
                console.txt

                1 Reply Last reply Reply Quote 0
                • alankilianundefined
                  alankilian
                  last edited by alankilian

                  @davidewen

                  On the io_0 connector, try jumpering io0.in to ground and run M591 D0
                  Then, jumper it to +5 Volts and run M591 D0 again.

                  Post the results.

                  If you see proper responses from M591 D0, they your sensor or wiring is not functioning.

                  If you do not see the proper results, then your configuration or your Duet board is not functioning.

                  SeemeCNC Rostock Max V3 converted to V3.2 with a Duet2 Ethernet Firmware 3.2 and SE300

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

                    Do you have a multimeter to put on the signal wire and see what the voltage is being presented to the duet as the switch switches?

                    I found a schematic on the web (of doubtful provenance) thats suggested the switch would be high when filament present.

                    davidewenundefined 1 Reply Last reply Reply Quote 0
                    • davidewenundefined
                      davidewen
                      last edited by

                      @alankilian

                      I'm in the middle of a long print.
                      I will test when it is finished.

                      1 Reply Last reply Reply Quote 0
                      • davidewenundefined
                        davidewen @achrn
                        last edited by

                        @achrn

                        5v which I suspected.
                        I have it wired to the 5v on io0 pin header

                        Wiring is:
                        V to 5v on io0
                        G to G on io0
                        S to io0.in
                        (I'm assuming this is correct and that it's not supposed to be wired to the io0.out)

                        kb58undefined achrnundefined 2 Replies Last reply Reply Quote 0
                        • kb58undefined
                          kb58 @davidewen
                          last edited by

                          @davidewen using X.in is correct.

                          Scratch-built 350mmx350mm coreXY, linear rails, ballscrews, 3 Z axis, Duet3 6HC, v3.3, Tool Board v1.1, BondTech LGX + Mosquito hot end

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

                            @davidewen said in Filament Sensor:

                            @achrn

                            5v which I suspected.

                            And does it drop to 0V when the filament is absent?

                            1 Reply Last reply Reply Quote 0
                            • davidewenundefined
                              davidewen @alankilian
                              last edited by

                              @alankilian

                              Jump:
                              G to io0.in

                              Result:
                              M591 D0
                              Simple filament sensor on pin io0.in, disabled, output high when no filament, filament present: yes

                              Jump:
                              5v to io0.in

                              Result:
                              M591 D0
                              Simple filament sensor on pin io0.in, disabled, output high when no filament, filament present: no

                              So, based on your post, my wiring is incorrect.

                              alankilianundefined 1 Reply Last reply Reply Quote 0
                              • alankilianundefined
                                alankilian @davidewen
                                last edited by alankilian

                                @davidewen

                                OK, that's good news, it shows that your board and configuration are working properly.

                                Now connect the sensor and measure the voltage between io0.in and ground on the Duet.

                                Press the switch, what is the voltage?
                                Release the switch, what is the voltage?

                                If the voltage does not change, you can measure the voltage between S and G on the PCB of your switch.

                                If it changes on the PCB but not at the Duet, you've got a bad connector or wire.

                                If it does not change on the PCB, follow the traces on either the NO or NC terminals on the switch back to the Power and Ground connections on the connector and see if there's a break somewhere.

                                SeemeCNC Rostock Max V3 converted to V3.2 with a Duet2 Ethernet Firmware 3.2 and SE300

                                1 Reply Last reply Reply Quote 1
                                • davidewenundefined
                                  davidewen
                                  last edited by

                                  @alankilian

                                  Thanks for your help Alan.
                                  The wiring was incorrect. Now that I have it correct, it's working.

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