Filament Sensor Problem



  • Using M591 to set up a filament sensor....simple m-switch, NO, connected to two outer pins on board connector and plugged in to EO endstop on Duet WiFi. The switch is held closed (hi) with filament in place, and opens (goes lo) when filament runs out and no longer depresses switch.
    I G-Coded P1 for hi signal/filament present, but got no extrusion. Tried P2...again, no extrusion.
    Tested per the following grid, and no matter the P setting, cannot get the sensor to activate extrusion with filament in place. Unplugged the endstop (going to lo) and extrusion is "on". Net, only a switch open/lo condition allows extrusion.

    0_1555817119578_8c6175a4-47e6-4102-abae-24d8ff8b3a1d-image.png

    Here's the endstop code:

    ; End Stops
    M574 X2 Y2 S0 ; 2=endstops at x300 y300 high end S0=active low, NO switch
    M591 D0 P2 C3 S0 ; Filament sensor D=E0, P=NC mswitch, C3=EO endstop

    I must be missing something obvious...Advice???


  • administrators

    The results in your table are as expected. Please run M591 D0 with no additional parameters, to see whether the firmware thinks filament is present or not, with the switch open and with the switch closed. Then repeat the test using P1 in the full M591 configuration command instead of P2.



  • @dc42 The above table seems not as expected, as P1 and P2 give exactly the same results. Rather, they should be reversed.

    Results from the test you requested:
    With the simple M591 D0, a message pops up:
    "Simple filament sensor on endstop 3, enabled, output low when no filament, filament present: yes"
    Results from the pop-up message in tabular form:
    0_1555863322175_423beb85-9a5c-46d1-a82c-cec5090d4b80-image.png
    This set of results gives the same end condition: no actual extrusion unless the sensor is physically open. A closed switch cannot allow extrusion under any setting.
    The "Output when no filament" result always being high is interesting....

    Note also that the results don't change with either S1(enable) or S0 (disable). Results indicate "enabled" no matter the setting.

    Thanks for your attention to this.



  • Still confused...
    Started a print with the probe unplugged because an open switch was the only way I could previously get the extruder to run. Immediately got an error message:
    Printer paused. Extruder 0 reports no filament.
    Machine Props read E0 endstop hit=no, disabled.
    Ran M591 D0 and got: Simple filament sensor on endstop3, enabled, output high when no filament present, filament present=yes.

    The only way I could run this time was to plug in the sensor with filament in it and set it to disabled.
    That allowed the extruder to run. But, at random points during the print, as I checked print status, etc, the No filament present message would pop up, but the print just kept running normally, with the extruder chugging away. I clicked the message away, but that happened two or three more times over an 10 hr print.
    I am totally confused, and I'm sure my posts are confusing, but what am I missing? - it's Ok if you point out that I'm making a stupid error.
    I don't understand why P1 vs P2 doesn't reverse the logic.


  • administrators

    I too am confused that p1 vs p2 don't seem to reverse the logic for you. This is on my list to investigate; but I probably won't have time to test it until after 3D Meetup Sweden. I have already reviewed the code and I didn't spot a problem.


  • administrators

    I decided to work late and test this on my bench system running RRF 3.0beta. It seems to be working properly (read the DWC lines from bottom to top):

    22:59:51
    m591 d0
    Simple filament sensor on pin e0stop, disabled, output high when no filament, filament present: no
    22:59:46
    m591 d0 p2 c"e0stop"
    22:59:30
    m591 d0
    Simple filament sensor on pin e0stop, disabled, output low when no filament, filament present: yes
    22:59:23
    m591 d0 p1 c"e0stop"

    There was nothing connected to the E0 endstop, so it always reads high.

    Then I reverted to firmware 2.02 and tested it again:

    23:04:28
    m591 d0
    Simple filament sensor on endstop 3, disabled, output high when no filament, filament present: no
    23:04:21
    m591 d0 p2 c3
    23:04:04
    m591 d0
    Simple filament sensor on endstop 3, disabled, output low when no filament, filament present: yes
    23:03:50
    m591 d0 p1 c3

    So it works for me running firmware 2.02 as well.

    Are you sure that your connections to the E0 endstop connector are good? Does the E0 endstop LED illuminate when the switch is closed, and go out when it is open?



  • @dc42 I really appreciate your time spent on this, and really don't expect more, though I would welcome it.
    The problem is sporadic, but continues.
    Yesterday, the printer ran fine with the following status (note that it did not run previously due to "no filament present", with exactly this status):
    M591 D0 P2 C3 S1
    The microswitch was held closed by the filament.
    Mach Prop: E0 endstop hit: no
    LED on board: On
    M591 D0 return: Simple filament sensor on endstop 3, enabled, output high with no filament, filament present: yes
    Extruder runs a print : yes

    This morning, I decided to recheck to look at the LED status per your question.
    I changed config parameter to P1 (the only change)
    This resulted in:
    The mswitch still held closed by the filament as yesterday.
    Mach Prop: E0 endstop hit: no
    LED on board: On
    M591 D0 return: Simple filament sensor on endstop 3, enabled, output low with no filament, filament present: no
    Extruder runs: no (attempt to start print returns no filament error)

    So, back to P2 in config, expecting to run as yesterday.
    Result:
    M591 D0 P2 C3 S1
    Mswitch held closed by filament
    Mach Prop: E0 endstop hit: no
    LED on board: On
    M591 D0 return: .....output high with no filament present, filament present: yes
    Extruder runs print: no (no filament error) ...what the heck???
    Re-checked config.g and P2 code did stick.

    So - edited config again, repeating P2 entry and all message results were as directly above, and now print starts with no error message. Driving me nuts.

    So, with filament in place/mswitch closed, both P1 and P2 result in LED on and EO endstop hit: no.

    Net: P1/P2 do invert the M591 D0 return message, but not the LED and Mach Prop message. And whether the filament error message comes up on attempt to print seems somewhat sporadic. As stated in an above post, the no filament error message popped up several times during an active print, as the print ran merrily along.

    Seems that config responds with proper messages, but board LED and Mach Prop don't.
    I have checked the switch...no apparent problem. I am going to re-crimp new pins on the endstop plug and re-route the wires. Ohmmeter checks at end plug show proper operation of switch.

    Basic questions: why is the LED always on when the mswitch is closed, whether config is P1 or P2 (per the original post)? Is board endstop circuit not responding properly/consistently to the gcode? Is that even possible?
    Again thank you for your time... very much appreciated. But more time spent may not be fruitful unless some new factor becomes apparent. I am going to contact the seller about this problem.

    EDIT: The content in Machine Properties frame totally disappeared just now. Total blank!



  • The fact that a filament out error message occurs during an active print and the print continues on was the deciding factor in giving up on this board. When I manually activated the filament sensor, the message popped up and the print did properly stop.
    And now a totally blank Machine Properties frame?
    Something definitely wrong...
    I contacted the Duet seller, MatterHackers, referenced this thread, and they immediately agreed to exchange the board. Absolutely great news and great customer service.
    Given the absolutely superior performance and features of the Duet, I am still blown away by the improved printing performance and my enjoyment factor versus the MKS/Marlin experience. Not knocking MKS/Marlin, but I just didn't click with that system. Highly recommend Duet.
    dc42...thank you for all the time. Hoping the new Duet proves it's not my fault as a rookie that I couldn't get this filament sensor endstop to work.


  • administrators

    @danl said in Filament Sensor Problem:

    Basic questions: why is the LED always on when the mswitch is closed, whether config is P1 or P2 (per the original post)?

    The LED is connected directly to the endstop input. So it is not affected by how you configure the filament monitor, it will be lit when the STP pin is connected to the GND pin by the switch. Likewise, for endstop inputs that are not being used as axis endstops, the Machine Properties page just displays whether the input is low or high, regardless of whether you have a filament monitor connected to it or not.

    If the filament monitor is enabled (S1 in the M591 command) then the print should pause if an out-of-filament condition is detected while trying to use the associated extruder. This definitely works when using the laser filament monitor. I didn't test it using a simple switch on Tuesday because the problem you reported was a different one.



  • @dc42 The problem I reported consistently since the first line in the original post was with a simple microswitch endstop:
    @danl said in Filament Sensor Problem:

    Using M591 to set up a filament sensor....simple m-switch, NO, connected to two outer pins on board connector and plugged in to EO endstop on Duet WiFi.

    As stated, the deciding factor for me was getting random "filament out" messages during active printing and the print continuing just fine.
    An exchange board is coming, and I think the this current one is being sent back to Duet3D. Again, thank you for all the time spent on this.


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.