• Tags
  • Documentation
  • Order
  • Register
  • Login
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.
  • undefined
    davidewen
    last edited by 15 Aug 2021, 01:52

    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
    • undefined
      Phaedrux Moderator
      last edited by 15 Aug 2021, 04:37

      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

      undefined 2 Replies Last reply 15 Aug 2021, 14:50 Reply Quote 0
      • undefined
        davidewen @Phaedrux
        last edited by 15 Aug 2021, 14:50

        @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
        • undefined
          davidewen @Phaedrux
          last edited by 15 Aug 2021, 22:07

          @phaedrux

          Sensor is the stock Ender 6 filament sensor

          1 Reply Last reply Reply Quote 0
          • undefined
            achrn
            last edited by 16 Aug 2021, 18:38

            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.

            undefined 1 Reply Last reply 17 Aug 2021, 12:41 Reply Quote 0
            • undefined
              davidewen @achrn
              last edited by 17 Aug 2021, 12:41

              @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
              • undefined
                alankilian
                last edited by alankilian 17 Aug 2021, 14:07

                @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

                undefined 1 Reply Last reply 19 Aug 2021, 13:33 Reply Quote 0
                • undefined
                  achrn
                  last edited by 17 Aug 2021, 21:13

                  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.

                  undefined 1 Reply Last reply 17 Aug 2021, 21:23 Reply Quote 0
                  • undefined
                    davidewen
                    last edited by 17 Aug 2021, 21:17

                    @alankilian

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

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      davidewen @achrn
                      last edited by 17 Aug 2021, 21:23

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

                      undefined undefined 2 Replies Last reply 17 Aug 2021, 21:33 Reply Quote 0
                      • undefined
                        kb58 @davidewen
                        last edited by 17 Aug 2021, 21:33

                        @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
                        • undefined
                          achrn @davidewen
                          last edited by 18 Aug 2021, 10:26

                          @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
                          • undefined
                            davidewen @alankilian
                            last edited by 19 Aug 2021, 13:33

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

                            undefined 1 Reply Last reply 19 Aug 2021, 13:37 Reply Quote 0
                            • undefined
                              alankilian @davidewen
                              last edited by alankilian 19 Aug 2021, 13:37

                              @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
                              • undefined
                                davidewen
                                last edited by 30 Aug 2021, 12:13

                                @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